use of org.wso2.carbon.apimgt.api.ApplicationNameWithInvalidCharactersException in project carbon-apimgt by wso2.
the class RestApiUtilTest method testisDueToApplicationNameWhiteSpaceValidationWithInvalidException.
@Test
public void testisDueToApplicationNameWhiteSpaceValidationWithInvalidException() throws Exception {
ApplicationNameWithInvalidCharactersException applicationNameWithInvalidCharactersException = new ApplicationNameWithInvalidCharactersException("New Sample exception");
Throwable testThrowable = new Throwable();
PowerMockito.spy(RestApiUtil.class);
PowerMockito.doReturn(applicationNameWithInvalidCharactersException).when(RestApiUtil.class, "getPossibleErrorCause", testThrowable);
Assert.assertFalse("Invalid exception has been passed.", RestApiUtil.isDueToApplicationNameWhiteSpaceValidation(testThrowable));
}
use of org.wso2.carbon.apimgt.api.ApplicationNameWithInvalidCharactersException in project carbon-apimgt by wso2.
the class RestApiUtilTest method testisDueToApplicationNameWithInvalidCharacters.
@Test
public void testisDueToApplicationNameWithInvalidCharacters() throws Exception {
ApplicationNameWithInvalidCharactersException applicationNameWithInvalidCharactersException = new ApplicationNameWithInvalidCharactersException("New Sample exception");
Throwable testThrowable = new Throwable();
PowerMockito.spy(RestApiUtil.class);
PowerMockito.doReturn(applicationNameWithInvalidCharactersException).when(RestApiUtil.class, "getPossibleErrorCause", testThrowable);
Assert.assertTrue("Invalid exception has been passed.", RestApiUtil.isDueToApplicationNameWithInvalidCharacters(testThrowable));
}
Aggregations