OPI Blog
Learn from experts in their fields

Browsing Tags: spock

May 21, 2019
Speed Up Spock Spring Tests
This article follows up some excellent info on testing Spring with Spock here and here. Developing with Spring and testing with Spock means you’re using two of the best tools available on the JVM today. ...
Why your tests may pass locally but fail in Jenkins
The dreaded “works on my machine” test failure not only reduces trust in your automated builds and continuous integration, but could also be the sign of a bug that doesn’t manifest on your machine. I’ve ...
Spock 1.2 Annotations for Spring Integration Testing
@SpringBean, @SpringSpy, and @UnwrapAopProxy are new annotations in Spock 1.2 that make it easier to inject mocks into the Spring context when doing Integration testing. These can greatly simplify your code from using a @TestConfiguration ...
May 2, 2018
Logical GWT client testing with Spock
GWT – Google Web Toolkit may not be as heavily used as it once was 5-10 years ago, though many enterprise teams and legacy projects are still using the technology. While we can easily use ...
Functional Testing With Embedded Kafka
Spring publishes a spring-kafka-test library that is promoted as a way to do some unit testing with Kafka. The project I’m currently working on reads messages from a JMS queue, does some transforming of that ...
Sep 28, 2017
Aggregate Services into a Single Swagger
By now most companies that have pointed their ship towards some sort of service architecture (in buzz words, microservices) have also discovered an API explorer to ease the pains of developers that are trying to ...
Unit Testing Camel Routes with Spock
Introduction Apache Camel’s variety of components and message routing logic capabilities makes testing a requirement to ensure your routes are performing as expected. Since Camel routes are built within a context, it usually follows that ...
Implement a GraphQL Endpoint in a Groovy App
GraphQL is on the rise as an alternative approach to traditional REST APIs. Created by Facebook, GraphQL provides a better way for the consumer of an API to ask for what they need and get ...
Spring Integration Testing with Spock Mocks
We all know it’s important to write tests for our code. Often we write unit tests and mock out the dependencies for the class under test. But eventually there is something we need to test that ...
Reset Your H2 Database For A Clean State Between Functional Tests
If you’re running automated functional testing as part of your build process, you probably know about test isolation (Martin Fowler has a great article on this and other issues with test non-determinism): A single test can ...