private static final String SLUG = "my-new-iteration";
@Test
public void create() {
ProjectIteration iteration = new ProjectIteration(SLUG);
IProjectIterationResource resource =
getClientRequestFactory().createProxy(
IProjectIterationResource.class,
createBaseURI(RESOURCE_PATH).resolve(SLUG));
Response response = resource.put(iteration);
assertThat(response.getStatus(), is(Status.CREATED.getStatusCode()));
String location = (String) response.getMetadata().getFirst("Location");
assertThat(location, endsWith("/iterations/i/" + SLUG));
ClientResponse<ProjectIteration> response1 = resource.get();
assertThat(response1.getStatus(), is(Status.OK.getStatusCode()));
ProjectIteration iterationRes = response1.getEntity();
assertThat(iterationRes, notNullValue());
assertThat(iterationRes.getId(), is(SLUG));
}