public void testAdvancedScheduledServiceWithProperties()
throws Exception
{
String jsonString =
"{\"data\":{\"id\":null,\"name\":\"test\",\"typeId\":\"Synchronize Repositories\",\"schedule\":\"advanced\",\"cronCommand\":\"somecroncommand\",\"properties\":[{\"key\":\"1\",\"value\":\"true\",\"@class\":\"org.sonatype.nexus.rest.model.ScheduledServicePropertyResource\"}]}}}";
XStreamRepresentation representation =
new XStreamRepresentation(xstream, jsonString, MediaType.APPLICATION_JSON);
ScheduledServiceResourceResponse response =
(ScheduledServiceResourceResponse) representation.getPayload(new ScheduledServiceResourceResponse());
assert response.getData().getId() == null;
assert response.getData().getName().equals("test");
assert response.getData().getTypeId().equals("Synchronize Repositories");
assert response.getData().getSchedule().equals("advanced");