Skip to content

Commit b5ed41d

Browse files
Excavator: Prefer AssertJ
1 parent 91d7cca commit b5ed41d

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

lib/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ dependencies {
55
implementation 'com.palantir.safe-logging:preconditions'
66

77
testImplementation 'org.junit.jupiter:junit-jupiter'
8+
testImplementation 'org.assertj:assertj-core'
89
}

lib/src/test/java/com/palantir/computemodules/ComputeModuleTest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
package com.palantir.computemodules;
1717

18-
import static org.junit.jupiter.api.Assertions.assertEquals;
18+
import static org.assertj.core.api.Assertions.assertThat;
1919

2020
import com.google.common.util.concurrent.ListeningExecutorService;
2121
import com.google.common.util.concurrent.MoreExecutors;
@@ -54,23 +54,23 @@ void test_example_compute_module() {
5454
Integer result3 = testClient.result(job3, Integer.class);
5555
String result1 = testClient.result(job1, String.class);
5656

57-
assertEquals(result1, "hello Compute Module");
58-
assertEquals(result2, 4);
59-
assertEquals(result3, 20);
57+
assertThat("hello Compute Module").isEqualTo(result1);
58+
assertThat(4).isEqualTo(result2);
59+
assertThat(20).isEqualTo(result3);
6060
}
6161

6262
@Test
6363
void test_invalid_function_name() throws IOException {
6464
InputStream result = testClient.execute("doesn't exist", 2);
6565
String error = new String(result.readAllBytes(), StandardCharsets.UTF_8);
66-
assertEquals(error.contains("Requested function not found"), true);
66+
assertThat(true).isEqualTo(error.contains("Requested function not found"));
6767
}
6868

6969
@Test
7070
void test_user_function_that_throws() throws IOException {
7171
InputStream result = testClient.execute("error", 2);
7272
String error = new String(result.readAllBytes(), StandardCharsets.UTF_8);
73-
assertEquals(error.contains("Intentionally throwing: 2"), true);
73+
assertThat(true).isEqualTo(error.contains("Intentionally throwing: 2"));
7474
}
7575

7676
static Integer dub(Context context, Integer input) {

versions.lock

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ com.palantir.safe-logging:logger-slf4j:3.7.0 (1 constraints: 050e6842)
1414
com.palantir.safe-logging:logger-spi:3.7.0 (2 constraints: 191ea27b)
1515
com.palantir.safe-logging:preconditions:3.7.0 (1 constraints: 0c050f36)
1616
com.palantir.safe-logging:safe-logging:3.7.0 (3 constraints: 872e9986)
17-
net.bytebuddy:byte-buddy:1.14.9 (1 constraints: 8f123b21)
17+
net.bytebuddy:byte-buddy:1.15.11 (2 constraints: 0d1e9b95)
1818
org.checkerframework:checker-qual:3.43.0 (1 constraints: 4c0a4abf)
1919
org.jetbrains:annotations:24.1.0 (1 constraints: 331166d1)
2020
org.slf4j:slf4j-api:1.7.36 (1 constraints: 471091b6)
2121

2222
[Test dependencies]
23+
org.assertj:assertj-core:3.27.3 (1 constraints: 4105513b)
2324
org.junit:junit-bom:5.11.2 (7 constraints: c6758106)
2425
org.junit.jupiter:junit-jupiter:5.11.2 (2 constraints: b91096ee)
2526
org.junit.jupiter:junit-jupiter-api:5.11.2 (4 constraints: 333963e3)

versions.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
com.fasterxml.jackson.core:jackson-databind = 2.13.2.1
22
com.google.guava:guava = 33.3.1-jre
3+
org.assertj:assertj-core = 3.27.3
34
org.junit.jupiter:* = 5.11.2
45
org.junit.platform:* = 1.11.2
56
org.slf4j:* = 1.7.36

0 commit comments

Comments
 (0)