title: Mockito Mocking a return value and verify it
body: <p>I have this class and wants to create a mock to return and verify the return value "50": <br>
  <code>QAService.java:</code> <br></p>
  
  <pre><code>@Path("/QAService")
  public class QAService {
  @GET()
  //@Path("/")
  @Produces("text/plain")
  public String getServiceInfo() {
      return "50";
  }
  </code></pre>
  
  <p>My understanding of mock by defintion is that I can create a fake object of an implementation class and mock functions yet to be developed so I can test the interface. </p>
  
  <p>Still I am creating this test to test mocking without having an interface. How do I verify it?:<br>
  <code>QAServiceTest.java:</code></p>
  
  <pre><code>public class QAServiceTest {
  
      @Test
      public void getserviceTest () {
  
      QAService qasmock = mock(QAService.class);
      when(qasmock.getServiceInfo()).thenReturn("50");
      String expected = "50";
      assertEquals(expected, qasmock.getServiceInfo());
      }
  }
  </code></pre>