diff --git a/initializr-generator/src/main/java/io/spring/initializr/generator/container/docker/compose/ComposeService.java b/initializr-generator/src/main/java/io/spring/initializr/generator/container/docker/compose/ComposeService.java index 6616bbb5c0..773a2a2915 100644 --- a/initializr-generator/src/main/java/io/spring/initializr/generator/container/docker/compose/ComposeService.java +++ b/initializr-generator/src/main/java/io/spring/initializr/generator/container/docker/compose/ComposeService.java @@ -167,7 +167,7 @@ public Builder label(String key, String value) { return this; } - public Builder label(Map label) { + public Builder labels(Map label) { this.labels.putAll(label); return this; } diff --git a/initializr-generator/src/test/java/io/spring/initializr/generator/container/docker/compose/ComposeServiceContainerTests.java b/initializr-generator/src/test/java/io/spring/initializr/generator/container/docker/compose/ComposeServiceContainerTests.java index 15e9424316..92f585bb96 100644 --- a/initializr-generator/src/test/java/io/spring/initializr/generator/container/docker/compose/ComposeServiceContainerTests.java +++ b/initializr-generator/src/test/java/io/spring/initializr/generator/container/docker/compose/ComposeServiceContainerTests.java @@ -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")));