Skip to content

Instantly share code, notes, and snippets.

@doppleware
Last active October 4, 2023 09:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doppleware/f478364fe1c79e3dda40501cd025f934 to your computer and use it in GitHub Desktop.
Save doppleware/f478364fe1c79e3dda40501cd025f934 to your computer and use it in GitHub Desktop.
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@Testcontainers
@ActiveProfiles(value = "postgres")
public class OwnerControllerTests {
@LocalServerPort
private Integer port;
@Container
@ServiceConnection
static PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>("postgres:15-alpine");
@BeforeEach
void setUp() {
//ownerRepository.deleteAll();
RestAssured.baseURI = "http://localhost:" + port;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment