From 4ff6ff6bb33e05257dda30c102b1632ab3f23271 Mon Sep 17 00:00:00 2001 From: Shivam <96533413+ShivamChavan01@users.noreply.github.com> Date: Wed, 7 Aug 2024 19:04:32 +0530 Subject: [PATCH] fix: replace AssertJ's deprecated asList() DSL method in WebAppGeneratorTest (3302) Issue #3286: Replace deprecated asList() in Web App Generator Test --- Removed the unused Imports --- Used Only Imports which are required --- .../jkube/generator/webapp/WebAppGeneratorTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/jkube-kit/generator/webapp/src/test/java/org/eclipse/jkube/generator/webapp/WebAppGeneratorTest.java b/jkube-kit/generator/webapp/src/test/java/org/eclipse/jkube/generator/webapp/WebAppGeneratorTest.java index 508439c9bb..797c363247 100644 --- a/jkube-kit/generator/webapp/src/test/java/org/eclipse/jkube/generator/webapp/WebAppGeneratorTest.java +++ b/jkube-kit/generator/webapp/src/test/java/org/eclipse/jkube/generator/webapp/WebAppGeneratorTest.java @@ -23,9 +23,12 @@ import java.util.List; import java.util.Map; import java.util.Properties; + +import org.assertj.core.api.InstanceOfAssertFactories; import org.eclipse.jkube.generator.api.GeneratorContext; -import org.eclipse.jkube.kit.common.JavaProject; import org.eclipse.jkube.kit.common.KitLogger; +import org.eclipse.jkube.kit.common.AssemblyFile; +import org.eclipse.jkube.kit.common.JavaProject; import org.eclipse.jkube.kit.common.Plugin; import org.eclipse.jkube.kit.config.image.ImageConfiguration; import org.eclipse.jkube.kit.config.image.build.BuildConfiguration; @@ -126,7 +129,7 @@ void withDefaultHandler_shouldAddImageConfiguration() throws IOException { }}) .extracting(BuildConfiguration::getAssembly) .hasFieldOrPropertyWithValue("excludeFinalOutputArtifact", true) - .extracting("inline.files").asList().extracting("destName") + .extracting("inline.files").asInstanceOf(InstanceOfAssertFactories.list(AssemblyFile.class)).extracting("destName") .containsExactly("ROOT.war"); } @@ -172,7 +175,7 @@ void withOverriddenProperties_shouldAddImageConfiguration() throws IOException { .extracting(BuildConfiguration::getAssembly) .hasFieldOrPropertyWithValue("excludeFinalOutputArtifact", true) .hasFieldOrPropertyWithValue("user", "root") - .extracting("inline.files").asList().extracting("destName") + .extracting("inline.files").asInstanceOf(InstanceOfAssertFactories.list(AssemblyFile.class)).extracting("destName") .containsExactly("some-context.war"); }