use of org.apache.beam.vendor.grpc.v1p43p2.com.google.gson.JsonObject in project che by eclipse.
the class JsonRpcRequestTest method shouldToStringWhenParseStringParamsWithIdAndWithParams.
@Test
public void shouldToStringWhenParseStringParamsWithIdAndWithParams() {
when(params.emptyOrAbsent()).thenReturn(false);
JsonObject expected = request;
JsonRpcRequest jsonRpcRequest = new JsonRpcRequest(request.toString(), jsonParser, jsonRpcFactory);
JsonElement actual = jsonParser.parse(jsonRpcRequest.toString());
assertEquals(expected, actual);
}
use of org.apache.beam.vendor.grpc.v1p43p2.com.google.gson.JsonObject in project che by eclipse.
the class JsonRpcRequestTest method shouldToJsonObjectWhenPassStringParamsWithIdAndWithParams.
@Test
public void shouldToJsonObjectWhenPassStringParamsWithIdAndWithParams() {
when(params.emptyOrAbsent()).thenReturn(false);
JsonObject expected = request;
JsonRpcRequest jsonRpcRequest = new JsonRpcRequest("0", "method", params, jsonParser);
JsonObject actual = jsonRpcRequest.toJsonObject();
assertEquals(expected, actual);
}
use of org.apache.beam.vendor.grpc.v1p43p2.com.google.gson.JsonObject in project che by eclipse.
the class JsonRpcRequestTest method shouldToJsonObjectWhenPassStringParamsWithIdAndWithoutParams.
@Test
public void shouldToJsonObjectWhenPassStringParamsWithIdAndWithoutParams() {
when(params.emptyOrAbsent()).thenReturn(true);
JsonObject expected = request;
expected.remove("params");
JsonRpcRequest jsonRpcRequest = new JsonRpcRequest("0", "method", params, jsonParser);
JsonObject actual = jsonRpcRequest.toJsonObject();
assertEquals(expected, actual);
}
use of org.apache.beam.vendor.grpc.v1p43p2.com.google.gson.JsonObject in project che by eclipse.
the class JsonRpcRequestTest method shouldToStringWhenPassStringParamsWithIdAndWithoutParams.
@Test
public void shouldToStringWhenPassStringParamsWithIdAndWithoutParams() {
when(params.emptyOrAbsent()).thenReturn(true);
JsonObject expected = request;
expected.remove("params");
JsonRpcRequest jsonRpcRequest = new JsonRpcRequest("0", "method", params, jsonParser);
JsonElement actual = jsonParser.parse(jsonRpcRequest.toString());
assertEquals(expected, actual);
}
use of org.apache.beam.vendor.grpc.v1p43p2.com.google.gson.JsonObject in project che by eclipse.
the class JsonRpcRequestTest method shouldToJsonObjectWhenParseStringParamsWithoutIdAndWithParams.
@Test
public void shouldToJsonObjectWhenParseStringParamsWithoutIdAndWithParams() {
when(params.emptyOrAbsent()).thenReturn(false);
JsonObject expected = request;
expected.remove("id");
JsonRpcRequest jsonRpcRequest = new JsonRpcRequest(request.toString(), jsonParser, jsonRpcFactory);
JsonObject actual = jsonRpcRequest.toJsonObject();
assertEquals(expected, actual);
}
Aggregations