assertTrue(l.created.isEmpty());
assertTrue(l.removed.isEmpty());
assertTrue(l.modified.isEmpty());
assertTrue(l.visited.isEmpty());
EntityEnclosingMethod put = new PutMethod(restUrl + "/k");
put.setRequestEntity(new ByteArrayRequestEntity(
"v".getBytes(), "application/octet-stream"));
remote.executeMethod(put);
assertEquals(1, l.createdCounter);
assertEquals("v".getBytes(), (byte[]) l.created.get("k"));
assertTrue(l.removed.isEmpty());
assertEquals(1, l.modifiedCounter);
assertEquals("v".getBytes(), (byte[]) l.modified.get("k"));
assertTrue(l.visited.isEmpty());
EntityEnclosingMethod put2 = new PutMethod(restUrl + "/key");
put2.setRequestEntity(new ByteArrayRequestEntity(
"value".getBytes(), "application/octet-stream"));
remote.executeMethod(put2);
assertEquals(2, l.createdCounter);
assertTrue(l.removed.isEmpty());
assertEquals(2, l.modifiedCounter);
assertTrue(l.visited.isEmpty());
EntityEnclosingMethod put3 = new PutMethod(restUrl + "/key");
put3.setRequestEntity(new ByteArrayRequestEntity(
"modifiedValue".getBytes(), "application/octet-stream"));
remote.executeMethod(put3);
assertEquals(2, l.createdCounter);
assertTrue(l.removed.isEmpty());
assertEquals(3, l.modifiedCounter);
assertEquals("modifiedValue".getBytes(), (byte[]) l.modified.get("key"));
assertTrue(l.visited.isEmpty());
EntityEnclosingMethod post = new PutMethod(restUrl + "/k");
post.setRequestEntity(new ByteArrayRequestEntity(
"replacedValue".getBytes(), "application/octet-stream"));
remote.executeMethod(post);
assertEquals(2, l.createdCounter);
assertTrue(l.removed.isEmpty());