Skip to content

Instantly share code, notes, and snippets.

@yogonza524
Created April 23, 2020 16:22
Show Gist options
  • Save yogonza524/d5c6ed82596ae6e3e4548f209db35a30 to your computer and use it in GitHub Desktop.
Save yogonza524/d5c6ed82596ae6e3e4548f209db35a30 to your computer and use it in GitHub Desktop.
package testcontainer.sample;
import org.junit.jupiter.api.Test;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import static org.junit.jupiter.api.Assertions.*;
@Testcontainers
class LibraryTest {
@Container
private GenericContainer helloWorld = new GenericContainer<>("hello-world");
@Test void testSomeLibraryMethod() {
assertTrue(helloWorld.getLogs().contains("Hello from Docker!"));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment