Skip to content

Commit

Permalink
Restore correct configuration for UTCTest (hibernate#1251)
Browse files Browse the repository at this point in the history
  • Loading branch information
DavideD authored Mar 22, 2022
1 parent d27db22 commit cda2cfe
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import javax.persistence.GeneratedValue;
import javax.persistence.Id;

import org.hibernate.cfg.AvailableSettings;
import org.hibernate.cfg.Configuration;

import org.junit.Test;

Expand All @@ -39,6 +41,13 @@ protected Collection<Class<?>> annotatedEntities() {
return List.of( Thing.class );
}

@Override
protected Configuration constructConfiguration() {
final Configuration configuration = super.constructConfiguration();
configuration.setProperty( AvailableSettings.JDBC_TIME_ZONE, "UTC" );
return configuration;
}

@Test
public void testDate(TestContext context) {
thing.date = Calendar.getInstance( TimeZone.getTimeZone( "UTC" ) )
Expand Down

0 comments on commit cda2cfe

Please sign in to comment.