René's URL Explorer Experiment


Title: GitHub - fanksid/java-testing-with-spock: Code samples from the book "Java testing with Spock"

Open Graph Title: GitHub - fanksid/java-testing-with-spock: Code samples from the book "Java testing with Spock"

X Title: GitHub - fanksid/java-testing-with-spock: Code samples from the book "Java testing with Spock"

Description: Code samples from the book "Java testing with Spock" - fanksid/java-testing-with-spock

Open Graph Description: Code samples from the book "Java testing with Spock" - fanksid/java-testing-with-spock

X Description: Code samples from the book "Java testing with Spock" - fanksid/java-testing-with-spock

Opengraph URL: https://github.com/fanksid/java-testing-with-spock

X: @github

direct link

Domain: patch-diff.githubusercontent.com

route-pattern/:user_id/:repository
route-controllerfiles
route-actiondisambiguate
fetch-noncev2:8c5c3f31-05cf-3ff6-8ca9-7007831827b0
current-catalog-service-hashf3abb0cc802f3d7b95fc8762b94bdcb13bf39634c40c357301c4aa1d67a256fb
request-id90BA:101868:C889D:1021DB:69802EEB
html-safe-nonceb092a8b080693808e970474331134761459607779bd26b5bc7b5d1906c242031
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MEJBOjEwMTg2ODpDODg5RDoxMDIxREI6Njk4MDJFRUIiLCJ2aXNpdG9yX2lkIjoiMTk4Mzg3NTYyODA2NzIwNDg0MyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac9e909d736d6856400e472a5561cf6ea79e5e09e88cfd0bd69b9d630b16972125
hovercard-subject-tagrepository:86171499
github-keyboard-shortcutsrepository,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location//
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/fanksid/java-testing-with-spock
twitter:imagehttps://opengraph.githubassets.com/d7ecba0cb944db9e59f3832a1a0c28ef7c7b7e145ed4da344e3e1ac1596b412a/fanksid/java-testing-with-spock
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d7ecba0cb944db9e59f3832a1a0c28ef7c7b7e145ed4da344e3e1ac1596b412a/fanksid/java-testing-with-spock
og:image:altCode samples from the book "Java testing with Spock" - fanksid/java-testing-with-spock
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None60279d4097367e16897439d16d6bbe4180663db828c666eeed2656988ffe59f6
turbo-cache-controlno-preview
go-importgithub.com/fanksid/java-testing-with-spock git https://github.com/fanksid/java-testing-with-spock.git
octolytics-dimension-user_id13077605
octolytics-dimension-user_loginfanksid
octolytics-dimension-repository_id86171499
octolytics-dimension-repository_nwofanksid/java-testing-with-spock
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forktrue
octolytics-dimension-repository_parent_id27736855
octolytics-dimension-repository_parent_nwokkapelon/java-testing-with-spock
octolytics-dimension-repository_network_root_id27736855
octolytics-dimension-repository_network_root_nwokkapelon/java-testing-with-spock
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release7c85641c598ad130c74f7bcc27f58575cac69551
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock#start-of-content
https://patch-diff.githubusercontent.com/
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffanksid%2Fjava-testing-with-spock
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://patch-diff.githubusercontent.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffanksid%2Fjava-testing-with-spock
Sign up https://patch-diff.githubusercontent.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E&source=header-repo&source_repo=fanksid%2Fjava-testing-with-spock
Reloadhttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock
Reloadhttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock
Reloadhttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock
fanksid https://patch-diff.githubusercontent.com/fanksid
java-testing-with-spockhttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock
kkapelon/java-testing-with-spockhttps://patch-diff.githubusercontent.com/kkapelon/java-testing-with-spock
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Ffanksid%2Fjava-testing-with-spock
Fork 0 https://patch-diff.githubusercontent.com/login?return_to=%2Ffanksid%2Fjava-testing-with-spock
Star 0 https://patch-diff.githubusercontent.com/login?return_to=%2Ffanksid%2Fjava-testing-with-spock
www.manning.com/books/java-testing-with-spockhttps://www.manning.com/books/java-testing-with-spock
0 stars https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/stargazers
135 forks https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/forks
Branches https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/branches
Tags https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tags
Activity https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/activity
Star https://patch-diff.githubusercontent.com/login?return_to=%2Ffanksid%2Fjava-testing-with-spock
Notifications https://patch-diff.githubusercontent.com/login?return_to=%2Ffanksid%2Fjava-testing-with-spock
Code https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock
Pull requests 0 https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/pulls
Actions https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/actions
Projects 0 https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/projects
Wiki https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/wiki
Security 0 https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/security
Insights https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/pulse
Code https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock
Pull requests https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/pulls
Actions https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/actions
Projects https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/projects
Wiki https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/wiki
Security https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/security
Insights https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/pulse
Brancheshttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/branches
Tagshttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tags
https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/branches
https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tags
253 Commitshttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/commits/master/
https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/commits/master/
chapter1https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tree/master/chapter1
chapter1https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tree/master/chapter1
chapter2https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tree/master/chapter2
chapter2https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tree/master/chapter2
chapter3https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tree/master/chapter3
chapter3https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tree/master/chapter3
chapter4https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tree/master/chapter4
chapter4https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tree/master/chapter4
chapter5https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tree/master/chapter5
chapter5https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tree/master/chapter5
chapter6https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tree/master/chapter6
chapter6https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tree/master/chapter6
chapter7https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tree/master/chapter7
chapter7https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tree/master/chapter7
chapter8https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tree/master/chapter8
chapter8https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/tree/master/chapter8
.gitattributeshttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/blob/master/.gitattributes
.gitattributeshttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/blob/master/.gitattributes
.gitignorehttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/blob/master/.gitignore
.gitignorehttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/blob/master/.gitignore
README.mdhttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/blob/master/README.md
README.mdhttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/blob/master/README.md
READMEhttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock
https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock#java-testing-with-spock
https://snap-ci.com/kkapelon/java-testing-with-spock/branch/master
https://camo.githubusercontent.com/112e5b4bb18e2c0012f06720db8c9b5e9b13acc2cba6fd9ae36253a7e1da10bc/687474703a2f2f636f646570697065732e636f6d2f626f6f6b2f6a6176612d74657374696e672d776974682d73706f636b2d626f6f6b2e6a7067
https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock#description
Java Testing With Spockhttps://www.manning.com/books/java-testing-with-spock
https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock#free-chapter-1---intro-to-testing
freely availablehttps://manning-content.s3.amazonaws.com/download/e/82672af-9245-44a7-9542-a9855972700c/SampleChapter-01.pdf
https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock#free-chapter-3---comparison-with-junit
freely availablehttps://manning-content.s3.amazonaws.com/download/3/d90f946-9baf-46eb-859c-fb7a56608320/SampleChapter-03.pdf
https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock#requirements
https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock#usage
work directly on Githubhttps://help.github.com/
download the code as a ZIP filehttps://github.com/kkapelon/java-testing-with-spock/archive/master.zip
https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock#ide-support
https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock#gradle-support
Gradle Buildship pluginhttps://gradle.org/eclipse/
https://github.com/mikesmithsonhttps://github.com/mikesmithson
https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock#code-listings
https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock#chapter-1
Listing 1.1 Sample Spock testhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter1/src/test/groovy/com/manning/spock/chapter1/invoice/InvoiceMailingSpec.groovy
Listing 1.2 Java class under testhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter1/src/main/java/com/manning/spock/chapter1/Adder.java
Listing 1.2 JUnit testhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter1/src/test/java/com/manning/spock/chapter1/AdderTest.java
Listing 1.3 Spock test for the Adder Java classhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter1/src/test/groovy/com/manning/spock/chapter1/AdderSpec.groovy
Listing 1.4 JUnit test for two Java classeshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter1/src/test/java/com/manning/spock/chapter1/MultiplierTest.java
Listing 1.5 Spock test for two Java classeshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter1/src/test/groovy/com/manning/spock/chapter1/MultiplierSpec.groovy
Listing 1.6 Introducing an artificial bug in the Java class under testhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter1/src/main/java/com/manning/spock/chapter1/Multiplier.java
Listing 1.7 A JUnit test where method names are unrelated to business valuehttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter1/src/test/java/com/manning/spock/chapter1/BadTest.java
Listing 1.8 A Spock test where methods explain the business requirementshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter1/src/test/groovy/com/manning/spock/chapter1/BetterSpec.groovy
Listing 2.1 Groovy class conventionshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/Person.groovy
Listing 2.1 Groovy class conventionshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/GettersSettersDemo.groovy
Listing 2.2 Groovy field conventionshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/GettersSettersDemo2.groovy
Listing 2.3 A complete Groovy scripthttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/GettersSettersDemo3.groovy
Listing 2.4 A Spock test using concise Groovy codehttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/test/groovy/com/manning/spock/chapter2/PersonSpec.groovy
Listing 2.5 Creating and using a Java class from Groovyhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/java/com/manning/spock/chapter2/MilitaryPerson.java
Listing 2.5 Creating and using a Java class from Groovyhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/test/groovy/com/manning/spock/chapter2/MilitaryPersonSpec.groovy
Listing 2.6 Groovy optional typing in variableshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/DefDemo.groovy
Listing 2.7 Groovy optional typing in methodshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/DefDemo2.groovy
Listing 2.8 Using dynamic typing in Spock methodshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/test/groovy/com/manning/spock/chapter2/DefDemoSpec.groovy
Listing 2.9 Groovy can convert everything to a booleanhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/GroovyTruth.groovy
Listing 2.10 Groovy truth used in Spock testshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/test/groovy/com/manning/spock/chapter2/GroovyTruthSpec.groovy
Listing 2.11 JUnit test with multiple object creation statementshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/test/java/com/manning/spock/chapter2/ObjectCreationTest.java
Listing 2.12 Spock test with map-based constructorshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/test/groovy/com/manning/spock/chapter2/ObjectCreationSpec.groovy
Listing 2.13 Groovy versus Java mapshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/GroovyCollections.groovy
Listing 2.14 Groovy maps with non-scalar keys and valueshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/GroovyCollections.groovy
Listing 2.15 Groovy versus Java listshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/GroovyCollections.groovy
Listing 2.16 Creating Groovy lists and maps in test codehttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/test/groovy/com/manning/spock/chapter2/ObjectCreationSpec.groovy
Listing 2.17 Using Groovy listshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/GroovyCollections.groovy
Listing 2.18 Using Groovy mapshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/GroovyCollections.groovy
Listing 2.19 Using Groovy Stringhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/GroovyStrings.groovy
Listing 2.20 Using Groovy multiline stringshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/test/groovy/com/manning/spock/chapter2/GroovyTruthSpec.groovy
Listing 2.21 Reading test data from a file in a Spock testhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/test/groovy/com/manning/spock/chapter2/GroovyFilesSpec.groovy
Listing 2.22 Reading XML in Groovyhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/XmlReading.groovy
Listing 2.23 Reading JSON in Groovyhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/JsonReading.groovy
Listing 2.24 Groovy closureshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/GroovyClosure.groovy
Listing 2.25 Using Groovy closures in Spock testshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/test/groovy/com/manning/spock/chapter2/GroovyClosureSpec.groovy
Listing 2.26 Domain classes in Javahttps://github.com/kkapelon/java-testing-with-spock/tree/master/chapter2/src/main/java/com/manning/spock/chapter2/assets
Listing 2.27 Using a Groovy builder for quick object creationhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/assets/GraphBuilderDemo.groovy
Bonus listing - Complex object creation in Javahttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/java/com/manning/spock/chapter2/assets/SampleShipRegistry.java
Listing 2.28 Using Expandos to mock interfaceshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/test/groovy/com/manning/spock/chapter2/ExpandoDemoSpec.groovy
Listing 2.29 Using a Groovy Expando as test data generatorhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter2/src/main/groovy/com/manning/spock/chapter2/ExpandoDemo.groovy
Listing 3.1 A fire control system in Javahttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter3/src/main/java/com/manning/spock/chapter3/fire/FireEarlyWarning.java
Listing 3.1 A fire control system in Javahttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter3/src/main/java/com/manning/spock/chapter3/fire/WarningStatus.java
Listing 3.2 A JUnit test for the fire control systemhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter3/src/test/java/com/manning/spock/chapter3/fire/FireSensorTest.java
Listing 3.3 JUnit test with complex structure (real example)https://github.com/xetorthio/jedis/blob/master/src/test/java/redis/clients/jedis/tests/JedisSentinelTest.java
Listing 3.4 JUnit test that tests two things - DO NOT DO THIShttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter3/src/test/java/com/manning/spock/chapter3/fire/FireSensorTest.java
Listing 3.5 The full Spock test for the fire control systemhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter3/src/test/groovy/com/manning/spock/chapter3/fire/FireSensorSpec.groovy
Listing 3.6 Testing the nuclear reactor scenarios with JUnithttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter3/src/test/java/com/manning/spock/chapter3/nuclear/NuclearReactorTest.java
Listing 3.7 Testing the nuclear reactor scenarios with Spockhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter3/src/test/groovy/com/manning/spock/chapter3/nuclear/NuclearReactorSpec.groovy
Listing 3.8 Java classes for the temperature monitor and readerhttps://github.com/kkapelon/java-testing-with-spock/tree/master/chapter3/src/main/java/com/manning/spock/chapter3/coolant
Listing 3.9 Stubbing with Spockhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter3/src/test/groovy/com/manning/spock/chapter3/coolant/CoolantSensorSpec.groovy
Listing 3.10 Java classes for the temperature monitor, reader and reactor controlhttps://github.com/kkapelon/java-testing-with-spock/tree/master/chapter3/src/main/java/com/manning/spock/chapter3/coolant2
Listing 3.11 Mocking and Stubbing with Spockhttps://github.com/kkapelon/java-testing-with-spock/tree/master/chapter3/src/test/groovy/com/manning/spock/chapter3/coolant2
Bonus Listing - Mocking and Stubbing with JUnit and Mockitohttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter3/src/test/java/com/manning/spock/chapter3/coolant/CoolantSensorTest.java
Listing 3.12 Mocking/Stubbing in a Spock parameterized testhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter3/src/test/groovy/com/manning/spock/chapter3/coolant2/ImprovedCoolantSensorSpec.groovy
Listing 4.1 Spock blocks inside a test methodhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/blocks/BasicBlocksSpec.groovy
Listing 4.2 Java skeleton for an electronic baskethttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/main/java/com/manning/spock/chapter4/Basket.java
Listing 4.2 Java skeleton for an electronic baskethttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/main/java/com/manning/spock/chapter4/Product.java
Listing 4.3 The given-when-then triadhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/blocks/BasketWeightSpec.groovy
Listing 4.4 Using the setup aliashttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/blocks/SetupBlockSpec.groovy
Listing 4.5 A non-trivial when: block - DO NOT DO THIShttps://github.com/rusperstinsky/puntov/blob/master/core/src/test/groovy/mx/lux/pos/model/ArticuloSunglassDescriptorTest.groovy
Listing 4.6 Descriptive when: blockshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/blocks/BasketWeightSpec.groovy
Listing 4.7 Invalid then: blockhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/blocks/BasketWeightSpec.groovy
Listing 4.8 - Using and: to split the given: blockhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/blocks/AndBlockSpec.groovy
Listing 4.9 Using and: to split the when: blockhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/blocks/AndBlockSpec.groovy
Listing 4.10 Using and: as an extension to a then: blockhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/blocks/AndBlockSpec.groovy
Listing 4.11 Trivial tests with the expect: blockhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/blocks/ExpectBlockSpec.groovy
Listing 4.12 Expect block replaces when: and then:https://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/blocks/ExpectBlockSpec.groovy
Listing 4.13 Using expect: for pre-conditionshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/blocks/ExpectBlockSpec.groovy
Listing 4.14 Using cleanup: to release resources even if test failshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/blocks/CleanupBlockSpec.groovy
Listing 4.15 test method describes exactly what is being tested.https://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/blocks/BasketWeightSpec.groovy
Listing 4.16 Marking the class under testhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/specification/BasketWeightSpec.groovy
Listing 4.17 Writing a Spock specificationhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/specification/BasketWeightSpec.groovy
Listing 4.18 Writing a full Spock specificationhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/specification/BasketWeightDetailedSpec.groovy
Listing 4.19 Extracting common initialization codehttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/lifecycle/CommonSetupSpec.groovy
Listing 4.20 Extracting common pre/post conditionshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/lifecycle/CommonCleanupSpec.groovy
Listing 4.21 All Spock lifecycle methodshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/lifecycle/LifecycleSpec.groovy
Listing 4.22 Using the @Shared annotationhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/lifecycle/SharedSpec.groovy
Listing 4.23 Asserting with the old() methodhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/lifecycle/OldMethodSpec.groovy
Listing 4.24 Multiple when-then blockshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/structure/DoubleThenSpec.groovy
Listing 4.25 Missing block descriptions - DO NOT DO THIS https://github.com/rusperstinsky/puntov/blob/master/core/src/test/groovy/mx/lux/pos/util/FileFilterTest.groovy
Listing 4.26 Adding a product twice in the baskethttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/structure/FailureRenderingSpec.groovy
Listing 4.27 Helping failure rendering in the toString() methodhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/main/java/com/manning/spock/chapter4/structure/ProblematicBasket.java
Listing 4.28 Spock support for Hamcrest matchershttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/structure/HamcrestMatchersSpec.groovy
Listing 4.29 Alternative Spock support for Hamcrest matchershttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/structure/HamcrestMatchersSpec.groovy
Listing 4.30 Using Groovy closures in Spock assertionshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/structure/HamcrestMatchersSpec.groovy
Listing 4.31 An imaginary warehousehttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/main/java/com/manning/spock/chapter4/structure/WarehouseInventory.java
Listing 4.32 An enterprisy basket https://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/main/java/com/manning/spock/chapter4/structure/EnterprisyBasket.java
Listing 4.33 Assertions and setup on the same object https://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/structure/GroupingAssertionsSpec.groovy
Listing 4.34 Grouping similar code with Groovy and Spock https://github.com/kkapelon/java-testing-with-spock/blob/master/chapter4/src/test/groovy/com/manning/spock/chapter4/structure/GroupingAssertionsSpec.groovy
Listing 5.1 Duplicate tests - DO NOT DO THIShttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/intro/NaiveImageNameValidatorSpec.groovy
Listing 5.2 Simple Spock parameterized testhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/intro/ImageNameValidatorSpec.groovy
Listing 5.3 The given-when-then-where structurehttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/intro/ImageNameValidatorSpec.groovy
Listing 5.4 Using data tables in Spockhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/tables/SimpleTabularSpec.groovy
Listing 5.5 Using data tables in Spock with typed parametershttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/tables/SimpleTabularSpec.groovy
Listing 5.6 Data tables with one columnhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/tables/SingleColumnSpec.groovy
Listing 5.7 Capturing business needs in data tableshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/discount/DiscountSpec.groovy
Listing 5.8 Lifecycle of parameterized testshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/tables/LifecycleDataSpec.groovy
Listing 5.9 Unrolling parameterized scenarioshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/tables/UnrollDataSpec.groovy
Listing 5.10 Printing parameters of each scenariohttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/tables/UnrollDataSpec.groovy
Listing 5.11 Parameter rendering on the test methodhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/tables/UnrollDataSpec.groovy
Listing 5.12 Custom expressions in data tableshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/expressions/ExpressionInTableSpec.groovy
Listing 5.13 Trivial example of data pipeshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/pipes/BasicPipesSpec.groovy
Listing 5.14 Using Groovy ranges as data generatorshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/pipes/BasicPipesSpec.groovy
Listing 5.15 Using Groovy combinationshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/pipes/BasicPipesSpec.groovy
Listing 5.16 Constant parameters in Spock testshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/pipes/DerivedValuesSpec.groovy
Listing 5.17 Derived parameters in Spock testshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/pipes/DerivedValuesSpec.groovy
Data file validImageNames.txthttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/resources/validImageNames.txt
Listing 5.18 Using existing data generatorshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/pipes/FileReadingSpec.groovy
Data file invalidImageNames.txthttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/resources/invalidImageNames.txt
Listing 5.19 Java iterator that processes invalidImageNames.txthttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/java/com/manning/spock/chapter5/custom/InvalidNamesGen.java
Listing 5.20 Using Java iterators in Spockhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/custom/DataIteratorsSpec.groovy
Data file imageNames.txthttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/resources/imageNames.txt
Listing 5.21 Java multi-valued iteratorhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/java/com/manning/spock/chapter5/custom/MultiVarReader.java
Listing 5.22 Using multi-valued iterators in Spockhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/custom/MultipleVarGenSpec.groovy
Listing 5.23 Using multi-valued assignments in Spockhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter5/src/test/groovy/com/manning/spock/chapter5/custom/MultipleVarGenSpec.groovy
Listing 6.1 Java skeleton code for the eshophttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/main/java/com/manning/spock/chapter6/Product.java
Listing 6.1 Java skeleton code for the eshophttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/main/java/com/manning/spock/chapter6/stubs/WarehouseInventory.java
Listing 6.1 Java skeleton code for the eshophttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/main/java/com/manning/spock/chapter6/Basket.java
Listing 6.2 Creating a Simple Stub with Spockhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/stubs/SimpleStubbingSpec.groovy
Listing 6.3 Stubbing specific argumentshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/stubs/SimpleStubbingSpec.groovy
Listing 6.4 Argument based stub differentiationhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/stubs/SimpleStubbingSpec.groovy
Listing 6.5 Grouping all stubbed methodshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/stubs/SimpleStubbingSpec.groovy
Listing 6.6 Using argument matchers in stubshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/stubs/ArgumentStubbingSpec.groovy
Listing 6.7 Ignoring all arguments of a stubbed method when returning a responsehttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/stubs/ArgumentStubbingSpec.groovy
Listing 6.8 Stubbing subsequent method callshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/stubs/SequenceStubbingSpec.groovy
Listing 6.9 Instructing stubs to throw exceptionshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/stubs/ExceptionStubbingSpec.groovy
Listing 6.10 Stubs that respond according to argumentshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/stubs/DynamicStubbingSpec.groovy
Listing 6.11 A smart stub that looks at both its argumentshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/stubs/DynamicStubbingSpec.groovy
Listing 6.12 Stubbing responses with other stubshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/stubs/StubsInStubsSpec.groovy
Listing 6.13 Mocks can be stubbed toohttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/mocks/SimpleMockingSpec.groovy
Listing 6.14 Java skeleton for credit card charginghttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/main/java/com/manning/spock/chapter6/mocks/Customer.java
Listing 6.14 Java skeleton for credit card charginghttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/main/java/com/manning/spock/chapter6/mocks/CreditCardResult.java
Listing 6.14 Java skeleton for credit card charginghttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/main/java/com/manning/spock/chapter6/mocks/CreditCardProcessor.java
Listing 6.14 Java skeleton for credit card charginghttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/main/java/com/manning/spock/chapter6/mocks/BillableBasket.java
Listing 6.15 Verification of a mocked methodhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/mocks/SimpleMockingSpec.groovy
Listing 6.16 Verification of a specific order of mocked methodshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/mocks/OrderMockingSpec.groovy
Listing 6.17 Explicit declaration of interactionshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/mocks/CardinalityMockingSpec.groovy
Listing 6.18 Verifying interactions for all methods of a classhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/mocks/CardinalityMockingSpec.groovy
Listing 6.19 Verifying non-interactions for all mockshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/mocks/CardinalityMockingSpec.groovy
Listing 6.20 Verifying that arguments were not null when a mocked method is calledhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/mocks/ArgumentTypeVerificationSpec.groovy
Listing 6.21 Verifying the type of argumentshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/mocks/ArgumentTypeVerificationSpec.groovy
Listing 6.22 Verifying exact arguments of a mocked methodhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/mocks/ArgumentVerificationSpec.groovy
Listing 6.23 Verifying part of a object instance used as a mock argumenthttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/mocks/ArgumentVerificationSpec.groovy
Listing 6.24 Using full Groovy closures for argument verificationhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/mocks/ArgumentVerificationSpec.groovy
Listing 6.25 Using Mocks and Stubs in the same testhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/mocks/ComplexMockingSpec.groovy
Listing 6.26 Verifying a sequence of events with interconnected method callshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/mocks/ComplexMockingSpec.groovy
Solution to exercisehttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter6/src/test/groovy/com/manning/spock/chapter6/mocks/ReaderExerciseSpec.groovy
Listing 7.1 Access Spring context from a Spock testhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/spring-standalone-swing/src/test/groovy/com/manning/spock/warehouse/product/RealDatabaseSpec.groovy
Listing 7.2 Rolling back database changes automaticallyhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/spring-standalone-swing/src/test/groovy/com/manning/spock/warehouse/product/RealDatabaseRollbackSpec.groovy
Listing 7.3 Using a reduced Spring context for unit testinghttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/spring-standalone-swing/src/test/groovy/com/manning/spock/warehouse/product/DummyDatabaseSpec.groovy
Listing 7.4 Using Groovy SQL to prepare the DB in a Spock testhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/spring-standalone-swing/src/test/groovy/com/manning/spock/warehouse/product/DummyDatabaseGroovySqlWriteSpec.groovy
Listing 7.5 Using Groovy SQL to prepare the DB in a Spock test - improvedhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/spring-standalone-swing/src/test/groovy/com/manning/spock/warehouse/product/DummyDatabaseGroovySqlWriteSpec.groovy
Listing 7.6 Manual Spring context creationhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/spring-standalone-swing/src/test/groovy/com/manning/spock/warehouse/product/ManualInjectionSpec.groovy
Listing 7.7 Testing REST services with Spock and Spring RestTemplatehttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/rest-service-example/src/test/groovy/com/manning/spock/SpringRestSpec.groovy
Listing 7.8 Running multiple test methods in orderhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/rest-service-example/src/test/groovy/com/manning/spock/SpringRestSpec.groovy
Listing 7.9 Using Groovy Rest Client in a Spock testhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/rest-service-example/src/test/groovy/com/manning/spock/GroovyRestClientSpec.groovy
Listing 7.10 Using Geb and Spock togetherhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/web-ui-example/src/test/groovy/com/manning/spock/HomePageSpec.groovy
Listing 7.11 Using Geb to access page contenthttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/web-ui-example/src/test/groovy/com/manning/spock/HomePageSpec.groovy
Listing 7.12 Using Geb to submit HTML formshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/web-ui-example/src/test/groovy/com/manning/spock/AddProductGebSpec.groovy
Listing 7.13 Running Spock functional tests on a Tomcat instancehttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/web-ui-example/pom.xml
Listing 7.14 Using JaCoCo with Spockhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter7/spring-standalone-swing/pom.xml
Listing 8.1 Expecting an exception in a Spock testhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/extras/ExceptionControlSpec.groovy
Listing 8.2 Detailed examination of an expected exceptionhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/extras/ExceptionControlSpec.groovy
Listing 8.3 Explicit declaration that an exception should not happenhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/extras/ExceptionControlSpec.groovy
Listing 8.4 Marking a test method with the issue it solveshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/extras/IssueDocumentationSpec.groovy
Listing 8.5 Using the URL of an issue solved by a Spock testhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/extras/IssueDocumentationSpec.groovy
Listing 8.6 Marking a Spock test with multiple issueshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/extras/IssueDocumentationSpec.groovy
Listing 8.7 Declaring a test timeouthttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/extras/TimeoutLimitSpec.groovy
Listing 8.8 Declaring a test timeout - custom unithttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/extras/TimeoutLimitSpec.groovy
Listing 8.9 Ignoring a single testhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/extras/SimpleIgnoreSpec.groovy
Listing 8.10 Ignoring all tests apart from onehttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/extras/KeepOneSpec.groovy
Listing 8.11 Skipping Spock tests according to the environmenthttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/extras/SimpleConditionalSpec.groovy
Listing 8.12 Skipping a Spock test based on a dynamic preconditionhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/extras/SmartIgnoreSpec.groovy
Listing 8.13 Requires is the opposite of IgnoreIfhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/extras/RunIfSpec.groovy
Listing 8.14 Release resources with AutoCleanuphttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/extras/AutoCloseSpec.groovy
Listing 8.15 A Spock test with very long setup - DO NOT DO THIShttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/helper/HelperMethodsSpec.groovy
Listing 8.16 Spock test with helper methodshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/helper/HelperMethodsSpec.groovy
Listing 8.17 Using arguments that imply their importance in the testhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/helper/HelperMethodsSpec.groovy
Listing 8.18 Spock test with dubious then: blockhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/helper/HelperMethodsAssertSpec.groovy
Listing 8.19 Improved Spock test with clear separation of checkshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/helper/HelperMethodsAssertSpec.groovy
Listing 8.20 Using helper methods for assertionshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/helper/HelperMethodsAssertSpec.groovy
Listing 8.21 Spock tests with questionable then: blockhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/helper/HelperMethodsInteractSpec.groovy
Listing 8.22 Helper methods with interactions need to be declared explicitlyhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/helper/HelperMethodsInteractSpec.groovy
Listing 8.23 Java code with questionable designhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/main/java/com/manning/spock/chapter8/nuker/CameraFeed.java
Listing 8.23 Java code with questionable designhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/main/java/com/manning/spock/chapter8/nuker/HardDriveNuker.java
Listing 8.23 Java code with questionable designhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/main/java/com/manning/spock/chapter8/nuker/SmartHardDriveNuker.java
Listing 8.24 Creating a spy with Spockhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/spies/SimpleSpySpec.groovy
Listing 8.25 Refactoring Java code to avoid spieshttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/main/java/com/manning/spock/chapter8/nuker2/SmartHardDriveNuker.java
Listing 8.26 Using a mock instead of a spyhttps://github.com/kkapelon/java-testing-with-spock/blob/master/chapter8/src/test/groovy/com/manning/spock/chapter8/spies/NoSpySpec.groovy
https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock#issues-with-the-code
issuehttps://github.com/kkapelon/java-testing-with-spock/issues
https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock#issues-with-the-book
Manning forumhttps://forums.manning.com/forums/java-testing-with-spock
www.manning.com/books/java-testing-with-spockhttps://www.manning.com/books/java-testing-with-spock
Readme https://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock#readme-ov-file
Please reload this pagehttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock
Activityhttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/activity
0 starshttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/stargazers
1 watchinghttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/watchers
0 forkshttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/forks
Report repository https://patch-diff.githubusercontent.com/contact/report-content?content_url=https%3A%2F%2Fgithub.com%2Ffanksid%2Fjava-testing-with-spock&report=fanksid+%28user%29
Releaseshttps://patch-diff.githubusercontent.com/fanksid/java-testing-with-spock/releases
Packages 0https://patch-diff.githubusercontent.com/users/fanksid/packages?repo_name=java-testing-with-spock
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.