Created
November 21, 2024 23:31
-
-
Save vladdedita/37426ed8be76e55c3e54e32e42ec2252 to your computer and use it in GitHub Desktop.
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
@ExtendWith({ | |
PostgreSQLExtension.class, | |
ReportingExtension.class | |
}) | |
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, properties = { | |
// We need to enable lazy initialization to avoid the EntityManager creation during the context loading | |
"spring.main.lazy-initialization=true" | |
}) | |
class CleanTimingTest { | |
@Autowired | |
EntityManager entityManager; | |
@Test | |
void test() { | |
// Query data | |
var result = entityManager.createNativeQuery("SELECT COUNT(*) FROM public.user").getSingleResult(); | |
assertThat(result).isEqualTo(2L); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment