use of org.wso2.carbon.identity.oauth.OAuthAdminServiceImpl in project identity-inbound-auth-oauth by wso2-extensions.
the class OAuthAdminServiceImplTest method testValidateAudiencesWithInvalidAudiences.
@Test(description = "Test validating invalid audiences", dataProvider = "invalidAudienceDataProvider")
public void testValidateAudiencesWithInvalidAudiences(String[] invalidAudience) {
OAuthConsumerAppDTO appDTO = new OAuthConsumerAppDTO();
appDTO.setAudiences(invalidAudience);
OAuthAdminServiceImpl oAuthAdminService = new OAuthAdminServiceImpl();
try {
invokeMethod(oAuthAdminService, "validateAudiences", appDTO);
} catch (Exception ex) {
Assert.assertTrue(ex instanceof IdentityOAuthClientException);
Assert.assertEquals(((IdentityOAuthClientException) ex).getErrorCode(), Error.INVALID_REQUEST.getErrorCode());
}
}
Aggregations