use of org.wso2.carbon.identity.oauth2.IdentityOAuth2ScopeClientException in project identity-inbound-auth-oauth by wso2-extensions.
the class OAuth2ScopeServiceTest method testRegisterWithInvalidScopeName.
@Test(dataProvider = "invalidScopeNameProvider")
public void testRegisterWithInvalidScopeName(String scopeName, String expected) {
try {
Scope scope = new Scope(scopeName, "displayName", "description");
oAuth2ScopeService.registerScope(scope);
} catch (IdentityOAuth2ScopeException ex) {
assertEquals(ex.getMessage(), String.format(expected, scopeName));
return;
}
fail("Expected IdentityOAuth2ScopeClientException was not thrown by registerScope method");
}
use of org.wso2.carbon.identity.oauth2.IdentityOAuth2ScopeClientException in project identity-inbound-auth-oauth by wso2-extensions.
the class ScopesApiServiceImplTest method buildRegisterApplication.
@DataProvider(name = "BuildRegisterScope")
public Object[][] buildRegisterApplication() {
IdentityOAuth2ScopeClientException identityOAuth2ScopeClientException = new IdentityOAuth2ScopeClientException("Oauth2 Scope Client Exception");
IdentityOAuth2ScopeException identityOAuth2ScopeException = new IdentityOAuth2ScopeException("Oauth2 Scope Exception");
return new Object[][] { { Response.Status.OK, null }, { Response.Status.BAD_REQUEST, identityOAuth2ScopeClientException }, { Response.Status.CONFLICT, identityOAuth2ScopeClientException }, { Response.Status.INTERNAL_SERVER_ERROR, identityOAuth2ScopeException } };
}
use of org.wso2.carbon.identity.oauth2.IdentityOAuth2ScopeClientException in project identity-inbound-auth-oauth by wso2-extensions.
the class ScopesApiServiceImplTest method checkScopeException.
@DataProvider(name = "checkisScopeException")
public Object[][] checkScopeException() {
IdentityOAuth2ScopeClientException identityOAuth2ScopeClientException = new IdentityOAuth2ScopeClientException("Oauth2 Scope Client Exception");
IdentityOAuth2ScopeException identityOAuth2ScopeException = new IdentityOAuth2ScopeException("Oauth2 Scope Exception");
return new Object[][] { { Response.Status.OK, null }, { Response.Status.NOT_FOUND, null }, { Response.Status.BAD_REQUEST, identityOAuth2ScopeClientException }, { Response.Status.INTERNAL_SERVER_ERROR, identityOAuth2ScopeException } };
}
use of org.wso2.carbon.identity.oauth2.IdentityOAuth2ScopeClientException in project identity-inbound-auth-oauth by wso2-extensions.
the class ScopesApiServiceImplTest method buildGetApplication.
@DataProvider(name = "BuildGetScope")
public Object[][] buildGetApplication() {
IdentityOAuth2ScopeClientException identityOAuth2ScopeClientException = new IdentityOAuth2ScopeClientException("Oauth2 Scope Client Exception");
IdentityOAuth2ScopeException identityOAuth2ScopeException = new IdentityOAuth2ScopeException("Oauth2 Scope Exception");
return new Object[][] { { Response.Status.OK, null }, { Response.Status.BAD_REQUEST, identityOAuth2ScopeClientException }, { Response.Status.NOT_FOUND, identityOAuth2ScopeClientException }, { Response.Status.INTERNAL_SERVER_ERROR, identityOAuth2ScopeException } };
}
use of org.wso2.carbon.identity.oauth2.IdentityOAuth2ScopeClientException in project identity-inbound-auth-oauth by wso2-extensions.
the class ScopesApiServiceImplTest method buildDeleteApplication.
@DataProvider(name = "BuildDeleteScope")
public Object[][] buildDeleteApplication() {
IdentityOAuth2ScopeClientException identityOAuth2ScopeClientException = new IdentityOAuth2ScopeClientException("Oauth2 Scope Client Exception");
IdentityOAuth2ScopeException identityOAuth2ScopeException = new IdentityOAuth2ScopeException("Oauth2 Scope Exception");
return new Object[][] { { Response.Status.OK, null }, { Response.Status.BAD_REQUEST, identityOAuth2ScopeClientException }, { Response.Status.NOT_FOUND, identityOAuth2ScopeClientException } };
}
Aggregations