use of io.confluent.ksql.test.model.QttTestFile in project ksql by confluentinc.
the class TestExecutorUtilTest method loadTestCase.
private static TestCase loadTestCase(final String testName) {
try {
final QttTestFile qttTestFile = TestJsonMapper.INSTANCE.get().readValue(TEST_FILE, QttTestFile.class);
final TestCaseNode testCaseNode = qttTestFile.tests.stream().filter(tcn -> tcn.name().equals(testName)).findFirst().orElseThrow(() -> new AssertionError("Invalid test: no test case named " + testName));
return TestCaseBuilder.buildTests(testCaseNode, TEST_FILE.toPath(), name -> mock(TestLocation.class)).get(0);
} catch (final Exception e) {
throw new AssertionError("Invalid test: failed to load test " + testName, e);
}
}
Aggregations