From e7594ca2f364e05226d6274665b1b492b1e2a013 Mon Sep 17 00:00:00 2001 From: Scott Frederick Date: Wed, 4 Oct 2017 15:43:44 -0500 Subject: [PATCH] Rename BindResource property from "field" to "property" for consistency. --- .../servicebroker/model/BindResource.java | 20 +++++++++---------- ...eateServiceInstanceBindingRequestTest.java | 8 ++++---- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main/java/org/springframework/cloud/servicebroker/model/BindResource.java b/src/main/java/org/springframework/cloud/servicebroker/model/BindResource.java index 10c11ea0..788d09fd 100644 --- a/src/main/java/org/springframework/cloud/servicebroker/model/BindResource.java +++ b/src/main/java/org/springframework/cloud/servicebroker/model/BindResource.java @@ -26,28 +26,28 @@ public class BindResource { @JsonProperty private final String route; - private Map fields = new HashMap<>(); + private Map properties = new HashMap<>(); public BindResource() { this.appGuid = null; this.route = null; } - public BindResource(String appGuid, String route, Map fields) { + public BindResource(String appGuid, String route, Map properties) { this.appGuid = appGuid; this.route = route; - if (fields != null) { - this.fields.putAll(fields); + if (properties != null) { + this.properties.putAll(properties); } } - public BindResource(Map fields) { - this(null, null, fields); + public BindResource(Map properties) { + this(null, null, properties); } @JsonAnySetter - private void setField(String key, Object value) { - fields.put(key, value); + private void setProperty(String key, Object value) { + properties.put(key, value); } /** @@ -56,7 +56,7 @@ private void setField(String key, Object value) { * @param key the key of the value to retrieve * @return the value of the field, or {@literal null} if the key is not present in the request */ - public Object getField(String key) { - return fields.get(key); + public Object getProperty(String key) { + return properties.get(key); } } diff --git a/src/test/java/org/springframework/cloud/servicebroker/model/CreateServiceInstanceBindingRequestTest.java b/src/test/java/org/springframework/cloud/servicebroker/model/CreateServiceInstanceBindingRequestTest.java index 9323e3c9..6e9b3523 100644 --- a/src/test/java/org/springframework/cloud/servicebroker/model/CreateServiceInstanceBindingRequestTest.java +++ b/src/test/java/org/springframework/cloud/servicebroker/model/CreateServiceInstanceBindingRequestTest.java @@ -31,8 +31,8 @@ public void requestWithAppGuidBindingIsRead() { assertEquals(2, context.getProperty("field2")); assertNull(request.getBindResource().getRoute()); - assertEquals("data", request.getBindResource().getField("field1")); - assertEquals(2, request.getBindResource().getField("field2")); + assertEquals("data", request.getBindResource().getProperty("field1")); + assertEquals(2, request.getBindResource().getProperty("field2")); assertEquals(1, request.getParameters().get("parameter1")); assertEquals("foo", request.getParameters().get("parameter2")); @@ -50,8 +50,8 @@ public void requestWithRouteBindingIsRead() { assertNull(request.getAppGuid()); assertNull(request.getBindResource().getAppGuid()); assertEquals("http://test.example.com", request.getBindResource().getRoute()); - assertEquals("data", request.getBindResource().getField("field1")); - assertEquals(2, request.getBindResource().getField("field2")); + assertEquals("data", request.getBindResource().getProperty("field1")); + assertEquals(2, request.getBindResource().getProperty("field2")); assertEquals(KUBERNETES_PLATFORM, request.getContext().getPlatform()); assertThat(request.getContext(), instanceOf(KubernetesContext.class));