Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Morten Haraldsen committed Jan 26, 2024
1 parent a791f01 commit 33343e7
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/test/java/com/ethlo/time/ExternalParameterizedTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ public class ExternalParameterizedTest
{
private static final Logger logger = LoggerFactory.getLogger(ExternalParameterizedTest.class);

public static List<TestParam> fromFile() throws IOException
{
final List<TestParam> result = new ObjectMapper()
.enable(JsonParser.Feature.ALLOW_COMMENTS)
.readValue(ExternalParameterizedTest.class.getResource("/test-data.json"), new TypeReference<List<TestParam>>()
{
});
logger.info("Loaded {} test-cases", result.size());
return result;
}

@ParameterizedTest
@MethodSource("fromFile")
void testAll(TestParam param)
Expand Down Expand Up @@ -120,15 +131,4 @@ private Instant getExpected(TestParam testParam)
throw new IllegalArgumentException("Cannot parse using Instant: " + testParam.getInput() + ": " + exc.getMessage(), exc);
}
}

public static List<TestParam> fromFile() throws IOException
{
final List<TestParam> result = new ObjectMapper()
.enable(JsonParser.Feature.ALLOW_COMMENTS)
.readValue(ExternalParameterizedTest.class.getResource("/test-data.json"), new TypeReference<List<TestParam>>()
{
});
logger.info("Loaded {} test-cases", result.size());
return result;
}
}

0 comments on commit 33343e7

Please sign in to comment.