Skip to content

Commit

Permalink
Added comments for time test cases
Browse files Browse the repository at this point in the history
Signed-off-by: Luke Sieben <siebenluke@gmail.com>
  • Loading branch information
siebenluke committed Jan 11, 2024
1 parent d38e033 commit e6237bb
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions sdk/src/test/java/io/dapr/client/CloudEventTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,17 @@ public void equalsCodecovTest() {
assertNotEquals(cloudEventCopy, cloudEventDifferent);

OffsetDateTime now = OffsetDateTime.now();
cloudEvent.setTime(now);
cloudEventDifferent = new CloudEvent<>();
// cloudEvent null time, cloudEventDifferent now time
cloudEventDifferent.setTime(now);
assertNotEquals(cloudEventCopy, cloudEventDifferent);
// cloudEvent now time, cloudEventDifferent now time
cloudEvent.setTime(now);
assertEquals(cloudEventCopy, cloudEventDifferent);
// cloudEvent now time, cloudEventDifferent now time + 1 nano
cloudEventDifferent.setTime(now.plusNanos(1L));
assertNotEquals(cloudEventCopy, cloudEventDifferent);
cloudEventDifferent.setTime(now);
assertEquals(cloudEventCopy, cloudEventDifferent);
// reset cloudEvent time
cloudEvent.setTime(null);

cloudEventDifferent = new CloudEvent<>();
Expand Down

0 comments on commit e6237bb

Please sign in to comment.