| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
package org.junit.jupiter.api; |
| 12 |
|
| 13 |
import static org.junit.jupiter.api.AssertionFailureBuilder.assertionFailure; |
| 14 |
|
| 15 |
import java.util.function.Supplier; |
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
class AssertNotSame { |
| 24 |
|
| 25 |
private AssertNotSame() { |
| 26 |
|
| 27 |
} |
| 28 |
|
| 29 |
static void assertNotSame(Object unexpected, Object actual) { |
| 30 |
assertNotSame(unexpected, actual, (String) null); |
| 31 |
} |
| 32 |
|
| 33 |
static void assertNotSame(Object unexpected, Object actual, String message) { |
| 34 |
if (unexpected == actual) { |
| 35 |
failSame(actual, message); |
| 36 |
} |
| 37 |
} |
| 38 |
|
| 39 |
static void assertNotSame(Object unexpected, Object actual, Supplier<String> messageSupplier) { |
| 40 |
if (unexpected == actual) { |
| 41 |
failSame(actual, messageSupplier); |
| 42 |
} |
| 43 |
} |
| 44 |
|
| 45 |
private static void failSame(Object actual, Object messageOrSupplier) { |
| 46 |
assertionFailure() |
| 47 |
.message(messageOrSupplier) |
| 48 |
.reason("expected: not same but was: <" + actual + ">") |
| 49 |
.buildAndThrow(); |
| 50 |
} |
| 51 |
|
| 52 |
} |