From b34e752db6d8bad7d040d19be545e3cfc57f3dcd Mon Sep 17 00:00:00 2001 From: Tadaya Tsuyukubo Date: Wed, 2 Jan 2019 17:19:20 -0800 Subject: [PATCH 1/2] Ensure checking customizer ordering See gh-15603 --- .../boot/web/client/RestTemplateBuilderTests.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java index 0203d3eee90..e8f8d597ee7 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java @@ -24,6 +24,7 @@ import java.util.function.Supplier; import org.apache.http.client.config.RequestConfig; import org.junit.Before; import org.junit.Test; +import org.mockito.InOrder; import org.mockito.Mock; import org.mockito.MockitoAnnotations; @@ -47,6 +48,7 @@ import org.springframework.web.util.UriTemplateHandler; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException; import static org.mockito.ArgumentMatchers.any; +import static org.mockito.Mockito.inOrder; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.spy; import static org.mockito.Mockito.verify; @@ -401,8 +403,9 @@ public class RestTemplateBuilderTests { RestTemplateCustomizer customizer2 = mock(RestTemplateCustomizer.class); RestTemplate template = this.builder.customizers(customizer1) .additionalCustomizers(customizer2).build(); - verify(customizer1).customize(template); - verify(customizer2).customize(template); + InOrder inOrder = inOrder(customizer1, customizer2); + inOrder.verify(customizer1).customize(template); + inOrder.verify(customizer2).customize(template); } @Test From 4729d170a8fea6b577a0eddc2754ee0ed252ebff Mon Sep 17 00:00:00 2001 From: Stephane Nicoll Date: Thu, 3 Jan 2019 10:26:09 +0100 Subject: [PATCH 2/2] Polish "Ensure checking customizer ordering" Closes gh-15603 --- .../boot/web/client/RestTemplateBuilderTests.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java index e8f8d597ee7..3852df32f89 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/client/RestTemplateBuilderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2018 the original author or authors. + * Copyright 2012-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.