Created
August 26, 2022 21:20
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
@Testcontainers | |
@SpringBootTest | |
@ActiveProfiles("dev") | |
class DevProfileDemoApplicationTest { | |
@Container | |
static MongoDBContainer mongoDBContainer = new MongoDBContainer("mongo:4.4.2"); | |
@DynamicPropertySource | |
static void setProperties(DynamicPropertyRegistry registry) { | |
registry.add("spring.data.mongodb.uri", mongoDBContainer::getReplicaSetUrl); | |
} | |
@Autowired | |
private HaloService haloService; | |
@Test | |
void shouldExecuteOperationOnMongo() { | |
HaloEntity haloEntity = haloService.addHalo("some name"); | |
assertNotNull(haloService.getHalo(haloEntity.getId())); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment