Search in sources :

Example 1 with ApplicationIdentityProvider

use of io.gravitee.am.model.idp.ApplicationIdentityProvider in project gravitee-access-management by gravitee-io.

the class ApplicationRepositoryTest method testFindByIdentity.

@Test
public void testFindByIdentity() {
    // create app
    Application app = buildApplication();
    Application appCreated = applicationRepository.create(app).blockingGet();
    // fetch app
    final String next = appCreated.getIdentityProviders().stream().map(ApplicationIdentityProvider::getIdentity).iterator().next();
    TestSubscriber<Application> testSubscriber = applicationRepository.findByIdentityProvider(next).test();
    testSubscriber.awaitTerminalEvent();
    testSubscriber.assertComplete();
    testSubscriber.assertNoErrors();
    testSubscriber.assertValueCount(1);
    testSubscriber.assertValue(s -> s.getId().equals(appCreated.getId()));
}
Also used : Application(io.gravitee.am.model.Application) ApplicationIdentityProvider(io.gravitee.am.model.idp.ApplicationIdentityProvider) Test(org.junit.Test) AbstractManagementTest(io.gravitee.am.repository.management.AbstractManagementTest)

Aggregations

Application (io.gravitee.am.model.Application)1 ApplicationIdentityProvider (io.gravitee.am.model.idp.ApplicationIdentityProvider)1 AbstractManagementTest (io.gravitee.am.repository.management.AbstractManagementTest)1 Test (org.junit.Test)1