javax.json.JsonPatchBuilder Java Examples

The following examples show how to use javax.json.JsonPatchBuilder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ExecutionDynamicTest.java    From microprofile-graphql with Apache License 2.0 5 votes vote down vote up
private void validatePart(JsonObject jsonObject, String rootName, String... keys){
    JsonPatchBuilder jsonPatchBuilder = Json.createPatchBuilder();
    for(String key:keys){
        jsonPatchBuilder = remove(jsonPatchBuilder,jsonObject,key);
    }

    JsonObject emptyObject = jsonPatchBuilder.build().apply(jsonObject);

    Assert.assertTrue(emptyObject.isEmpty(),
            "Unknown elements in " + rootName + ", only " + Arrays.toString(keys)  + " expected");
}
 
Example #2
Source File: ExecutionDynamicTest.java    From microprofile-graphql with Apache License 2.0 4 votes vote down vote up
private JsonPatchBuilder remove(JsonPatchBuilder emptyJsonErrorPatchBuilder,JsonObject errorJsonObject, String key){
    if(errorJsonObject.containsKey(key)){
        emptyJsonErrorPatchBuilder = emptyJsonErrorPatchBuilder.remove("/" + key);
    }
    return emptyJsonErrorPatchBuilder;
}
 
Example #3
Source File: PreComputedJsonpProvider.java    From component-runtime with Apache License 2.0 4 votes vote down vote up
@Override
public JsonPatchBuilder createPatchBuilder() {
    return jsonpProvider.createPatchBuilder();
}
 
Example #4
Source File: PreComputedJsonpProvider.java    From component-runtime with Apache License 2.0 4 votes vote down vote up
@Override
public JsonPatchBuilder createPatchBuilder(final JsonArray initialData) {
    return jsonpProvider.createPatchBuilder(initialData);
}
 
Example #5
Source File: ConfigurableBus.java    From openwebbeans-meecrowave with Apache License 2.0 4 votes vote down vote up
@Override
public JsonPatchBuilder createPatchBuilder() {
    return provider.createPatchBuilder();
}
 
Example #6
Source File: ConfigurableBus.java    From openwebbeans-meecrowave with Apache License 2.0 4 votes vote down vote up
@Override
public JsonPatchBuilder createPatchBuilder(final JsonArray initialData) {
    return provider.createPatchBuilder(initialData);
}