Skip to content

Commit 40e0182

Browse files
committed
tidy
1 parent 24166a4 commit 40e0182

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

json-java21-jtd/src/test/java/json/java21/jtd/JtdSpecIT.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public class JtdSpecIT extends JtdTestBase {
5555

5656
private static final ObjectMapper MAPPER = new ObjectMapper();
5757
private static final Path VALIDATION_TEST_FILE = Paths.get("target/test-data/json-typedef-spec-2025-09-27/tests/validation.json");
58-
private static final Path INVALID_SCHEMAS_FILE = Paths.get("target/test-data/json-typedef-spec-2025-09-27/tests/invalid_schemas.json");
5958

6059
/// Metrics tracking for test results
6160
private static int totalTests = 0;
@@ -83,7 +82,7 @@ Stream<DynamicTest> runJtdSpecSuite() throws Exception {
8382

8483
private Stream<DynamicTest> runValidationTests() throws Exception {
8584
LOG.info(() -> "Running validation tests from: " + VALIDATION_TEST_FILE);
86-
JsonNode validationSuite = loadTestFile(VALIDATION_TEST_FILE);
85+
JsonNode validationSuite = loadTestFile();
8786

8887
return StreamSupport.stream(((Iterable<Map.Entry<String, JsonNode>>) validationSuite::fields).spliterator(), false)
8988
.map(entry -> {
@@ -131,13 +130,13 @@ private void extractTestData() throws IOException {
131130
}
132131
}
133132

134-
private JsonNode loadTestFile(Path testFile) throws IOException {
135-
if (!Files.exists(testFile)) {
136-
throw new RuntimeException("JTD test file not found: " + testFile);
133+
private JsonNode loadTestFile() throws IOException {
134+
if (!Files.exists(JtdSpecIT.VALIDATION_TEST_FILE)) {
135+
throw new RuntimeException("JTD test file not found: " + JtdSpecIT.VALIDATION_TEST_FILE);
137136
}
138137

139-
LOG.fine(() -> "Loading JTD test file from: " + testFile);
140-
return MAPPER.readTree(Files.newInputStream(testFile));
138+
LOG.fine(() -> "Loading JTD test file from: " + JtdSpecIT.VALIDATION_TEST_FILE);
139+
return MAPPER.readTree(Files.newInputStream(JtdSpecIT.VALIDATION_TEST_FILE));
141140
}
142141

143142
private DynamicTest createValidationTest(String testName, JsonNode testCase) {

json-java21-jtd/src/test/java/json/java21/jtd/TestRfc8927.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,13 +1064,13 @@ public void testIntegerValidationExplicitDouble() {
10641064
JsonValue schema = Json.parse("{\"type\": \"int8\"}");
10651065

10661066
// Create a JsonNumber that definitely returns Double
1067-
JsonValue doubleValue = JsonNumber.of(1000.0);
1067+
JsonNumber doubleValue = JsonNumber.of(1000.0);
10681068

10691069
Jtd validator = new Jtd();
10701070
Jtd.Result result = validator.validate(schema, doubleValue);
10711071

10721072
LOG.fine(() -> "Explicit Double validation - value: " + doubleValue +
1073-
", toNumber() type: " + ((JsonNumber)doubleValue).toNumber().getClass().getSimpleName());
1073+
", toNumber() type: " + doubleValue.toNumber().getClass().getSimpleName());
10741074

10751075
// This should fail (1000 is way outside int8 range of -128 to 127)
10761076
assertThat(result.isValid())

0 commit comments

Comments
 (0)