@Test public void shouldCreateSystemScope() { when(scopeService.findByDomainAndKey(eq(DOMAIN_ID), anyString())).thenReturn(Maybe.empty()); when(scopeService.create(anyString(),any(NewSystemScope.class))).thenReturn(Single.just(new Scope())); assertTrue(openIDScopeUpgrader.upgrade()); verify(scopeService, times(io.gravitee.am.common.oidc.Scope.values().length)).create(anyString(), any(NewSystemScope.class)); }
@Override public boolean upgrade() { logger.info("Applying OIDC scope upgrade"); domainService.findAll() .flatMapObservable(Observable::fromIterable) .flatMapSingle(this::createOrUpdateSystemScopes) .subscribe(); return true; }
OpenIDScopeUpgrader implements Upgrader, Ordered { @Override public boolean upgrade() { logger.info("Applying OIDC scope upgrade"); domainService.findAll() .flatMapObservable(Observable::fromIterable) .flatMapSingle(this::createOrUpdateSystemScopes) .subscribe(); return true; } }
OpenIDScopeUpgrader implements Upgrader, Ordered { @Override public boolean upgrade() { logger.info("Applying OIDC scope upgrade"); domainService.findAll() .flatMapObservable(Observable::fromIterable) .flatMapSingle(this::createOrUpdateSystemScopes) .subscribe(); return true; }  }
OpenIDScopeUpgrader implements Upgrader, Ordered { @Override public boolean upgrade() { logger.info("Applying OIDC scope upgrade"); domainService.findAll() .flatMapObservable(Observable::fromIterable) .flatMapSingle(this::createOrUpdateSystemScopes) .subscribe(); return true; }  @Override boolean upgrade(); @Override int getOrder(); }
OpenIDScopeUpgrader implements Upgrader, Ordered { @Override public boolean upgrade() { logger.info("Applying OIDC scope upgrade"); domainService.findAll() .flatMapObservable(Observable::fromIterable) .flatMapSingle(this::createOrUpdateSystemScopes) .subscribe(); return true; }  @Override boolean upgrade(); @Override int getOrder();  }