@Test(expected = IllegalArgumentException.class) public void metadata_cannot_be_set_to_null() throws Exception { mapping.convertOperation(road, PatchOperation.replace("/metadata", null)); }
@Override public PatchOperation convertOperation(Road road, PatchOperation modelOperation) { checkArgument(isAddOrReplace(modelOperation), "You can only change the value of metadata"); checkArgument(modelOperation.getValue() instanceof Map, "metadata must be an object"); checkArgument(modelOperation.getValue() != null, "metadata cannot be null"); return PatchOperation.replace("/metadata", modelOperation.getValue()); }
MetadataPatchMapping extends PatchMapping { @Override public PatchOperation convertOperation(Road road, PatchOperation modelOperation) { checkArgument(isAddOrReplace(modelOperation), "You can only change the value of metadata"); checkArgument(modelOperation.getValue() instanceof Map, "metadata must be an object"); checkArgument(modelOperation.getValue() != null, "metadata cannot be null"); return PatchOperation.replace("/metadata", modelOperation.getValue()); } }
MetadataPatchMapping extends PatchMapping { @Override public PatchOperation convertOperation(Road road, PatchOperation modelOperation) { checkArgument(isAddOrReplace(modelOperation), "You can only change the value of metadata"); checkArgument(modelOperation.getValue() instanceof Map, "metadata must be an object"); checkArgument(modelOperation.getValue() != null, "metadata cannot be null"); return PatchOperation.replace("/metadata", modelOperation.getValue()); }  }
MetadataPatchMapping extends PatchMapping { @Override public PatchOperation convertOperation(Road road, PatchOperation modelOperation) { checkArgument(isAddOrReplace(modelOperation), "You can only change the value of metadata"); checkArgument(modelOperation.getValue() instanceof Map, "metadata must be an object"); checkArgument(modelOperation.getValue() != null, "metadata cannot be null"); return PatchOperation.replace("/metadata", modelOperation.getValue()); }  @Override String getPath(); @Override PatchOperation convertOperation(Road road, PatchOperation modelOperation); }
MetadataPatchMapping extends PatchMapping { @Override public PatchOperation convertOperation(Road road, PatchOperation modelOperation) { checkArgument(isAddOrReplace(modelOperation), "You can only change the value of metadata"); checkArgument(modelOperation.getValue() instanceof Map, "metadata must be an object"); checkArgument(modelOperation.getValue() != null, "metadata cannot be null"); return PatchOperation.replace("/metadata", modelOperation.getValue()); }  @Override String getPath(); @Override PatchOperation convertOperation(Road road, PatchOperation modelOperation);  }