@Test public void testLogin() throws Exception { request.setParameter("username", "A8AB4B572A3B4B0FA01539DCFD3A74A8"); request.setParameter("password", "000000"); result = controller.login(request, response); Assert.isTrue("ok".equalsIgnoreCase(result.getCode())); }
@Test public void testLoginCorrect() { LoginRequest userLogin = LoginRequest.builder().build(); Mockito.when(authenticationService.login(userLogin)) .thenReturn(LoginResponse.builder().build()); LoginResponse loginResponse = classUnderTest.login(userLogin); Mockito.verify(authenticationService, Mockito.times(1)).login(userLogin); }