From 197cfef421a21cd5663b117470dfc82d9844ed4d Mon Sep 17 00:00:00 2001 From: Adarsha Yemparala Date: Mon, 18 Nov 2024 13:42:30 -0800 Subject: [PATCH 1/3] Removed unused import from KubernetesHelmLintTask.java --- .../eclipse/jkube/gradle/plugin/task/KubernetesHelmLintTask.java | 1 - 1 file changed, 1 deletion(-) diff --git a/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmLintTask.java b/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmLintTask.java index d077cc673d..7a3c14295a 100644 --- a/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmLintTask.java +++ b/gradle-plugin/kubernetes/src/main/java/org/eclipse/jkube/gradle/plugin/task/KubernetesHelmLintTask.java @@ -14,7 +14,6 @@ package org.eclipse.jkube.gradle.plugin.task; import org.eclipse.jkube.gradle.plugin.KubernetesExtension; -import org.eclipse.jkube.kit.resource.helm.HelmConfig; import javax.inject.Inject; From 58b0c29e2259b02fb0ffcfbdf3f645813f67ec30 Mon Sep 17 00:00:00 2001 From: Adarsha Yemparala Date: Tue, 19 Nov 2024 13:16:35 -0800 Subject: [PATCH 2/3] Replaced Mockito objects with actual project and context objects --- .../generator/VertxGeneratorIsApplicableTest.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/jkube-kit/jkube-kit-vertx/src/test/java/org/eclipse/jkube/vertx/generator/VertxGeneratorIsApplicableTest.java b/jkube-kit/jkube-kit-vertx/src/test/java/org/eclipse/jkube/vertx/generator/VertxGeneratorIsApplicableTest.java index b4a575de21..f617bfdffc 100644 --- a/jkube-kit/jkube-kit-vertx/src/test/java/org/eclipse/jkube/vertx/generator/VertxGeneratorIsApplicableTest.java +++ b/jkube-kit/jkube-kit-vertx/src/test/java/org/eclipse/jkube/vertx/generator/VertxGeneratorIsApplicableTest.java @@ -29,8 +29,8 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.params.provider.Arguments.arguments; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; +//import static org.mockito.Mockito.mock; +//import static org.mockito.Mockito.when; class VertxGeneratorIsApplicableTest { private JavaProject project; @@ -38,9 +38,8 @@ class VertxGeneratorIsApplicableTest { @BeforeEach void setUp() { - project = mock(JavaProject.class, Mockito.RETURNS_DEEP_STUBS); - context = mock(GeneratorContext.class, Mockito.RETURNS_DEEP_STUBS); - when(context.getProject()).thenReturn(project); + project = JavaProject.builder().build(); + context = GeneratorContext.builder().project(project).build(); } static Stream data() { @@ -56,8 +55,9 @@ static Stream data() { @MethodSource("data") void isApplicable(String testDescription, List pluginList, List dependencyList, boolean expectedValue) { // Given - when(project.getPlugins()).thenReturn(pluginList); - when(project.getDependencies()).thenReturn(dependencyList); + context = context.toBuilder() + .project(project.toBuilder().plugins(pluginList).dependencies(dependencyList).build()) + .build(); // When final boolean result = new VertxGenerator(context).isApplicable(Collections.emptyList()); // Then From ea08e5bb78b994d7b15d0293090e6f8424b911ee Mon Sep 17 00:00:00 2001 From: Adarsha Yemparala Date: Tue, 19 Nov 2024 13:26:27 -0800 Subject: [PATCH 3/3] Replaced Mockito objects with actual project and context objects, commented imports --- .../jkube/vertx/generator/VertxGeneratorIsApplicableTest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jkube-kit/jkube-kit-vertx/src/test/java/org/eclipse/jkube/vertx/generator/VertxGeneratorIsApplicableTest.java b/jkube-kit/jkube-kit-vertx/src/test/java/org/eclipse/jkube/vertx/generator/VertxGeneratorIsApplicableTest.java index f617bfdffc..baa8ba5736 100644 --- a/jkube-kit/jkube-kit-vertx/src/test/java/org/eclipse/jkube/vertx/generator/VertxGeneratorIsApplicableTest.java +++ b/jkube-kit/jkube-kit-vertx/src/test/java/org/eclipse/jkube/vertx/generator/VertxGeneratorIsApplicableTest.java @@ -30,7 +30,7 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.junit.jupiter.params.provider.Arguments.arguments; //import static org.mockito.Mockito.mock; -//import static org.mockito.Mockito.when; +import static org.mockito.Mockito.when; class VertxGeneratorIsApplicableTest { private JavaProject project; @@ -40,6 +40,7 @@ class VertxGeneratorIsApplicableTest { void setUp() { project = JavaProject.builder().build(); context = GeneratorContext.builder().project(project).build(); + when(context.getProject()).thenReturn(project); } static Stream data() {