@Test public void getScenariosIndexer_returnCypressIndexer_whenTechnologyIsCypress(){ Optional<ScenariosIndexer> scenariosIndexer = scenariosIndexerStrategy.getScenariosIndexer(Technology.CYPRESS); assertThat(scenariosIndexer).isEqualTo(Optional.of(cypressScenariosIndexer)); }
public Optional<ScenariosIndexer> getScenariosIndexer(Technology technology) { if (technology == null) { log.info("The technology can not be null"); return Optional.empty(); } switch (technology) { case CUCUMBER: return Optional.of(cucumberScenariosIndexerService); case POSTMAN: return Optional.of(postmanScenariosIndexerService); case CYPRESS: return Optional.of(cypressScenariosIndexer); default: log.info("The technology {} is not handled yet. It may be a great feature request ;)", technology); return Optional.empty(); } }
ScenariosIndexerStrategy { public Optional<ScenariosIndexer> getScenariosIndexer(Technology technology) { if (technology == null) { log.info("The technology can not be null"); return Optional.empty(); } switch (technology) { case CUCUMBER: return Optional.of(cucumberScenariosIndexerService); case POSTMAN: return Optional.of(postmanScenariosIndexerService); case CYPRESS: return Optional.of(cypressScenariosIndexer); default: log.info("The technology {} is not handled yet. It may be a great feature request ;)", technology); return Optional.empty(); } } }
ScenariosIndexerStrategy { public Optional<ScenariosIndexer> getScenariosIndexer(Technology technology) { if (technology == null) { log.info("The technology can not be null"); return Optional.empty(); } switch (technology) { case CUCUMBER: return Optional.of(cucumberScenariosIndexerService); case POSTMAN: return Optional.of(postmanScenariosIndexerService); case CYPRESS: return Optional.of(cypressScenariosIndexer); default: log.info("The technology {} is not handled yet. It may be a great feature request ;)", technology); return Optional.empty(); } }  }
ScenariosIndexerStrategy { public Optional<ScenariosIndexer> getScenariosIndexer(Technology technology) { if (technology == null) { log.info("The technology can not be null"); return Optional.empty(); } switch (technology) { case CUCUMBER: return Optional.of(cucumberScenariosIndexerService); case POSTMAN: return Optional.of(postmanScenariosIndexerService); case CYPRESS: return Optional.of(cypressScenariosIndexer); default: log.info("The technology {} is not handled yet. It may be a great feature request ;)", technology); return Optional.empty(); } }  Optional<ScenariosIndexer> getScenariosIndexer(Technology technology); }
ScenariosIndexerStrategy { public Optional<ScenariosIndexer> getScenariosIndexer(Technology technology) { if (technology == null) { log.info("The technology can not be null"); return Optional.empty(); } switch (technology) { case CUCUMBER: return Optional.of(cucumberScenariosIndexerService); case POSTMAN: return Optional.of(postmanScenariosIndexerService); case CYPRESS: return Optional.of(cypressScenariosIndexer); default: log.info("The technology {} is not handled yet. It may be a great feature request ;)", technology); return Optional.empty(); } }  Optional<ScenariosIndexer> getScenariosIndexer(Technology technology);  }