I am writing JUnit test cases for a controller class. In my controller class I am using a couple of entries reading from a property file.
I used the @InjectMock annotation to mock the controller class and I am using the @TestPropertySource annotation to read the test properties but unfortunately I'm getting null values for property entries.
Please help how to read property values in my test class.
This is my sample test class:
@Runwith(MockitoJunitRunner.class)
@TestPropertySource(locations={"classpath: application-test.properties"})
public class Controller test {
@InjectMocks
private Controller controller;
}