BaseGenerator implements Generator { protected String getImageName() { if (RuntimeMode.isOpenShiftMode(getProject().getProperties())) { return getConfigWithFallback(Config.name, FABRIC8_GENERATOR_NAME, "%a:%l"); } else { return getConfigWithFallback(Config.name, FABRIC8_GENERATOR_NAME, "%g/%a:%l"); } } BaseGenerator(GeneratorContext context, String name);  BaseGenerator(GeneratorContext context, String name, FromSelector selector); String getName(); GeneratorContext getContext();  }
@Test public void getImageName() { setupNameContext(null, "config_test_name"); BaseGenerator generator = createGenerator(null); assertEquals("config_test_name", generator.getImageName()); setupNameContext("prop_test_name", null); generator = createGenerator(null); assertEquals("prop_test_name", generator.getImageName()); setupNameContext("prop_test_name", "config_test_name"); generator = createGenerator(null); assertEquals("config_test_name", generator.getImageName()); setupNameContext(null, null); generator = createGenerator(null); assertEquals("%g/%a:%l", generator.getImageName()); }