Skip to content

Commit 516ee2e

Browse files
committed
Prefer isSameAs over isStrictlyEqualTo
1 parent 2d6551e commit 516ee2e

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

jupiter-tests/src/test/java/org/junit/jupiter/api/util/SystemPropertyExtensionTests.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ class priorNestedChangesRestored {
260260
@Test
261261
@DisplayName("Restore from class should restore direct mods")
262262
void restoreShouldHaveRevertedDirectModification() {
263-
assertThat(System.getProperties()).isStrictlyEqualTo(initialState);
263+
assertThat(System.getProperties()).isSameAs(initialState);
264264
}
265265

266266
}
@@ -311,7 +311,7 @@ void clearSetRestoreShouldBeCombinable() {
311311
void restoreShouldHaveRevertedDirectModification() {
312312
assertThat(System.getProperty("Restore")).isNull();
313313
assertThat(System.getProperties().get("XYZ")).isNull();
314-
assertThat(System.getProperties()).isStrictlyEqualTo(initialState);
314+
assertThat(System.getProperties()).isSameAs(initialState);
315315
}
316316

317317
}
@@ -409,7 +409,7 @@ void workflowOfRestorableContexts() {
409409
Properties postPrepareToExitSysProps = System.getProperties();
410410

411411
assertThat(returnedFromPrepareToEnter).withFailMessage(
412-
"prepareToEnterRestorableContext should return actual original or deep copy").isStrictlyEqualTo(
412+
"prepareToEnterRestorableContext should return actual original or deep copy").isSameAs(
413413
initialState);
414414

415415
assertThat(returnedFromPrepareToEnter).withFailMessage(
@@ -418,8 +418,7 @@ void workflowOfRestorableContexts() {
418418

419419
assertThat(postPrepareToEnterSysProps).isEffectivelyEqualsTo(initialState);
420420

421-
// Could assert isSameAs, but a deep copy would also be allowed
422-
assertThat(postPrepareToExitSysProps).isStrictlyEqualTo(initialState);
421+
assertThat(postPrepareToExitSysProps).isSameAs(initialState);
423422

424423
}
425424
finally {
@@ -658,7 +657,7 @@ void shouldInheritClearSetRestore() {
658657
void restoreShouldHaveRevertedDirectModification() {
659658
assertThat(System.getProperty("Restore")).isNull();
660659
assertThat(System.getProperties().get("XYZ")).isNull();
661-
assertThat(System.getProperties()).isStrictlyEqualTo(initialState);
660+
assertThat(System.getProperties()).isSameAs(initialState);
662661
}
663662

664663
@Nested

0 commit comments

Comments
 (0)