use of org.eclipse.jkube.kit.config.resource.ProcessorConfig in project jkube by eclipse.
the class DefaultServiceEnricherTest method setupExpectations.
private void setupExpectations(final boolean withPorts, String... configParams) {
// Setup mock behaviour
final TreeMap<String, Object> config = new TreeMap<>();
for (int i = 0; i < configParams.length; i += 2) {
config.put(configParams[i], configParams[i + 1]);
}
new Expectations() {
{
Configuration configuration = Configuration.builder().image(imageConfiguration).processorConfig(new ProcessorConfig(null, null, Collections.singletonMap("jkube-service", config))).build();
context.getConfiguration();
result = configuration;
imageConfiguration.getBuildConfiguration();
result = initBuildConfig(withPorts);
}
};
}
use of org.eclipse.jkube.kit.config.resource.ProcessorConfig in project jkube by eclipse.
the class WatcherManagerTest method setUp.
@Before
public void setUp() throws Exception {
// @formatter:off
new Expectations() {
{
jKubeServiceHub.getClusterAccess().isOpenShift();
result = false;
}
};
// @formatter:on
final ProcessorConfig processorConfig = new ProcessorConfig();
processorConfig.setIncludes(Collections.singletonList("fake-watcher"));
watcherContext = WatcherContext.builder().config(processorConfig).jKubeServiceHub(jKubeServiceHub).logger(logger).build();
}
use of org.eclipse.jkube.kit.config.resource.ProcessorConfig in project jkube by eclipse.
the class ProfileUtilTest method blendProfiles.
@Test
public void blendProfiles() throws Exception {
ProcessorConfig origConfig = new ProcessorConfig(Arrays.asList("i1", "i2"), Collections.singleton("spring.swarm"), null);
ProcessorConfig mergeConfig = ProfileUtil.blendProfileWithConfiguration(ProfileUtil.ENRICHER_CONFIG, "simple", getProfileDir(), origConfig);
assertTrue(mergeConfig.use("base"));
assertTrue(mergeConfig.use("i1"));
assertEquals("http://jolokia.org", mergeConfig.getConfig().get("base").get("url"));
mergeConfig = ProfileUtil.blendProfileWithConfiguration(ProfileUtil.GENERATOR_CONFIG, "simple", getProfileDir(), origConfig);
assertTrue(mergeConfig.use("i2"));
assertFalse(mergeConfig.use("spring.swarm"));
}
use of org.eclipse.jkube.kit.config.resource.ProcessorConfig in project jkube by eclipse.
the class ProfileUtilTest method simple.
@Test
public void simple() throws IOException {
InputStream is = getClass().getResourceAsStream("/jkube/config/profiles-lookup-dir/profiles.yaml");
assertNotNull(is);
List<Profile> profiles = ProfileUtil.fromYaml(is);
assertNotNull(profiles);
assertEquals(3, profiles.size());
Profile profile = profiles.get(0);
assertEquals("simple", profile.getName());
ProcessorConfig config = profile.getEnricherConfig();
assertTrue(config.use("base"));
assertFalse(config.use("blub"));
config = profile.getGeneratorConfig();
assertFalse(config.use("java.app"));
assertTrue(config.use("spring.swarm"));
}
use of org.eclipse.jkube.kit.config.resource.ProcessorConfig in project jkube by eclipse.
the class DefaultEnricherManagerTest method setUp.
@Before
public void setUp() throws Exception {
final ProcessorConfig processorConfig = new ProcessorConfig();
processorConfig.setIncludes(Collections.singletonList("fake-enricher"));
final EnricherContext enricherContext = JKubeEnricherContext.builder().project(JavaProject.builder().build()).log(logger).processorConfig(processorConfig).build();
enricherManager = new DefaultEnricherManager(enricherContext);
}
Aggregations