Month: February 2021

When developing REST APIs, it is important to have accurate and well-structured documentation of your API. This documentation is the reference point for anyone who wants to use your API. Spring REST Docs helps you to achieve it. Spring REST Docs take a different approach than any other traditional tools like Swagger. For more information on […]Continue reading

Parameterized tests in JUnit 5 enable you to run a test multiple times with different parameters. It helps the developers to save time in writing and executing the tests. We can write JUnit 5 parameterized tests just like regular JUnit 5 tests but have to use the @ParameterizedTest annotation instead. In a parameterized test, you […]Continue reading

MapStruct and Project Lombok are two tools which can make your life as a developer much easier. MapStruct is a slick project which generates type mappers via simple interfaces. You define an interface method to accept a source type with a return type. And MapStruct generates the implementation of the mapper. Project Lombok is a […]Continue reading

ArgumentCaptor in Mockito allows you to capture arguments passed to methods for further assertions. You can apply standard JUnit assertion methods, such as assertEquals(), assertThat(), and so on, to perform assertions on the captured arguments. In Mockito, you will find the ArgumentCaptor class in the org. mockito package If you are new to mocking with […]Continue reading