File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
src/test/java/io/ejangs/docsa/domain/save Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ void updateSave_fails_whenMongoSaveFails_thenMysqlDeleted() throws Exception {
136136
137137 Save after = saveRepository .findById (save .getId ()).orElse (null );
138138 assertThat (after ).isNotNull ();
139- assertThat (after .getUpdatedAt ()).isEqualTo (beforeUpdatedAt );
139+ assertThat (SaveServiceUtil . trimToMillis ( after .getUpdatedAt ())) .isEqualTo (SaveServiceUtil . trimToMillis ( beforeUpdatedAt ) );
140140 }
141141 }
142142
Original file line number Diff line number Diff line change 66import io .ejangs .docsa .domain .save .document .SaveContent ;
77import io .ejangs .docsa .domain .save .entity .Save ;
88import io .ejangs .docsa .domain .user .entity .User ;
9+ import java .time .LocalDateTime ;
10+ import java .time .temporal .ChronoUnit ;
911import java .util .List ;
1012import java .util .Map ;
1113
@@ -57,4 +59,9 @@ public static Commit createCommit(Branch branch) {
5759 .branch (branch )
5860 .build ();
5961 }
62+
63+ public static LocalDateTime trimToMillis (LocalDateTime t ) {
64+ return t .truncatedTo (ChronoUnit .MILLIS );
65+ }
66+
6067}
You can’t perform that action at this time.
0 commit comments