Skip to content

Commit 5f2ea4c

Browse files
brenuartrohanKanojia
authored andcommitted
Fix test case
As mentionned in the PR comments, it seems that these two tests were initially wrong. They should treat `docker.cacheFrom` as a list instead…
1 parent c30548d commit 5f2ea4c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/test/java/io/fabric8/maven/docker/config/handler/property/PropertyConfigHandlerTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ public void testNoCacheEnabled() throws Exception {
782782

783783
@Test
784784
public void testCacheFrom() {
785-
String[] testData = new String[] {k(ConfigKey.NAME), "image", k(ConfigKey.CACHE_FROM), "foo/bar:latest", k(ConfigKey.FROM), "base"};
785+
String[] testData = new String[] {k(ConfigKey.NAME), "image", k(ConfigKey.CACHE_FROM)+".1", "foo/bar:latest", k(ConfigKey.FROM), "base"};
786786

787787
ImageConfiguration config = resolveExternalImageConfig(testData);
788788
assertEquals(Collections.singletonList("foo/bar:latest"), config.getBuildConfiguration().getCacheFrom());
@@ -801,7 +801,7 @@ public void testCacheFromIsNullInBuildConfig() {
801801
"docker.from", "busybox"
802802
));
803803

804-
assertNull(configs.get(0).getBuildConfiguration().getCacheFrom().get(0));
804+
assertNull(configs.get(0).getBuildConfiguration().getCacheFrom());
805805
}
806806

807807
@Test
@@ -1014,7 +1014,7 @@ private List<ImageConfiguration> resolveImage(ImageConfiguration image, final Pr
10141014

10151015
private ImageConfiguration resolveExternalImageConfig(String[] testData) {
10161016
Map<String, String> external = new HashMap<>();
1017-
external.put("type", "props");
1017+
external.put("type", "properties");
10181018

10191019
ImageConfiguration config = new ImageConfiguration.Builder().name("image").alias("alias").externalConfig(external).build();
10201020

0 commit comments

Comments
 (0)