Add acceptance test for getting/setting group properties via REST

The new tests checks that getting/setting the group properties (name,
description, options and owner) works via REST.

Change-Id: I22589cbdcd1f8eae42e51c2b02f20ce9ff6ac4f5
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2013-02-15 15:39:11 +01:00
parent c977090b26
commit 55561ae465
4 changed files with 239 additions and 6 deletions

View File

@@ -25,17 +25,27 @@ import java.io.Reader;
public class RestResponse {
private HttpResponse response;
private Reader reader;
RestResponse(HttpResponse response) {
this.response = response;
}
public Reader getReader() throws IllegalStateException, IOException {
Reader reader = new InputStreamReader(response.getEntity().getContent());
reader.skip(JSON_MAGIC.length);
if (reader == null && response.getEntity() != null) {
reader = new InputStreamReader(response.getEntity().getContent());
reader.skip(JSON_MAGIC.length);
}
return reader;
}
public void consume() throws IllegalStateException, IOException {
Reader reader = getReader();
if (reader != null) {
while (reader.read() != -1);
}
}
public int getStatusCode() {
return response.getStatusLine().getStatusCode();
}