From 09ac7fb0c0754c28f2f792a2e22f3c5648d5ad3c Mon Sep 17 00:00:00 2001 From: Jens Schauder Date: Wed, 17 Apr 2019 10:34:50 +0200 Subject: [PATCH] #859 - Polishing. Changed http urls to https. Minor changes to formatting. --- .../springframework/hateoas/PaymentProcessingApp.java | 2 +- .../org/springframework/hateoas/PaymentProcessor.java | 2 +- .../org/springframework/hateoas/support/Customer.java | 2 +- .../org/springframework/hateoas/support/Order.java | 2 +- .../org/springframework/hateoas/support/Payment.java | 2 +- .../hateoas/support/PaymentController.java | 2 +- .../mvc/RepresentationModelProcessorInvoker.java | 8 ++++++-- .../RepresentationModelProcessorIntegrationTest.java | 2 +- ...cessorHandlerMethodReturnValueHandlerUnitTest.java | 11 ++++------- 9 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/docs/java/org/springframework/hateoas/PaymentProcessingApp.java b/src/docs/java/org/springframework/hateoas/PaymentProcessingApp.java index 3aa73e01..4387bf0a 100644 --- a/src/docs/java/org/springframework/hateoas/PaymentProcessingApp.java +++ b/src/docs/java/org/springframework/hateoas/PaymentProcessingApp.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/docs/java/org/springframework/hateoas/PaymentProcessor.java b/src/docs/java/org/springframework/hateoas/PaymentProcessor.java index 208c4407..94eaa701 100644 --- a/src/docs/java/org/springframework/hateoas/PaymentProcessor.java +++ b/src/docs/java/org/springframework/hateoas/PaymentProcessor.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/docs/java/org/springframework/hateoas/support/Customer.java b/src/docs/java/org/springframework/hateoas/support/Customer.java index 19875bf4..2a2117c7 100644 --- a/src/docs/java/org/springframework/hateoas/support/Customer.java +++ b/src/docs/java/org/springframework/hateoas/support/Customer.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/docs/java/org/springframework/hateoas/support/Order.java b/src/docs/java/org/springframework/hateoas/support/Order.java index 390fd35c..0b9c88cf 100644 --- a/src/docs/java/org/springframework/hateoas/support/Order.java +++ b/src/docs/java/org/springframework/hateoas/support/Order.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/docs/java/org/springframework/hateoas/support/Payment.java b/src/docs/java/org/springframework/hateoas/support/Payment.java index 982ac338..d21738e7 100644 --- a/src/docs/java/org/springframework/hateoas/support/Payment.java +++ b/src/docs/java/org/springframework/hateoas/support/Payment.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/docs/java/org/springframework/hateoas/support/PaymentController.java b/src/docs/java/org/springframework/hateoas/support/PaymentController.java index 1d1ea8ea..278a732c 100644 --- a/src/docs/java/org/springframework/hateoas/support/PaymentController.java +++ b/src/docs/java/org/springframework/hateoas/support/PaymentController.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/org/springframework/hateoas/server/mvc/RepresentationModelProcessorInvoker.java b/src/main/java/org/springframework/hateoas/server/mvc/RepresentationModelProcessorInvoker.java index 0ca7352d..9fc9cb9f 100644 --- a/src/main/java/org/springframework/hateoas/server/mvc/RepresentationModelProcessorInvoker.java +++ b/src/main/java/org/springframework/hateoas/server/mvc/RepresentationModelProcessorInvoker.java @@ -130,8 +130,12 @@ public class RepresentationModelProcessorInvoker { } if (RepresentationModelProcessorHandlerMethodReturnValueHandler.CONTENT_FIELD != null) { - ReflectionUtils.setField(RepresentationModelProcessorHandlerMethodReturnValueHandler.CONTENT_FIELD, - collectionModel, result); + + ReflectionUtils.setField( // + RepresentationModelProcessorHandlerMethodReturnValueHandler.CONTENT_FIELD, // + collectionModel, // + result // + ); } } diff --git a/src/test/java/org/springframework/hateoas/server/mvc/RepresentationModelProcessorIntegrationTest.java b/src/test/java/org/springframework/hateoas/server/mvc/RepresentationModelProcessorIntegrationTest.java index df3efb45..06b47b7e 100644 --- a/src/test/java/org/springframework/hateoas/server/mvc/RepresentationModelProcessorIntegrationTest.java +++ b/src/test/java/org/springframework/hateoas/server/mvc/RepresentationModelProcessorIntegrationTest.java @@ -5,7 +5,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/test/java/org/springframework/hateoas/server/mvc/ResourceProcessorHandlerMethodReturnValueHandlerUnitTest.java b/src/test/java/org/springframework/hateoas/server/mvc/ResourceProcessorHandlerMethodReturnValueHandlerUnitTest.java index dfb0befe..74de5f72 100644 --- a/src/test/java/org/springframework/hateoas/server/mvc/ResourceProcessorHandlerMethodReturnValueHandlerUnitTest.java +++ b/src/test/java/org/springframework/hateoas/server/mvc/ResourceProcessorHandlerMethodReturnValueHandlerUnitTest.java @@ -15,10 +15,9 @@ */ package org.springframework.hateoas.server.mvc; +import static java.util.Collections.*; import static org.assertj.core.api.Assertions.*; -import static org.mockito.ArgumentMatchers.any; -import static org.mockito.ArgumentMatchers.eq; -import static org.mockito.ArgumentMatchers.isNull; +import static org.mockito.ArgumentMatchers.*; import static org.mockito.Mockito.*; import static org.springframework.util.ReflectionUtils.*; @@ -63,8 +62,7 @@ class ResourceProcessorHandlerMethodReturnValueHandlerUnitTest { static final EntityModel FOO = new EntityModel<>("foo"); static final CollectionModel> FOOS = new CollectionModel<>(Collections.singletonList(FOO)); - static final PagedModel> FOO_PAGE = new PagedModel<>(Collections.singleton(FOO), - new PageMetadata(1, 0, 10)); + static final PagedModel> FOO_PAGE = new PagedModel<>(singleton(FOO), new PageMetadata(1, 0, 10)); static final StringResource FOO_RES = new StringResource("foo"); static final HttpEntity> FOO_ENTITY = new HttpEntity<>(FOO); static final ResponseEntity> FOO_RESP_ENTITY = new ResponseEntity<>(FOO, HttpStatus.OK); @@ -281,8 +279,7 @@ class ResourceProcessorHandlerMethodReturnValueHandlerUnitTest { void doesNotInvokeAProcessorForASpecializedType() throws Exception { EmbeddedWrappers wrappers = new EmbeddedWrappers(false); - CollectionModel value = new CollectionModel<>( - Collections.singleton(wrappers.emptyCollectionOf(Object.class))); + CollectionModel value = new CollectionModel<>(singleton(wrappers.emptyCollectionOf(Object.class))); CollectionModelProcessorWrapper wrapper = new CollectionModelProcessorWrapper(new SpecialResourcesProcessor()); ResolvableType type = ResolvableType.forMethodReturnType(Controller.class.getMethod("resourcesOfObject"));