Skip to content

Commit

Permalink
Update Docker Compose tests to fix test failure
Browse files Browse the repository at this point in the history
Updating to Jackson 2.7.7 causes tests in the docker compose
plugin to fail. This is due to the fact that the tests expect
empty values in dictionaries to be parsed as the empty string,
whereas jackson 2.7.7 parses them as null (as specified by the
yaml spec).

Modifies the affected tests to explicitly use an empty string
(i.e. "") instead of an empty value.

Signed-off-by: Angel Misevski <amisevsk@redhat.com>
  • Loading branch information
amisevsk authored and sunix committed Jun 29, 2017
1 parent 77329e3 commit fba68ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ public void composeServiceCommandShouldBeParsedSuccessfully(String command,
assertEquals(environment.get("MYSQL_PASSWORD"), "password");
assertTrue(service.getExpose().containsAll(asList("4403", "5502")));

assertEquals(service.getCommand(), commandWords);
assertTrue(service.getCommand().containsAll(commandWords));
assertEquals(service.getCommand().size(), commandNumberOfWords);
}

@DataProvider(name = "validCommand")
Expand Down Expand Up @@ -137,7 +138,7 @@ private Object[][] validCommand() {
{"\"echo ${PWD}\"", asList("echo", "${PWD}"), 2},
{"\"(Test)\"", singletonList("(Test)"), 1},

{"", null, 1},
{"\"\"", singletonList(""), 1},
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public Object[][] correctContentTestData() {
+ " dev-machine: \n"
+ " image: codenvy/ubuntu_jdk8\n"
+ " environment:\n"
+ " MYSQL_ROOT_PASSWORD: ",
ImmutableMap.of("MYSQL_ROOT_PASSWORD", null)
+ " MYSQL_ROOT_PASSWORD: \"\"",
ImmutableMap.of("MYSQL_ROOT_PASSWORD", "")
},

// dictionary format, value of variable contains colon sign
Expand Down

0 comments on commit fba68ea

Please sign in to comment.