Search in sources :

Example 1 with NotAcceptableException

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);
    }
}
Also used : NotAcceptableException(org.wso2.carbon.identity.user.endpoint.exceptions.NotAcceptableException) Test(org.testng.annotations.Test)

Aggregations

Test (org.testng.annotations.Test)1 NotAcceptableException (org.wso2.carbon.identity.user.endpoint.exceptions.NotAcceptableException)1