use of com.bazaarvoice.jolt.JoltTransform in project nifi by apache.
the class TestTransformFactory method testGetDefaultTransform.
@Test
public void testGetDefaultTransform() throws Exception {
final String defaultrSpec = new String(Files.readAllBytes(Paths.get("src/test/resources/TestTransformFactory/defaultrSpec.json")));
JoltTransform transform = TransformFactory.getTransform(getClass().getClassLoader(), "jolt-transform-default", JsonUtils.jsonToObject(defaultrSpec));
assertTrue(transform instanceof Defaultr);
}
use of com.bazaarvoice.jolt.JoltTransform in project nifi by apache.
the class TestTransformFactory method testGetChainTransform.
@Test
public void testGetChainTransform() throws Exception {
final String chainrSpec = new String(Files.readAllBytes(Paths.get("src/test/resources/TestTransformFactory/chainrSpec.json")));
JoltTransform transform = TransformFactory.getTransform(getClass().getClassLoader(), "jolt-transform-chain", JsonUtils.jsonToObject(chainrSpec));
assertTrue(transform instanceof Chainr);
}
use of com.bazaarvoice.jolt.JoltTransform in project nifi by apache.
the class TestTransformFactory method testGetSortTransform.
@Test
public void testGetSortTransform() throws Exception {
JoltTransform transform = TransformFactory.getTransform(getClass().getClassLoader(), "jolt-transform-sort", null);
assertTrue(transform instanceof Sortr);
}
use of com.bazaarvoice.jolt.JoltTransform in project nifi by apache.
the class TestTransformFactory method testGetModifierDefaultTransform.
@Test
public void testGetModifierDefaultTransform() throws Exception {
final String cardrSpec = new String(Files.readAllBytes(Paths.get("src/test/resources/TestTransformFactory/modifierDefaultSpec.json")));
JoltTransform transform = TransformFactory.getTransform(getClass().getClassLoader(), "jolt-transform-modify-default", JsonUtils.jsonToObject(cardrSpec));
assertTrue(transform instanceof Modifier.Defaultr);
}
use of com.bazaarvoice.jolt.JoltTransform in project nifi by apache.
the class TestTransformFactory method testGetCustomTransformation.
@Test
public void testGetCustomTransformation() throws Exception {
final String chainrSpec = new String(Files.readAllBytes(Paths.get("src/test/resources/TestTransformFactory/chainrSpec.json")));
Path jarFilePath = Paths.get("src/test/resources/TestTransformFactory/TestCustomJoltTransform.jar");
URL[] urlPaths = new URL[1];
urlPaths[0] = jarFilePath.toUri().toURL();
ClassLoader customClassLoader = new URLClassLoader(urlPaths, this.getClass().getClassLoader());
JoltTransform transform = TransformFactory.getCustomTransform(customClassLoader, "TestCustomJoltTransform", JsonUtils.jsonToObject(chainrSpec));
assertTrue(transform != null);
assertTrue(transform.getClass().getName().equals("TestCustomJoltTransform"));
}
Aggregations