use of org.apache.beam.vendor.grpc.v1p43p2.com.google.gson.JsonObject in project che by eclipse.
the class JsonRpcResultTest method shouldToJsonValueWhenPassingParametersWithResultAsAListOfDto.
@Test
public void shouldToJsonValueWhenPassingParametersWithResultAsAListOfDto() throws Exception {
JsonArray expected = new JsonArray();
JsonObject value = jsonParser.parse(dto.toString()).getAsJsonObject();
expected.add(value);
JsonRpcResult jsonRpcResult = new JsonRpcResult(singletonList(dto), jsonParser);
JsonElement actual = jsonRpcResult.toJsonElement();
assertEquals(expected, actual);
}
use of org.apache.beam.vendor.grpc.v1p43p2.com.google.gson.JsonObject in project che by eclipse.
the class JsonRpcResultTest method shouldGetAsVoidWhenParsingStringWithResultAsVoid.
//Void
@Test
public void shouldGetAsVoidWhenParsingStringWithResultAsVoid() throws Exception {
JsonObject value = new JsonObject();
Void expected = null;
JsonRpcResult jsonRpcResult = new JsonRpcResult(value.toString(), jsonParser);
Void actual = jsonRpcResult.getAs(Void.class);
assertEquals(expected, actual);
}
use of org.apache.beam.vendor.grpc.v1p43p2.com.google.gson.JsonObject in project che by eclipse.
the class JsonRpcResultTest method shouldToStringWhenParsingStringWithResultAsASingleVoid.
@Test
public void shouldToStringWhenParsingStringWithResultAsASingleVoid() throws Exception {
JsonObject value = new JsonObject();
String expected = value.toString();
JsonRpcResult jsonRpcResult = new JsonRpcResult(value.toString(), jsonParser);
String actual = jsonRpcResult.toString();
assertEquals(expected, actual);
}
use of org.apache.beam.vendor.grpc.v1p43p2.com.google.gson.JsonObject in project che by eclipse.
the class JsonRpcResultTest method shouldToStringWhenPassingParametersWithResultAsAListOfDto.
@Test
public void shouldToStringWhenPassingParametersWithResultAsAListOfDto() throws Exception {
JsonArray array = new JsonArray();
JsonObject value = jsonParser.parse(dto.toString()).getAsJsonObject();
array.add(value);
String expected = array.toString();
JsonRpcResult jsonRpcResult = new JsonRpcResult(singletonList(dto), jsonParser);
String actual = jsonRpcResult.toString();
assertEquals(expected, actual);
}
use of org.apache.beam.vendor.grpc.v1p43p2.com.google.gson.JsonObject in project che by eclipse.
the class JsonRpcParamsTest method shouldToStringForParsedListDtoParams.
@Test
public void shouldToStringForParsedListDtoParams() throws Exception {
JsonArray array = new JsonArray();
JsonObject jsonObject = jsonParser.parse(DTO_JSON).getAsJsonObject();
array.add(jsonObject);
String expected = array.toString();
JsonRpcParams jsonRpcParams = new JsonRpcParams("[" + DTO_JSON + "]", jsonParser);
String actual = jsonRpcParams.toString();
assertEquals(expected, actual);
}
Aggregations