Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/issue#2530' into issue#2530
Browse files Browse the repository at this point in the history
  • Loading branch information
sankritimishra committed Feb 1, 2024
2 parents 3196c08 + 35eb79e commit 87a4e77
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
import java.util.Collections;
import java.util.Map;
import org.eclipse.jkube.kit.common.Configs;
import org.eclipse.jkube.kit.common.JavaProject;
import org.eclipse.jkube.kit.config.resource.ProcessorConfig;
import org.junit.jupiter.api.Test;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Answers.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

/**
* @author roland
Expand All @@ -32,14 +30,19 @@ class EnricherConfigTest {
private enum Config implements Configs.Config {
TYPE
}

@SuppressWarnings("ResultOfMethodCallIgnored")
@Test
void simple() {
EnricherContext context = mock(EnricherContext.class,RETURNS_DEEP_STUBS);

Map<String, Map<String, Object>> configMap = Collections.singletonMap("default.service",
Collections.singletonMap("TYPE", "LoadBalancer"));
when(context.getConfiguration().getProcessorConfig()).thenReturn(new ProcessorConfig(null, null, configMap));
EnricherContext context = JKubeEnricherContext.builder()
.project(JavaProject.builder()
.groupId("org.eclipse.jkube")
.artifactId("test-project")
.version("0.0.1")
.build())
.processorConfig(new ProcessorConfig(null, null, configMap))
.build();
EnricherConfig config = new EnricherConfig("default.service", context);
assertThat(config.get(EnricherConfigTest.Config.TYPE)).isEqualTo("LoadBalancer");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,6 @@
import java.util.List;

import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.RETURNS_DEEP_STUBS;
import static org.mockito.Mockito.mock;

class PodTemplateHandlerTest {

Expand Down Expand Up @@ -68,8 +66,8 @@ void setUp() {
.registry("docker.io").build();

images.add(imageConfiguration);
probeHandler = mock(ProbeHandler.class, RETURNS_DEEP_STUBS);
project = mock(JavaProject.class, RETURNS_DEEP_STUBS);
probeHandler = new ProbeHandler();
project = JavaProject.builder().build();
ContainerHandler containerHandler = getContainerHandler();
podTemplateHandler = new PodTemplateHandler(containerHandler);
}
Expand Down

0 comments on commit 87a4e77

Please sign in to comment.