Tagged articles
Spock
18 articles · Page 1 of 1
This article outlines how a team tackled long‑standing automation gaps in custom output modules and second‑party packages by introducing a lightweight interception verification system and a Groovy‑Spock data‑driven testing framework, achieving full‑coverage regression in minutes, reducing bug detection time, and boosting overall testing efficiency.
Backend testingContinuous IntegrationGroovy
0 likes · 9 min read

This article compares a Java + TestNG + HttpClient stack with a Groovy + Spock + RestAssured approach, showing how data‑driven testing, encryption handling, data extraction, and validation can be streamlined for more flexible and efficient API testing.
API testingData‑Driven TestingGroovy
0 likes · 17 min read


政采云技术Feb 7, 2023 · Fundamentals
This article provides an in‑depth tutorial on unit testing using Spock, covering its advantages over JUnit, core concepts like specifications, fixtures, feature methods, data‑driven testing, mock and stub techniques, interaction constraints, and tooling for automated test generation, all illustrated with Groovy and Java code examples.
Data‑Driven TestingGroovyJava
0 likes · 22 min read

Spock is an open‑source Java/Groovy testing framework that blends JUnit‑style structure with a concise Groovy DSL, offering data‑driven “given‑expect‑where” tests, straightforward mocking and property injection, Maven‑based setup, and seamless PowerMock integration for static‑method mocking, making it a powerful alternative to traditional unit‑test tools.
GroovyJavaMocking
0 likes · 17 min read

This article provides a step‑by‑step guide on mocking static variables and static methods in the Spock testing framework using PowerMock, covering annotation setup, custom behavior definitions, and handling mixed scenarios where both static and instance mocks are required.
Java TestingMockitoPowerMock
0 likes · 5 min read

This article walks through setting up Spock for Java/Groovy projects, lists required Maven dependencies, shows how to handle static‑method mocking with PowerMock and Mockito, and provides concrete code examples for mocking @Autowired components, shared objects, and defining mock behavior.
BackendGroovyJava
0 likes · 11 min read

The author describes encountering quality‑assurance challenges in Spring Boot, revisiting unit‑testing frameworks like Spock, Mockito, and PowerMock, struggling with static‑method mocking, and ultimately adopting a "reset and rebuild" strategy to resolve dependency conflicts and improve test coverage.
MockingMockitoPowerMock
0 likes · 5 min read

This article explains what unit testing is, how to implement it with frameworks like Spock, provides a simple Groovy example, and discusses the advantages and drawbacks of unit tests for software development.
GroovySpockTest Automation
0 likes · 8 min read

This article demonstrates how Groovy's MetaClass can be used at runtime to add object methods, static methods, and properties to classes, and includes a complete Spock unit‑test example that verifies dynamic behavior with detailed code snippets and console output.
GroovyMetaclassSpock
0 likes · 7 min read

The article presents a comprehensive guide to using the Spock testing framework for Java and Groovy backend development, illustrating its BDD‑style DSL, data‑driven tables, integrated mocking (including static methods via PowerMock), exception verification, in‑memory DAO testing, and enhanced coverage reporting compared to JUnit.
BDDGroovyJava
0 likes · 35 min read

This article extends the previous JsonPath utility guide by demonstrating how to write comprehensive Groovy‑based Spock unit tests, covering Maven/Gradle setup, basic and data‑driven demos, detailed test cases for JSON path extraction, array operations, statistical functions, and a deliberately introduced bug with its console output.
GroovyJSONJava
0 likes · 7 min read

This article walks through the creation of a Groovy‑compatible JsonPath utility library, explaining its design, key methods for extracting various data types, a custom verification helper, and how to test it later with the Spock framework.
GroovyJSONPathJava
0 likes · 6 min read

This article demonstrates how to use Java's Deflater and DeflaterOutputStream classes to compress data into Base64 strings, how to decompress them with InflaterOutputStream, and includes Spock test cases that compare compressed and original lengths for various inputs.
CompressionSpockdeflater
0 likes · 6 min read

This article introduces the Groovy‑based Spock framework and the Mockito mocking library, shows how to configure them together in Gradle, and provides detailed Groovy demo code illustrating various mocking, spying, verification, and exception‑handling techniques for robust Java unit testing.
GradleGroovyJava
0 likes · 8 min read

This article explains the major changes in Spock 2.0 M1, how to integrate it with JUnit 5 via the JUnit Platform, provides step‑by‑step Gradle and Maven configurations, discusses compatibility issues with Groovy versions, and offers solutions for JUnit 4 Rule migration.
GradleJUnit5Java Testing
0 likes · 6 min read

This article compares four popular Java testing frameworks—JUnit, JBehave, Selenide, and Spock—examining their prerequisites, strengths, weaknesses, and ideal use cases when integrated with Selenium WebDriver for UI and BDD testing.
JBehaveJUnitJava
0 likes · 13 min read

The article explains why many developers avoid unit testing despite its importance, demonstrates a Java method for filtering unpromised tools in a home‑renovation app, provides complete JUnit and Groovy/Spock test implementations, and shows how richer output from Groovy/Spock can speed debugging.
GroovyJUnitJava
0 likes · 10 min read

This article introduces the versatile Spock testing framework, explains why it’s favored for Groovy projects despite compatibility quirks, and provides a collection of runnable demo specs that showcase Spock’s expressive syntax, data‑driven testing, and detailed reporting.
GroovyJavaSpock
0 likes · 5 min read
