use of elemental.json.JsonObject in project che by eclipse.
the class JsonRpcResponseTest method shouldToStringWhenPassingParametersWithError.
@Test
public void shouldToStringWhenPassingParametersWithError() throws Exception {
JsonObject expected = response;
expected.remove("result");
JsonRpcResponse jsonRpcResponse = new JsonRpcResponse(ID, null, error, jsonFactory);
JsonValue actual = jsonFactory.parse(jsonRpcResponse.toString());
assertTrue(expected.jsEquals(actual));
}
use of elemental.json.JsonObject in project che by eclipse.
the class JsonRpcResponseTest method shouldToStringWhenParsingStringWithError.
@Test
public void shouldToStringWhenParsingStringWithError() throws Exception {
JsonObject expected = response;
expected.remove("result");
JsonRpcResponse jsonRpcResponse = new JsonRpcResponse(expected.toJson(), jsonFactory, dtoFactory);
JsonValue actual = jsonFactory.parse(jsonRpcResponse.toString());
assertTrue(expected.jsEquals(actual));
}
use of elemental.json.JsonObject in project che by eclipse.
the class JsonRpcResponseTest method shouldToJsonObjectWhenPassingParametersWithResult.
@Test
public void shouldToJsonObjectWhenPassingParametersWithResult() throws Exception {
JsonObject expected = response;
expected.remove("error");
JsonRpcResponse jsonRpcResponse = new JsonRpcResponse(ID, result, null, jsonFactory);
JsonObject actual = jsonRpcResponse.toJsonObject();
assertTrue(expected.jsEquals(actual));
}
use of elemental.json.JsonObject in project che by eclipse.
the class JsonRpcResponseTest method shouldToStringWhenPassingParametersWithResult.
@Test
public void shouldToStringWhenPassingParametersWithResult() throws Exception {
JsonObject expected = response;
expected.remove("error");
JsonRpcResponse jsonRpcResponse = new JsonRpcResponse(ID, result, null, jsonFactory);
JsonValue actual = jsonFactory.parse(jsonRpcResponse.toString());
assertTrue(expected.jsEquals(actual));
}
use of elemental.json.JsonObject in project che by eclipse.
the class JsonRpcResponseTest method shouldToStringWhenParsingStringWithResult.
@Test
public void shouldToStringWhenParsingStringWithResult() throws Exception {
JsonObject expected = response;
expected.remove("error");
JsonRpcResponse jsonRpcResponse = new JsonRpcResponse(expected.toJson(), jsonFactory, dtoFactory);
JsonValue actual = jsonFactory.parse(jsonRpcResponse.toString());
assertTrue(expected.jsEquals(actual));
}
Aggregations