Skip to content
Advertisement

Tag: testing

Best practice for Unit Testing class which is mostly responsible to call methods of dependencies, but contains logic as well

Let’s assume I have StartCommandHandler which has responsibility to create some file with required files. But for doing this I have to give him a set of sub-responsibilities, like: Checks whether file exists in the FTP If Not downloads files from multiple sources to the temp folder Then executes some script in the folder Then read generated file after script

Dynamically add property sources to SpringBootTest

Similar to Springboot unit test set @Configuration Properties dynamically but the context is different. In my case I have a TestContainer running a custom MySQL database that is prepopulated with a lot of data (not using the SQL batch loading approach because the data is an anonymized copy of production and doing it through SQLs makes the boot up time

Mocking Unirest with mockito

I am in my starting programming phase and I wanted to ask about mocking Objects with Mockito, more specifically is the Unirest response. Let’s say I have a database, and I dont what to bother it every time I do testing, and I want to use Mockito for that, but the problem is I am not sure how to create

Karate karate-config.js not a js function

I’m trying use karate for e2e tests and have started with a minimal setup. I want to create some config items in karate-config.js for use in the tests but karate is reporting that file is not a js function and hence the test fails trying to get the config: This is my karate-config.js: This is my insurer.feature test: This is

What is mockito-inline and how does it work to mock final methods?

Javadocs in Mockito says – “Starting with version 2.7.6, we offer the ‘mockito-inline’ artifact that enables inline mock making without configuring the MockMaker extension file”. What does this mean? How does mockito-inline works ? Why a separate artifact for mockito-inline? Answer I stumbled upon this too and the answer is buried quite deep in the docs, so here it is.

Advertisement