Skip to content

Commit 7788ffe

Browse files
committed
Upgrade Fest Assert to AssertJ.
Also re-ordered one `overridingErrorMessage` to be applied before the assert evaluation. Same fixes as for java-json-tools/json-schema-core/issues/66.
1 parent 3c67cf9 commit 7788ffe

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ dependencies {
7373
exclude(group: "org.yaml", module: "snakeyaml");
7474
};
7575
testCompile(group: "org.mockito", name: "mockito-core", version: "2.4.2");
76-
testCompile(group: "org.easytesting", name: "fest-assert", version: "1.4");
76+
// FIXME: update to 3.x once we're off of Java 7.
77+
testCompile(group: "org.assertj", name: "assertj-core", version: "2.9.1");
7778
}
7879

7980
javadoc {

src/test/java/com/github/fge/jsonschema/matchers/ProcessingMessageAssert.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
package com.github.fge.jsonschema.matchers;
2121

22+
import org.assertj.core.api.AbstractAssert;
2223
import com.fasterxml.jackson.databind.JsonNode;
2324
import com.fasterxml.jackson.databind.node.ArrayNode;
2425
import com.fasterxml.jackson.databind.node.ObjectNode;
@@ -27,16 +28,15 @@
2728
import com.github.fge.jsonschema.core.report.ProcessingMessage;
2829
import com.github.fge.jsonschema.core.tree.SchemaTree;
2930
import com.github.fge.jsonschema.core.util.AsJson;
30-
import org.fest.assertions.GenericAssert;
3131

3232
import java.util.Collection;
3333
import java.util.Map;
3434

35-
import static org.fest.assertions.Assertions.*;
35+
import static org.assertj.core.api.Assertions.*;
3636
import static org.testng.Assert.*;
3737

3838
public final class ProcessingMessageAssert
39-
extends GenericAssert<ProcessingMessageAssert, ProcessingMessage>
39+
extends AbstractAssert<ProcessingMessageAssert, ProcessingMessage>
4040
{
4141
private final JsonNode msg;
4242

@@ -48,7 +48,7 @@ public static ProcessingMessageAssert assertMessage(
4848

4949
private ProcessingMessageAssert(final ProcessingMessage actual)
5050
{
51-
super(ProcessingMessageAssert.class, actual);
51+
super(actual, ProcessingMessageAssert.class);
5252
msg = actual.asJson();
5353
}
5454

@@ -88,9 +88,10 @@ public <T> ProcessingMessageAssert hasField(final String name,
8888
assertThat(msg.has(name)).isTrue();
8989
final String input = msg.get(name).textValue();
9090
final String expected = value.toString();
91-
assertThat(input).isEqualTo(expected)
91+
assertThat(input)
9292
.overridingErrorMessage("Strings differ: wanted " + expected
93-
+ " but got " + input);
93+
+ " but got " + input)
94+
.isEqualTo(expected);
9495
return this;
9596
}
9697

0 commit comments

Comments
 (0)