Skip to content

Commit

Permalink
Fix test setup so that temporal conversions use symmetric timezone se…
Browse files Browse the repository at this point in the history
…tting.

Closes: #4446
  • Loading branch information
sxhinzvc committed Jul 13, 2023
1 parent e5b55c2 commit 6968f4b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2619,7 +2619,7 @@ void readsMapThatDoesNotComeAsDocument() {
void projectShouldReadSimpleInterfaceProjection() {

org.bson.Document source = new org.bson.Document("birthDate",
Date.from(LocalDate.of(1999, 12, 1).atStartOfDay().toInstant(ZoneOffset.UTC))).append("foo", "Walter");
Date.from(LocalDate.of(1999, 12, 1).atStartOfDay(systemDefault()).toInstant())).append("foo", "Walter");

EntityProjectionIntrospector discoverer = EntityProjectionIntrospector.create(converter.getProjectionFactory(),
EntityProjectionIntrospector.ProjectionPredicate.typeHierarchy()
Expand All @@ -2637,7 +2637,7 @@ void projectShouldReadSimpleInterfaceProjection() {
void projectShouldReadSimpleDtoProjection() {

org.bson.Document source = new org.bson.Document("birthDate",
Date.from(LocalDate.of(1999, 12, 1).atStartOfDay().toInstant(ZoneOffset.UTC))).append("foo", "Walter");
Date.from(LocalDate.of(1999, 12, 1).atStartOfDay(systemDefault()).toInstant())).append("foo", "Walter");

EntityProjectionIntrospector introspector = EntityProjectionIntrospector.create(converter.getProjectionFactory(),
EntityProjectionIntrospector.ProjectionPredicate.typeHierarchy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,8 @@ public MongoClient mongoClient() {
protected void configureConverters(MongoConverterConfigurationAdapter converterConfigurationAdapter) {

converterConfigurationAdapter
.registerPropertyValueConverterFactory(PropertyValueConverterFactory.beanFactoryAware(applicationContext));
.registerPropertyValueConverterFactory(PropertyValueConverterFactory.beanFactoryAware(applicationContext))
.useNativeDriverJavaTimeCodecs();
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ protected void configureClientSettings(Builder builder) {
protected void configureConverters(MongoConverterConfigurationAdapter converterConfigurationAdapter) {

converterConfigurationAdapter
.registerPropertyValueConverterFactory(PropertyValueConverterFactory.beanFactoryAware(applicationContext));
.registerPropertyValueConverterFactory(PropertyValueConverterFactory.beanFactoryAware(applicationContext))
.useNativeDriverJavaTimeCodecs();
}

@Bean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ public MongoClient mongoClient() {
protected void configureConverters(MongoConverterConfigurationAdapter converterConfigurationAdapter) {

converterConfigurationAdapter
.registerPropertyValueConverterFactory(PropertyValueConverterFactory.beanFactoryAware(applicationContext));
.registerPropertyValueConverterFactory(PropertyValueConverterFactory.beanFactoryAware(applicationContext))
.useNativeDriverJavaTimeCodecs();
}

@Bean
Expand Down

0 comments on commit 6968f4b

Please sign in to comment.