title: How to mock Environment Interface
body: <p>I have to fetch path from the property file using Environment interface. In Junits I am not able to mock the Environment Interface. Below is my code. I want something random if I will call the method mentioned. How can I do it?</p>
  
  <pre><code>@Mock
      private Class object;
   @InjectMocks
      Class2 object2;
  
  Mockito.when(object.getFilePath()).thenReturn("Random String");
  </code></pre>