@Test public void findEngineConfigurationByName() { List<CheckmarxEngineConfiguration> engineConfigurations = new LinkedList<>(); CheckmarxEngineConfiguration defaultConfiguration = new CheckmarxEngineConfiguration(); defaultConfiguration.setId(1L); defaultConfiguration.setName("Default Configuration"); CheckmarxEngineConfiguration testConfiguration = new CheckmarxEngineConfiguration(); testConfiguration.setId(3L); testConfiguration.setName("test"); CheckmarxEngineConfiguration multiLanguageScanConfiguration = new CheckmarxEngineConfiguration(); multiLanguageScanConfiguration.setId(5L); multiLanguageScanConfiguration.setName(CheckmarxConstants.DEFAULT_CHECKMARX_ENGINECONFIGURATION_MULTILANGANGE_SCAN_NAME); engineConfigurations.add(testConfiguration); engineConfigurations.add(defaultConfiguration); engineConfigurations.add(multiLanguageScanConfiguration); CheckmarxEngineConfiguration actualEngineConfiguration = supportToTest.findEngineConfigurationByName(CheckmarxConstants.DEFAULT_CHECKMARX_ENGINECONFIGURATION_MULTILANGANGE_SCAN_NAME, engineConfigurations); assertThat(actualEngineConfiguration, notNullValue()); assertThat(actualEngineConfiguration, is(multiLanguageScanConfiguration)); }
protected CheckmarxEngineConfiguration findEngineConfigurationByName(String name, List<CheckmarxEngineConfiguration> engineConfigurations) { return engineConfigurations.stream().filter(engineConfiguration -> name.equals(engineConfiguration.getName())).findFirst().orElse(null); }
CheckmarxProjectSupport { protected CheckmarxEngineConfiguration findEngineConfigurationByName(String name, List<CheckmarxEngineConfiguration> engineConfigurations) { return engineConfigurations.stream().filter(engineConfiguration -> name.equals(engineConfiguration.getName())).findFirst().orElse(null); } }
CheckmarxProjectSupport { protected CheckmarxEngineConfiguration findEngineConfigurationByName(String name, List<CheckmarxEngineConfiguration> engineConfigurations) { return engineConfigurations.stream().filter(engineConfiguration -> name.equals(engineConfiguration.getName())).findFirst().orElse(null); }  }
CheckmarxProjectSupport { protected CheckmarxEngineConfiguration findEngineConfigurationByName(String name, List<CheckmarxEngineConfiguration> engineConfigurations) { return engineConfigurations.stream().filter(engineConfiguration -> name.equals(engineConfiguration.getName())).findFirst().orElse(null); }  void ensureProjectExists(CheckmarxContext context); }
CheckmarxProjectSupport { protected CheckmarxEngineConfiguration findEngineConfigurationByName(String name, List<CheckmarxEngineConfiguration> engineConfigurations) { return engineConfigurations.stream().filter(engineConfiguration -> name.equals(engineConfiguration.getName())).findFirst().orElse(null); }  void ensureProjectExists(CheckmarxContext context);  }