WaitAction extends SymbolAction { public Long getDuration() { return duration; }  @Override ExecuteResult execute(ConnectorManager connector); Long getDuration(); void setDuration(Long duration);  }
@Test public void testJSON() throws IOException { ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(w); WaitAction w2 = mapper.readValue(json, WaitAction.class); assertEquals(w.getDuration(), w2.getDuration()); }
@Test public void testJSONFile() throws IOException, URISyntaxException { ObjectMapper mapper = new ObjectMapper(); File file = new File(getClass().getResource("/actions/WaitTestData.json").toURI()); SymbolAction obj = mapper.readValue(file, SymbolAction.class); assertTrue(obj instanceof SymbolAction); WaitAction objAsAction = (WaitAction) obj; assertEquals(ONE_SECOND, objAsAction.getDuration()); }