ActionNotification extends Action { @Override public Action fromJSON(String data) { try { JSONObject o = new JSONObject(data); text.setValue(JsonHelper.safeGetString(o, "text")); } catch (JSONException e) { log.error("Unhandled exception", e); } return this; }  @Override int friendlyName(); @Override String shortDescription(); @Override void doAction(Callback callback); @Override Optional<Integer> icon(); @Override String toJSON(); @Override Action fromJSON(String data); @Override boolean hasDialog(); @Override void generateDialog(LinearLayout root); public InputString text; }
@Test public void fromJSONTest() { actionNotification = new ActionNotification(); actionNotification.fromJSON("{\"text\":\"Asd\"}"); Assert.assertEquals("Asd", actionNotification.text.getValue()); }