Project p =
new Project("new-project", "New Project",
ProjectType.Podir.toString(),
"This is a New Sample Project");
IProjectResource projectClient =
super.createProxy(createClientProxyFactory(ADMIN, ADMIN_KEY),
IProjectResource.class, "/projects/p/new-project");
ClientResponse putResponse = projectClient.put(p);
// Assert initial put
assertThat(putResponse.getStatus(), is(Status.CREATED.getStatusCode()));
putResponse.releaseConnection();
// Modified Project
p.setDescription("This is an updated project");
putResponse = projectClient.put(p);
// Assert modification
assertThat(putResponse.getStatus(), is(Status.OK.getStatusCode()));
putResponse.releaseConnection();
// Retrieve again
Project p2 = projectClient.get().getEntity();
assertThat(p2.getId(), is(p.getId()));
assertThat(p2.getName(), is(p.getName()));
assertThat(p2.getDescription(), is(p.getDescription()));
assertThat(p2.getIterations(), nullValue());
}