@Test public void shouldCreateSystemRoles() { when(roleService.createOrUpdateSystemRoles()).thenReturn(Completable.complete()); cut.upgrade(); }
@Override public boolean upgrade() { logger.info("Applying default roles upgrade"); try { Throwable throwable = roleService.createOrUpdateSystemRoles().blockingGet(); if (throwable != null) { throw throwable; } logger.info("Default roles upgrade, done."); } catch (Throwable e) { logger.error("An error occurs while updating default roles", e); return false; } return true; }
DefaultRoleUpgrader implements Upgrader, Ordered { @Override public boolean upgrade() { logger.info("Applying default roles upgrade"); try { Throwable throwable = roleService.createOrUpdateSystemRoles().blockingGet(); if (throwable != null) { throw throwable; } logger.info("Default roles upgrade, done."); } catch (Throwable e) { logger.error("An error occurs while updating default roles", e); return false; } return true; } }
DefaultRoleUpgrader implements Upgrader, Ordered { @Override public boolean upgrade() { logger.info("Applying default roles upgrade"); try { Throwable throwable = roleService.createOrUpdateSystemRoles().blockingGet(); if (throwable != null) { throw throwable; } logger.info("Default roles upgrade, done."); } catch (Throwable e) { logger.error("An error occurs while updating default roles", e); return false; } return true; } DefaultRoleUpgrader(RoleService roleService); }
DefaultRoleUpgrader implements Upgrader, Ordered { @Override public boolean upgrade() { logger.info("Applying default roles upgrade"); try { Throwable throwable = roleService.createOrUpdateSystemRoles().blockingGet(); if (throwable != null) { throw throwable; } logger.info("Default roles upgrade, done."); } catch (Throwable e) { logger.error("An error occurs while updating default roles", e); return false; } return true; } DefaultRoleUpgrader(RoleService roleService); @Override boolean upgrade(); @Override int getOrder(); }
DefaultRoleUpgrader implements Upgrader, Ordered { @Override public boolean upgrade() { logger.info("Applying default roles upgrade"); try { Throwable throwable = roleService.createOrUpdateSystemRoles().blockingGet(); if (throwable != null) { throw throwable; } logger.info("Default roles upgrade, done."); } catch (Throwable e) { logger.error("An error occurs while updating default roles", e); return false; } return true; } DefaultRoleUpgrader(RoleService roleService); @Override boolean upgrade(); @Override int getOrder();  }