JAVA-20163 Fix failed integration test with date creation comparison (#14080)

Co-authored-by: timis1 <noreplay@yahoo.com>
This commit is contained in:
timis1 2023-05-21 11:56:18 +03:00 committed by GitHub
parent 9fe90d4663
commit e6b0ef1d86
3 changed files with 12 additions and 9 deletions

View File

@ -5,7 +5,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.text.SimpleDateFormat;
import java.time.Instant; import java.time.Instant;
import java.util.Date;
import org.h2.Driver; import org.h2.Driver;
import org.hibernate.Session; import org.hibernate.Session;
@ -81,7 +83,11 @@ class HibernateCreationUpdateTimestampIntegrationTest {
session.getTransaction().commit(); session.getTransaction().commit();
session.close(); session.close();
assertEquals(book.getCreatedOn(), book.getLastUpdatedOn()); Date createdOn = Date.from(book.getCreatedOn());
Date lastUpdatedOn = Date.from(book.getLastUpdatedOn());
SimpleDateFormat formatter = new SimpleDateFormat("dd MM yyyy HH:mm:ss");
assertEquals(formatter.format(createdOn), formatter.format(lastUpdatedOn));
} }
@Test @Test

View File

@ -108,6 +108,11 @@
<module>spring-jooq</module> <module>spring-jooq</module>
<module>spring-mybatis</module> <module>spring-mybatis</module>
<module>spring-persistence-simple</module> <module>spring-persistence-simple</module>
<module>fauna</module>
<module>spring-data-rest</module>
<module>java-mongodb</module>
<module>questdb</module>
</modules> </modules>
<properties> <properties>

View File

@ -795,8 +795,6 @@
<module>spring-swagger-codegen/custom-validations-opeanpi-codegen</module> <module>spring-swagger-codegen/custom-validations-opeanpi-codegen</module>
<module>testing-modules/testing-assertions</module> <module>testing-modules/testing-assertions</module>
<module>testing-modules/mockito-simple</module> <module>testing-modules/mockito-simple</module>
<module>persistence-modules/fauna</module>
<module>persistence-modules/spring-data-rest</module>
<module>rule-engines-modules</module> <module>rule-engines-modules</module>
@ -924,11 +922,9 @@
<module>vertx-modules</module> <module>vertx-modules</module>
<module>xstream</module> <module>xstream</module>
<module>webrtc</module> <module>webrtc</module>
<module>persistence-modules/java-mongodb</module>
<module>messaging-modules</module> <module>messaging-modules</module>
<module>persistence-modules/questdb</module>
<module>vaadin</module> <module>vaadin</module>
<module>libraries-3</module> <module>libraries-3</module>
<module>web-modules</module> <module>web-modules</module>
@ -1058,8 +1054,6 @@
<module>spring-swagger-codegen/custom-validations-opeanpi-codegen</module> <module>spring-swagger-codegen/custom-validations-opeanpi-codegen</module>
<module>testing-modules/testing-assertions</module> <module>testing-modules/testing-assertions</module>
<module>testing-modules/mockito-simple</module> <module>testing-modules/mockito-simple</module>
<module>persistence-modules/fauna</module>
<module>persistence-modules/spring-data-rest</module>
<module>rule-engines-modules</module> <module>rule-engines-modules</module>
@ -1187,11 +1181,9 @@
<module>vertx-modules</module> <module>vertx-modules</module>
<module>xstream</module> <module>xstream</module>
<module>webrtc</module> <module>webrtc</module>
<module>persistence-modules/java-mongodb</module>
<module>messaging-modules</module> <module>messaging-modules</module>
<module>persistence-modules/questdb</module>
<module>vaadin</module> <module>vaadin</module>
<module>libraries-3</module> <module>libraries-3</module>
<module>web-modules</module> <module>web-modules</module>