RegisterContextResponse { public void setDuration(String duration) { this.duration = duration; } RegisterContextResponse();  RegisterContextResponse(String registrationId); String getDuration(); void setDuration(String duration); String getRegistrationId(); void setRegistrationId(String registrationId); StatusCode getErrorCode(); void setErrorCode(StatusCode errorCode);  }
@Test public void serializationSimpleRegisterContextResponse() throws IOException { RegisterContextResponse registerContextResponse = new RegisterContextResponse("52a744b011f5816465943d58"); registerContextResponse.setDuration("P1M"); ObjectMapper mapper = new ObjectMapper(); ObjectWriter writer = mapper.writer(new DefaultPrettyPrinter()); String json = writer.writeValueAsString(registerContextResponse); assertEquals("52a744b011f5816465943d58", JsonPath.read(json, "$.registrationId")); assertEquals("P1M", JsonPath.read(json, "$.duration")); }