title: Mockito - test if return type is same as expected
body: <p>I am beyond frustrated because I can't figure this out. I've been over quite a lot of articles but i can't figure out how to solve this problem, and yet i think i overlook something very simple.</p>
  
  <p>I have a class with a couple of endpoints, one of them is:</p>
  
  <pre><code>@GET
  @Path("courses")
  @Produces(MediaType.APPLICATION_JSON)
  public Response courses(@QueryParam("token") String token) {
      Integer studentId = iStudentDAO.getStudentIdByToken(token);
      if(studentId == null){
          return Response.status(403).build();
      } else {
          GetStudentsResponse studentCourses = iStudentDAO.getStudentCourses(studentId);
          return Response.status(200).entity(courses.name).build();
      }
  }
  </code></pre>
  
  <p>This method should always return a Response.status. And thats exactly what i want to test. I know its not possible to unit tests the actual response (200 or 403) but i would like to know how to test if at least Response.status is returned. Im using Mockito for this in my Maven project.</p>
  
  <pre><code>@Test   
  public void testGetAllCourses () {
     String token = "100-200-300";
     StudentRequests studentRequests = mock(StudentRequests.class);        
     when(studentRequests.courses(token)).thenReturn(Response.class);
     Response expected = Response.class;
     assertEquals(expected, studentRequests.courses());
  }
  </code></pre>
  
  <p>Could anyone explain me how to accomplish this? :)</p>