use of org.wso2.carbon.identity.user.endpoint.exceptions.NotAcceptableException in project identity-governance by wso2-extensions.
the class HandleExceptionsTest method testHandleNotAcceptableException.
@Test
public void testHandleNotAcceptableException() {
NotAcceptableException notAcceptableException = new NotAcceptableException();
assertEquals(notAcceptableException.getResponse().getStatus(), 406);
String errorCode = "Test Code";
String errorMessage = "Test Error";
try {
Utils.handleNotAcceptable(errorMessage, errorCode);
} catch (NotAcceptableException exception) {
assertEquals(exception.getResponse().getStatus(), 406);
assertEquals(exception.getMessage(), errorMessage);
}
}
Aggregations