@Test(dataProvider = "profileNames") public void testGetConfiguredProfiles(boolean database, boolean gearman, String[] expectedStrings) throws Exception { MockitoAnnotations.initMocks(this); when(forwarderProperties.isDatabaseEnabled()).thenReturn(database); when(forwarderProperties.isGearmanEnabled()).thenReturn(gearman); assertEquals(expectedStrings, testling.getConfiguredProfiles()); }
protected String[] getConfiguredProfiles() { List<String> profileNames = new ArrayList<>(); if (forwarderProperties.isDatabaseEnabled()) { profileNames.add(JDBC_DB); } if (forwarderProperties.isGearmanEnabled()) { profileNames.add(GEARMAN); } if (forwarderProperties.isIcinga2Enabled()) { profileNames.add(INCINGA2); } if (forwarderProperties.isCheckMKEnabled()) { profileNames.add(CHECK_MK); } if (forwarderProperties.isJsonEnabled()) { profileNames.add(JSON); } if (cipherProperties.isEncryptionModeEnv()) { profileNames.add(CIPHER_ENV); } else if (cipherProperties.isEncryptionModeInterface()) { profileNames.add(CIPHER_INTERFACE); } return profileNames.toArray(new String[profileNames.size()]); }
SpringProfilesInitializer implements InitializingBean, ApplicationContextAware { protected String[] getConfiguredProfiles() { List<String> profileNames = new ArrayList<>(); if (forwarderProperties.isDatabaseEnabled()) { profileNames.add(JDBC_DB); } if (forwarderProperties.isGearmanEnabled()) { profileNames.add(GEARMAN); } if (forwarderProperties.isIcinga2Enabled()) { profileNames.add(INCINGA2); } if (forwarderProperties.isCheckMKEnabled()) { profileNames.add(CHECK_MK); } if (forwarderProperties.isJsonEnabled()) { profileNames.add(JSON); } if (cipherProperties.isEncryptionModeEnv()) { profileNames.add(CIPHER_ENV); } else if (cipherProperties.isEncryptionModeInterface()) { profileNames.add(CIPHER_INTERFACE); } return profileNames.toArray(new String[profileNames.size()]); } }
SpringProfilesInitializer implements InitializingBean, ApplicationContextAware { protected String[] getConfiguredProfiles() { List<String> profileNames = new ArrayList<>(); if (forwarderProperties.isDatabaseEnabled()) { profileNames.add(JDBC_DB); } if (forwarderProperties.isGearmanEnabled()) { profileNames.add(GEARMAN); } if (forwarderProperties.isIcinga2Enabled()) { profileNames.add(INCINGA2); } if (forwarderProperties.isCheckMKEnabled()) { profileNames.add(CHECK_MK); } if (forwarderProperties.isJsonEnabled()) { profileNames.add(JSON); } if (cipherProperties.isEncryptionModeEnv()) { profileNames.add(CIPHER_ENV); } else if (cipherProperties.isEncryptionModeInterface()) { profileNames.add(CIPHER_INTERFACE); } return profileNames.toArray(new String[profileNames.size()]); }  }
SpringProfilesInitializer implements InitializingBean, ApplicationContextAware { protected String[] getConfiguredProfiles() { List<String> profileNames = new ArrayList<>(); if (forwarderProperties.isDatabaseEnabled()) { profileNames.add(JDBC_DB); } if (forwarderProperties.isGearmanEnabled()) { profileNames.add(GEARMAN); } if (forwarderProperties.isIcinga2Enabled()) { profileNames.add(INCINGA2); } if (forwarderProperties.isCheckMKEnabled()) { profileNames.add(CHECK_MK); } if (forwarderProperties.isJsonEnabled()) { profileNames.add(JSON); } if (cipherProperties.isEncryptionModeEnv()) { profileNames.add(CIPHER_ENV); } else if (cipherProperties.isEncryptionModeInterface()) { profileNames.add(CIPHER_INTERFACE); } return profileNames.toArray(new String[profileNames.size()]); }  void setApplicationContext(ApplicationContext ac); void afterPropertiesSet(); }
SpringProfilesInitializer implements InitializingBean, ApplicationContextAware { protected String[] getConfiguredProfiles() { List<String> profileNames = new ArrayList<>(); if (forwarderProperties.isDatabaseEnabled()) { profileNames.add(JDBC_DB); } if (forwarderProperties.isGearmanEnabled()) { profileNames.add(GEARMAN); } if (forwarderProperties.isIcinga2Enabled()) { profileNames.add(INCINGA2); } if (forwarderProperties.isCheckMKEnabled()) { profileNames.add(CHECK_MK); } if (forwarderProperties.isJsonEnabled()) { profileNames.add(JSON); } if (cipherProperties.isEncryptionModeEnv()) { profileNames.add(CIPHER_ENV); } else if (cipherProperties.isEncryptionModeInterface()) { profileNames.add(CIPHER_INTERFACE); } return profileNames.toArray(new String[profileNames.size()]); }  void setApplicationContext(ApplicationContext ac); void afterPropertiesSet(); static final String JDBC_DB; static final String GEARMAN; static final String INCINGA2; static final String CHECK_MK; static final String JSON; static final String CIPHER_INTERFACE; static final String CIPHER_ENV; }