File tree Expand file tree Collapse file tree 1 file changed +23
-1
lines changed
spring-modulith-events/spring-modulith-events-mongodb/src/test/java/org/springframework/modulith/testapp Expand file tree Collapse file tree 1 file changed +23
-1
lines changed Original file line number Diff line number Diff line change 1515 */
1616package org .springframework .modulith .testapp ;
1717
18+ import org .bson .UuidRepresentation ;
1819import org .springframework .boot .test .context .TestConfiguration ;
1920import org .springframework .boot .testcontainers .service .connection .ServiceConnection ;
2021import org .springframework .context .annotation .Bean ;
22+ import org .springframework .data .mongodb .config .AbstractMongoClientConfiguration ;
2123import org .testcontainers .containers .MongoDBContainer ;
2224import org .testcontainers .utility .DockerImageName ;
2325
26+ import com .mongodb .MongoClientSettings .Builder ;
27+
2428@ TestConfiguration (proxyBeanMethods = false )
25- public class Infrastructure {
29+ public class Infrastructure extends AbstractMongoClientConfiguration {
2630
2731 @ Bean
2832 @ ServiceConnection
2933 MongoDBContainer mongoDBContainer () {
3034 return new MongoDBContainer (DockerImageName .parse ("mongo:latest" ));
3135 }
36+
37+ /*
38+ * (non-Javadoc)
39+ * @see org.springframework.data.mongodb.config.MongoConfigurationSupport#getDatabaseName()
40+ */
41+ @ Override
42+ protected String getDatabaseName () {
43+ return "test" ;
44+ }
45+
46+ /*
47+ * (non-Javadoc)
48+ * @see org.springframework.data.mongodb.config.MongoConfigurationSupport#configureClientSettings(com.mongodb.MongoClientSettings.Builder)
49+ */
50+ @ Override
51+ protected void configureClientSettings (Builder builder ) {
52+ builder .uuidRepresentation (UuidRepresentation .STANDARD );
53+ }
3254}
You can’t perform that action at this time.
0 commit comments