Use constant from RestApiServlet to skip JSON_MAGIC in acceptance tests
Change-Id: I9ebde3265a58eeafe0546733c9c962de28a3cb26 Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
parent
c991828e45
commit
8d71f29e1e
@ -14,6 +14,8 @@
|
||||
|
||||
package com.google.gerrit.acceptance;
|
||||
|
||||
import static com.google.gerrit.httpd.restapi.RestApiServlet.JSON_MAGIC;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.io.Reader;
|
||||
@ -37,7 +39,7 @@ public class RestSession {
|
||||
HttpGet get = new HttpGet("http://localhost:8080/a" + endPoint);
|
||||
HttpResponse response = getClient().execute(get);
|
||||
Reader reader = new InputStreamReader(response.getEntity().getContent());
|
||||
reader.skip(4);
|
||||
reader.skip(JSON_MAGIC.length);
|
||||
return reader;
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ public class RestApiServlet extends HttpServlet {
|
||||
* HTTP interface will need to always strip the first line of response data to
|
||||
* remove this magic header.
|
||||
*/
|
||||
private static final byte[] JSON_MAGIC;
|
||||
public static final byte[] JSON_MAGIC;
|
||||
|
||||
static {
|
||||
JSON_MAGIC = ")]}'\n".getBytes(UTF_8);
|
||||
|
Loading…
Reference in New Issue
Block a user