Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ void setUp() {
@Test
void addsDockerComposeSection() throws IOException {
this.dockerComposeFile.services()
.add("test2", (service) -> service.imageAndTag("image-2:4.5.6").imageWebsite("https:/example.com/image-2"));
.add("test2",
(service) -> service.imageAndTag("image-2:4.5.6").imageWebsite("https://example.com/image-2"));
this.dockerComposeFile.services()
.add("test", (service) -> service.imageAndTag("image-1:1.2.3").imageWebsite("https:/example.com/image-1"));
.add("test", (service) -> service.imageAndTag("image-1:1.2.3").imageWebsite("https://example.com/image-1"));
HelpDocument helpDocument = helpDocument();
this.customizer.customize(helpDocument);
assertThat(helpDocument.getSections()).hasSize(1);
Expand All @@ -54,8 +55,8 @@ void addsDockerComposeSection() throws IOException {
This project contains a Docker Compose file named `compose.yaml`.
In this file, the following services have been defined:

* test: [`image-1:1.2.3`](https:/example.com/image-1)
* test2: [`image-2:4.5.6`](https:/example.com/image-2)
* test: [`image-1:1.2.3`](https://example.com/image-1)
* test2: [`image-2:4.5.6`](https://example.com/image-2)

Please review the tags of the used images and set them to the same as you're running in production.""");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ class ComposeProjectContributorTests {
@Test
void composeFileIsContributedInProjectStructure(@TempDir Path projectDir) throws IOException {
ComposeFile compose = new ComposeFile();
compose.services().add("test", (service) -> service.image("my-image:1.2.3"));
compose.services().add("test", (service) -> service.imageAndTag("my-image:1.2.3"));
new ComposeProjectContributor(compose, IndentingWriterFactory.withDefaultSettings()).contribute(projectDir);
Path composeFile = projectDir.resolve("compose.yaml");
assertThat(composeFile).isRegularFile();
assertThat(composeFile).isRegularFile().content().contains("test:", "image: 'my-image:1.2.3'");
}

@Test
Expand Down
Loading