use of com.blackducksoftware.integration.hub.rest.exception.IntegrationRestException in project hub-alert by blackducksoftware.
the class LoginHandlerTest method authenticateUserWithIntegrationRestExceptionTest.
@Test
public void authenticateUserWithIntegrationRestExceptionTest() throws IntegrationException {
final LoginActions loginActions = Mockito.mock(LoginActions.class);
final LoginHandler loginHandler = new LoginHandler(objectTransformer, loginActions, csrfTokenRepository);
final HttpStatus responseCode = HttpStatus.BAD_GATEWAY;
Mockito.when(loginActions.authenticateUser(Mockito.any(), Mockito.any())).thenThrow(new IntegrationRestException(responseCode.value(), "", ""));
final ResponseEntity<String> response = loginHandler.authenticateUser(null, null, null);
assertEquals(responseCode, response.getStatusCode());
}
Aggregations