Search in sources :

Example 71 with ServiceProvider

use of org.wso2.carbon.identity.application.common.model.xsd.ServiceProvider in project carbon-identity-framework by wso2.

the class ApplicationManagementServiceImplTest method addApplicationDataProvider.

@DataProvider(name = "addApplicationDataProvider")
public Object[][] addApplicationDataProvider() {
    ServiceProvider serviceProvider1 = new ServiceProvider();
    serviceProvider1.setApplicationName(APPLICATION_NAME_1);
    ServiceProvider serviceProvider2 = new ServiceProvider();
    serviceProvider2.setApplicationName(APPLICATION_NAME_2);
    return new Object[][] { { serviceProvider1, SUPER_TENANT_DOMAIN_NAME, USERNAME_1 }, { serviceProvider2, SAMPLE_TENANT_DOMAIN, USERNAME_2 } };
}
Also used : ServiceProvider(org.wso2.carbon.identity.application.common.model.ServiceProvider) DataProvider(org.testng.annotations.DataProvider)

Example 72 with ServiceProvider

use of org.wso2.carbon.identity.application.common.model.xsd.ServiceProvider in project carbon-identity-framework by wso2.

the class ApplicationManagementServiceImplTest method testGetServiceProviderByClientId.

@Test
public void testGetServiceProviderByClientId() throws IdentityApplicationManagementException {
    ServiceProvider inputSP = new ServiceProvider();
    inputSP.setApplicationName(APPLICATION_NAME_1);
    addApplicationConfigurations(inputSP);
    // Adding application.
    applicationManagementService.createApplication(inputSP, SUPER_TENANT_DOMAIN_NAME, USERNAME_1);
    // Retrieving application by ResourceId.
    ServiceProvider actual = applicationManagementService.getServiceProviderByClientId("auth key", "oauth2", SUPER_TENANT_DOMAIN_NAME);
    Assert.assertEquals(actual.getApplicationName(), inputSP.getApplicationName());
    Assert.assertEquals(actual.getOwner().getUserName(), USERNAME_1);
    Assert.assertEquals(actual.getDescription(), inputSP.getDescription());
    // Deleting added application.
    applicationManagementService.deleteApplications(SUPER_TENANT_ID);
}
Also used : ServiceProvider(org.wso2.carbon.identity.application.common.model.ServiceProvider) Test(org.testng.annotations.Test)

Example 73 with ServiceProvider

use of org.wso2.carbon.identity.application.common.model.xsd.ServiceProvider in project carbon-identity-framework by wso2.

the class ApplicationManagementServiceImplTest method addApplicationInvalidAppNameDataProvider.

@DataProvider(name = "addApplicationInvalidAppNameDataProvider")
public Object[][] addApplicationInvalidAppNameDataProvider() {
    ServiceProvider serviceProvider1 = new ServiceProvider();
    serviceProvider1.setApplicationName("@#!app");
    ServiceProvider serviceProvider2 = new ServiceProvider();
    serviceProvider2.setApplicationName("1234@");
    return new Object[][] { { serviceProvider1, SUPER_TENANT_DOMAIN_NAME, USERNAME_1 }, { serviceProvider2, SUPER_TENANT_DOMAIN_NAME, USERNAME_1 } };
}
Also used : ServiceProvider(org.wso2.carbon.identity.application.common.model.ServiceProvider) DataProvider(org.testng.annotations.DataProvider)

Example 74 with ServiceProvider

use of org.wso2.carbon.identity.application.common.model.xsd.ServiceProvider in project carbon-identity-framework by wso2.

the class ApplicationManagementServiceImplTest method addApplications.

private void addApplications() throws IdentityApplicationManagementException {
    ServiceProvider serviceProvider1 = new ServiceProvider();
    serviceProvider1.setApplicationName(APPLICATION_NAME_1);
    ServiceProvider serviceProvider2 = new ServiceProvider();
    serviceProvider2.setApplicationName(APPLICATION_NAME_2);
    applicationManagementService.addApplication(serviceProvider1, SUPER_TENANT_DOMAIN_NAME, USERNAME_1);
    applicationManagementService.addApplication(serviceProvider2, SUPER_TENANT_DOMAIN_NAME, USERNAME_1);
}
Also used : ServiceProvider(org.wso2.carbon.identity.application.common.model.ServiceProvider)

Example 75 with ServiceProvider

use of org.wso2.carbon.identity.application.common.model.xsd.ServiceProvider in project carbon-identity-framework by wso2.

the class ApplicationManagementServiceImplTest method addApplicationWithExistingAppNameDataProvider.

@DataProvider(name = "addApplicationWithExistingAppNameDataProvider")
public Object[][] addApplicationWithExistingAppNameDataProvider() {
    ServiceProvider serviceProvider = new ServiceProvider();
    serviceProvider.setApplicationName(APPLICATION_NAME_1);
    ServiceProvider newServiceProvider = new ServiceProvider();
    newServiceProvider.setApplicationName(APPLICATION_NAME_1);
    return new Object[][] { { serviceProvider, newServiceProvider, SUPER_TENANT_DOMAIN_NAME, USERNAME_1 } };
}
Also used : ServiceProvider(org.wso2.carbon.identity.application.common.model.ServiceProvider) DataProvider(org.testng.annotations.DataProvider)

Aggregations

ServiceProvider (org.wso2.carbon.identity.application.common.model.ServiceProvider)222 Test (org.testng.annotations.Test)120 ServiceProvider (org.wso2.carbon.identity.application.common.model.xsd.ServiceProvider)96 IdentityApplicationManagementException (org.wso2.carbon.identity.application.common.IdentityApplicationManagementException)85 ArrayList (java.util.ArrayList)65 PrepareForTest (org.powermock.core.classloader.annotations.PrepareForTest)58 HashMap (java.util.HashMap)50 InboundAuthenticationRequestConfig (org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationRequestConfig)49 ApplicationManagementService (org.wso2.carbon.identity.application.mgt.ApplicationManagementService)40 ClaimMapping (org.wso2.carbon.identity.application.common.model.ClaimMapping)35 AuthenticatedUser (org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser)33 AuthenticationContext (org.wso2.carbon.identity.application.authentication.framework.context.AuthenticationContext)29 InboundAuthenticationRequestConfig (org.wso2.carbon.identity.application.common.model.InboundAuthenticationRequestConfig)26 SequenceConfig (org.wso2.carbon.identity.application.authentication.framework.config.model.SequenceConfig)25 IdentityException (org.wso2.carbon.identity.base.IdentityException)23 Property (org.wso2.carbon.identity.application.common.model.xsd.Property)21 LocalAndOutboundAuthenticationConfig (org.wso2.carbon.identity.application.common.model.LocalAndOutboundAuthenticationConfig)20 InboundAuthenticationConfig (org.wso2.carbon.identity.application.common.model.xsd.InboundAuthenticationConfig)20 IdentityOAuth2Exception (org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception)20 Matchers.anyString (org.mockito.Matchers.anyString)19