AcmeJsonResource extends AcmeResource { protected void setJSON(JSON data) { this.data = Objects.requireNonNull(data, "data"); } protected  AcmeJsonResource(Login login, URL location); JSON getJSON(); void update();  }
@Test public void testSetJson() { Login login = TestUtils.login(); JSON jsonData2 = getJSON("requestOrderResponse"); AcmeJsonResource resource = new DummyJsonResource(login, LOCATION_URL); assertThat(resource.isValid(), is(false)); assertUpdateInvoked(resource, 0); resource.setJSON(JSON_DATA); assertThat(resource.getJSON(), is(JSON_DATA)); assertThat(resource.isValid(), is(true)); assertUpdateInvoked(resource, 0); resource.setJSON(jsonData2); assertThat(resource.getJSON(), is(jsonData2)); assertThat(resource.isValid(), is(true)); assertUpdateInvoked(resource, 0); }