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:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user