@Test public void testEmpty() throws Exception { String patchExpression = "[]"; JsonNode jsonNode = JsonLoader.fromString(patchExpression); JsonPatch jsonPatch = JsonPatch.fromJson(jsonNode); ExpressionSpecBuilder actual = sut.apply(jsonPatch); assertThat(actual, is(notNullValue())); UpdateItemExpressionSpec actualSpec = actual.buildForUpdate(); assertThat(actualSpec.getConditionExpression(), is(nullValue())); assertThat(actualSpec.getUpdateExpression(), is("")); assertThat(actualSpec.getNameMap(), is(nullValue())); assertThat(actualSpec.getValueMap(), is(nullValue())); }
@Override public ExpressionSpecBuilder apply(JsonPatch t) { ExpressionSpecBuilder builder = new ExpressionSpecBuilder(); t.getOperations().forEach(operation -> operation.applyToBuilder(builder)); return builder; }
JsonPatchToExpressionSpecBuilder implements Function<JsonPatch, ExpressionSpecBuilder> { @Override public ExpressionSpecBuilder apply(JsonPatch t) { ExpressionSpecBuilder builder = new ExpressionSpecBuilder(); t.getOperations().forEach(operation -> operation.applyToBuilder(builder)); return builder; } }
JsonPatchToExpressionSpecBuilder implements Function<JsonPatch, ExpressionSpecBuilder> { @Override public ExpressionSpecBuilder apply(JsonPatch t) { ExpressionSpecBuilder builder = new ExpressionSpecBuilder(); t.getOperations().forEach(operation -> operation.applyToBuilder(builder)); return builder; }  }
JsonPatchToExpressionSpecBuilder implements Function<JsonPatch, ExpressionSpecBuilder> { @Override public ExpressionSpecBuilder apply(JsonPatch t) { ExpressionSpecBuilder builder = new ExpressionSpecBuilder(); t.getOperations().forEach(operation -> operation.applyToBuilder(builder)); return builder; }  @Override ExpressionSpecBuilder apply(JsonPatch t); }
JsonPatchToExpressionSpecBuilder implements Function<JsonPatch, ExpressionSpecBuilder> { @Override public ExpressionSpecBuilder apply(JsonPatch t) { ExpressionSpecBuilder builder = new ExpressionSpecBuilder(); t.getOperations().forEach(operation -> operation.applyToBuilder(builder)); return builder; }  @Override ExpressionSpecBuilder apply(JsonPatch t);  }