-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1c95019
commit 18d9b46
Showing
4 changed files
with
40 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 2 additions & 15 deletions
17
boot-grafana-lgtm/src/test/java/com/learning/grafanalgtm/TestGrafanaLGTMApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,13 @@ | ||
package com.learning.grafanalgtm; | ||
|
||
import java.time.Duration; | ||
import com.learning.grafanalgtm.common.ContainerConfig; | ||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.test.context.TestConfiguration; | ||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection; | ||
import org.springframework.context.annotation.Bean; | ||
import org.testcontainers.grafana.LgtmStackContainer; | ||
import org.testcontainers.utility.DockerImageName; | ||
|
||
@TestConfiguration(proxyBeanMethods = false) | ||
public class TestGrafanaLGTMApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.from(GrafanaLGTMApplication::main) | ||
.with(TestGrafanaLGTMApplication.class) | ||
.with(ContainerConfig.class) | ||
.run(args); | ||
} | ||
|
||
@Bean | ||
@ServiceConnection | ||
LgtmStackContainer lgtmContainer() { | ||
return new LgtmStackContainer(DockerImageName.parse("grafana/otel-lgtm:0.7.8")) | ||
.withStartupTimeout(Duration.ofMinutes(2)); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
boot-grafana-lgtm/src/test/java/com/learning/grafanalgtm/common/ContainerConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.learning.grafanalgtm.common; | ||
|
||
import java.time.Duration; | ||
import org.springframework.boot.test.context.TestConfiguration; | ||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection; | ||
import org.springframework.context.annotation.Bean; | ||
import org.testcontainers.grafana.LgtmStackContainer; | ||
import org.testcontainers.utility.DockerImageName; | ||
|
||
@TestConfiguration(proxyBeanMethods = false) | ||
public class ContainerConfig { | ||
|
||
@Bean | ||
@ServiceConnection | ||
LgtmStackContainer lgtmContainer() { | ||
return new LgtmStackContainer(DockerImageName.parse("grafana/otel-lgtm:0.8.1")) | ||
.withStartupTimeout(Duration.ofMinutes(2)); | ||
} | ||
} |