Skip to content

Commit

Permalink
fix: replace AssertJ's deprecated asList() DSL method in WebAppGenera…
Browse files Browse the repository at this point in the history
…torTest (3302)

Issue eclipse-jkube#3286: Replace deprecated asList() in Web App Generator Test
---
Removed the unused Imports
---
Used Only Imports which are required
  • Loading branch information
ShivamChavan01 authored Aug 7, 2024
1 parent 4618b45 commit 4ff6ff6
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}

Expand Down Expand Up @@ -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");
}

Expand Down

0 comments on commit 4ff6ff6

Please sign in to comment.