@Test public void testApplies_statusActive() throws Exception { User user = new User(); user.setStatus(UserStatus.active); when(securitySystem.getUser("admin", "default")).thenReturn(user); assertThat(underTest.applies(), is(false)); }
@Override public boolean applies() { try { User user = securitySystem.getUser("admin", UserManagerImpl.DEFAULT_SOURCE); return UserStatus.changepassword.equals(user.getStatus()); } catch (UserNotFoundException e) { log.trace("admin user not found in system, marking onboarding item as not applicable.", e); } catch (NoSuchUserManagerException e) { log.trace("default UserManager not found in system, marking onboarding item as not applicable.", e); } return false; }
ChangeAdminPasswordOnboardingItem extends ComponentSupport implements OnboardingItem { @Override public boolean applies() { try { User user = securitySystem.getUser("admin", UserManagerImpl.DEFAULT_SOURCE); return UserStatus.changepassword.equals(user.getStatus()); } catch (UserNotFoundException e) { log.trace("admin user not found in system, marking onboarding item as not applicable.", e); } catch (NoSuchUserManagerException e) { log.trace("default UserManager not found in system, marking onboarding item as not applicable.", e); } return false; } }
ChangeAdminPasswordOnboardingItem extends ComponentSupport implements OnboardingItem { @Override public boolean applies() { try { User user = securitySystem.getUser("admin", UserManagerImpl.DEFAULT_SOURCE); return UserStatus.changepassword.equals(user.getStatus()); } catch (UserNotFoundException e) { log.trace("admin user not found in system, marking onboarding item as not applicable.", e); } catch (NoSuchUserManagerException e) { log.trace("default UserManager not found in system, marking onboarding item as not applicable.", e); } return false; } @Inject  ChangeAdminPasswordOnboardingItem(final SecuritySystem securitySystem); }
ChangeAdminPasswordOnboardingItem extends ComponentSupport implements OnboardingItem { @Override public boolean applies() { try { User user = securitySystem.getUser("admin", UserManagerImpl.DEFAULT_SOURCE); return UserStatus.changepassword.equals(user.getStatus()); } catch (UserNotFoundException e) { log.trace("admin user not found in system, marking onboarding item as not applicable.", e); } catch (NoSuchUserManagerException e) { log.trace("default UserManager not found in system, marking onboarding item as not applicable.", e); } return false; } @Inject  ChangeAdminPasswordOnboardingItem(final SecuritySystem securitySystem); @Override String getType(); @Override int getPriority(); @Override boolean applies(); }
ChangeAdminPasswordOnboardingItem extends ComponentSupport implements OnboardingItem { @Override public boolean applies() { try { User user = securitySystem.getUser("admin", UserManagerImpl.DEFAULT_SOURCE); return UserStatus.changepassword.equals(user.getStatus()); } catch (UserNotFoundException e) { log.trace("admin user not found in system, marking onboarding item as not applicable.", e); } catch (NoSuchUserManagerException e) { log.trace("default UserManager not found in system, marking onboarding item as not applicable.", e); } return false; } @Inject  ChangeAdminPasswordOnboardingItem(final SecuritySystem securitySystem); @Override String getType(); @Override int getPriority(); @Override boolean applies();  }