CheckAttributeExistsAction extends RESTSymbolAction { public String getAttribute() { return attribute; }  @Override ExecuteResult execute(WebServiceConnector target); String getAttribute(); @Transient @JsonIgnore String getAttributeWithVariableValues(); void setAttribute(String attribute);  }
@Test public void testJSON() throws IOException { ObjectMapper mapper = new ObjectMapper(); String json = mapper.writeValueAsString(c); CheckAttributeExistsAction c2 = mapper.readValue(json, CheckAttributeExistsAction.class); assertEquals(c.getAttribute(), c2.getAttribute()); }
@Test public void testJSONFile() throws IOException, URISyntaxException { ObjectMapper mapper = new ObjectMapper(); String path = "/actions/restsymbolactions/CheckAttributeExistsTestData.json"; File file = new File(getClass().getResource(path).toURI()); RESTSymbolAction obj = mapper.readValue(file, RESTSymbolAction.class); assertTrue(obj instanceof CheckAttributeExistsAction); CheckAttributeExistsAction objAsAction = (CheckAttributeExistsAction) obj; assertEquals("object.attribute", objAsAction.getAttribute()); }