@Test public void shouldSkipAccountSetupWhenPropertyIsSet() { PropertyManager.setProperty(AccountSetupService.ACCOUNT_SETUP_SKIP_PROPERTY, "true"); AccountSetupService accountSetupService = new AccountSetupService(settingService, organizationService); boolean mustSkip = accountSetupService.mustSkipAccountSetup(); assertTrue(mustSkip); PropertyManager.setProperty(AccountSetupService.ACCOUNT_SETUP_SKIP_PROPERTY, ""); }
public boolean mustSkipAccountSetup() { if (skipSetup == null) { SettingValue accountSetupNode = settingService.get(Context.GLOBAL, Scope.GLOBAL, ACCOUNT_SETUP_NODE); String propertySetupSkip = PropertyManager.getProperty(ACCOUNT_SETUP_SKIP_PROPERTY); if (propertySetupSkip == null) { LOG.debug("Property accountsetup.skip not found in configuration.properties"); propertySetupSkip = "false"; } skipSetup = accountSetupNode != null || propertySetupSkip.equals("true") || PropertyManager.isDevelopping(); } return skipSetup; }
AccountSetupService { public boolean mustSkipAccountSetup() { if (skipSetup == null) { SettingValue accountSetupNode = settingService.get(Context.GLOBAL, Scope.GLOBAL, ACCOUNT_SETUP_NODE); String propertySetupSkip = PropertyManager.getProperty(ACCOUNT_SETUP_SKIP_PROPERTY); if (propertySetupSkip == null) { LOG.debug("Property accountsetup.skip not found in configuration.properties"); propertySetupSkip = "false"; } skipSetup = accountSetupNode != null || propertySetupSkip.equals("true") || PropertyManager.isDevelopping(); } return skipSetup; } }
AccountSetupService { public boolean mustSkipAccountSetup() { if (skipSetup == null) { SettingValue accountSetupNode = settingService.get(Context.GLOBAL, Scope.GLOBAL, ACCOUNT_SETUP_NODE); String propertySetupSkip = PropertyManager.getProperty(ACCOUNT_SETUP_SKIP_PROPERTY); if (propertySetupSkip == null) { LOG.debug("Property accountsetup.skip not found in configuration.properties"); propertySetupSkip = "false"; } skipSetup = accountSetupNode != null || propertySetupSkip.equals("true") || PropertyManager.isDevelopping(); } return skipSetup; } AccountSetupService(SettingService settingService, OrganizationService organizationService); }
AccountSetupService { public boolean mustSkipAccountSetup() { if (skipSetup == null) { SettingValue accountSetupNode = settingService.get(Context.GLOBAL, Scope.GLOBAL, ACCOUNT_SETUP_NODE); String propertySetupSkip = PropertyManager.getProperty(ACCOUNT_SETUP_SKIP_PROPERTY); if (propertySetupSkip == null) { LOG.debug("Property accountsetup.skip not found in configuration.properties"); propertySetupSkip = "false"; } skipSetup = accountSetupNode != null || propertySetupSkip.equals("true") || PropertyManager.isDevelopping(); } return skipSetup; } AccountSetupService(SettingService settingService, OrganizationService organizationService); void setSkipSetup(boolean skipSetup); boolean mustSkipAccountSetup(); void createAccount(String userNameAccount,
                            String firstNameAccount,
                            String lastNameAccount,
                            String emailAccount,
                            String userPasswordAccount,
                            String adminPassword); }
AccountSetupService { public boolean mustSkipAccountSetup() { if (skipSetup == null) { SettingValue accountSetupNode = settingService.get(Context.GLOBAL, Scope.GLOBAL, ACCOUNT_SETUP_NODE); String propertySetupSkip = PropertyManager.getProperty(ACCOUNT_SETUP_SKIP_PROPERTY); if (propertySetupSkip == null) { LOG.debug("Property accountsetup.skip not found in configuration.properties"); propertySetupSkip = "false"; } skipSetup = accountSetupNode != null || propertySetupSkip.equals("true") || PropertyManager.isDevelopping(); } return skipSetup; } AccountSetupService(SettingService settingService, OrganizationService organizationService); void setSkipSetup(boolean skipSetup); boolean mustSkipAccountSetup(); void createAccount(String userNameAccount,
                            String firstNameAccount,
                            String lastNameAccount,
                            String emailAccount,
                            String userPasswordAccount,
                            String adminPassword); final static String ACCOUNT_SETUP_NODE; final static String ACCOUNT_SETUP_SKIP_PROPERTY; }