@Test (dataProvider = "getTestCaseUnits") public void runTestUnits(String testCaseName) throws IOException { String testPath = "/json/cardinality/" + testCaseName; Map<String, Object> testUnit = JsonUtils.classpathToMap( testPath + ".json" ); Object input = testUnit.get( "input" ); Object spec = testUnit.get( "spec" ); Object expected = testUnit.get( "expected" ); CardinalityTransform cardinalityTransform = new CardinalityTransform( spec ); Object actual = cardinalityTransform.transform( input ); JoltTestUtil.runDiffy( "failed case " + testPath, expected, actual ); }
@Override public Object transform( Object input ) { rootSpec.apply( ROOT_KEY, Optional.of( input ), new WalkedPath(), null, null ); return input; }
CardinalityTransform implements SpecDriven, Transform { @Override public Object transform( Object input ) { rootSpec.apply( ROOT_KEY, Optional.of( input ), new WalkedPath(), null, null ); return input; } }
CardinalityTransform implements SpecDriven, Transform { @Override public Object transform( Object input ) { rootSpec.apply( ROOT_KEY, Optional.of( input ), new WalkedPath(), null, null ); return input; } @Inject  CardinalityTransform( Object spec ); }
CardinalityTransform implements SpecDriven, Transform { @Override public Object transform( Object input ) { rootSpec.apply( ROOT_KEY, Optional.of( input ), new WalkedPath(), null, null ); return input; } @Inject  CardinalityTransform( Object spec ); @Override Object transform( Object input ); }
CardinalityTransform implements SpecDriven, Transform { @Override public Object transform( Object input ) { rootSpec.apply( ROOT_KEY, Optional.of( input ), new WalkedPath(), null, null ); return input; } @Inject  CardinalityTransform( Object spec ); @Override Object transform( Object input );  }