Skip to content

Commit

Permalink
Polish "Add support for labels in ComposeService"
Browse files Browse the repository at this point in the history
  • Loading branch information
mhalbritter committed Feb 29, 2024
1 parent c1cc470 commit 0218a97
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ public Builder label(String key, String value) {
return this;
}

public Builder label(Map<String, String> label) {
public Builder labels(Map<String, String> label) {
this.labels.putAll(label);
return this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,8 @@ void labelKeysAreSorted() {
@Test
void labelIsMerged() {
ComposeServiceContainer container = new ComposeServiceContainer();
container.add("test", (service) -> service.imageAndTag("my-image").label(Map.of("a", "aa", "z", "zz")));
container.add("test", (service) -> service.label(Map.of("a", "aaa", "b", "bb")));
container.add("test", (service) -> service.imageAndTag("my-image").labels(Map.of("a", "aa", "z", "zz")));
container.add("test", (service) -> service.labels(Map.of("a", "aaa", "b", "bb")));
assertThat(container.values()).singleElement()
.satisfies((service) -> assertThat(service.getLabels()).containsExactly(entry("a", "aaa"), entry("b", "bb"),
entry("z", "zz")));
Expand Down

0 comments on commit 0218a97

Please sign in to comment.