Category "junit"

Spring JUnit: How to Mock autowired component in autowired component

I've got a Spring component I'd like to test and this component has an autowired attribute which I need to change for the purpose of unit testing. The problem i

JUnit5: How to assert several properties of an object with a single assert call?

I want to assert several properties of an object with a single assert call. With JUnit 4 and Hamcrest I would have written something like this: assertThat(pro

Is it at all possible to execute 'mvn test' when tests are in src/main/java and not in src/test/java [duplicate]

I have inherited a project which has over 100 Junit test classes. The problem is the unit test sources and main source files are in the same

Getting "Skipping JaCoCo execution due to missing execution data file" upon executing JaCoCo

I'm using Maven 3.0.3, JUnit 4.8.1, and Jacoco 0.6.3.201306030806, and I am trying to create test coverage reports. I have a project with unit tests only, but

How to use OR condition with TestNG assertions

Is there a way to do assertions with OR with TestNG? This is what I am trying to find: assertEquals(expected, value1 || value2); // Can be any number of valu