Tuesday, 7 July 2020

Configuring Integration Tests

@ContextConfiguration

It is a class-level annotation, used to determine how to load and configure an AppplicationContext. Actually, it creates a customed application context for this specific integration test. It loads @Configuration and @Component for a specific integration test. 

@ActiveProfiles

It is a class-level annotation that is used to declare which bean definition profiles should be activated when loading an ApplicationContext for an integration test. 
Activating a @Profile for this integration test. 

@TestPropertySource

It is a class-level annotation, used to configure the location of properties files for an ApplicationContext loaded for an integration test.  

Loading a specific property file for this integration test.


@Sql 
It is used to annotate a test class or a test method to configure SQL scripts to run against a given database during integration tests. 

By default, the SQL script is carried before the test method; but it can be configured by @Sql parameter. 




No comments:

Can Jackson Deserialize Java Time ZonedDateTime

Yes, but must include JSR310. Thus ZonedDateTime can be deserialized directly from JSON response to POJO field. <dependency> <g...