From 02f2f62a4db96db4224e04e9f7660be185ed1bbb Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Wed, 5 Sep 2018 13:21:29 -0700 Subject: [PATCH 1/2] Upgrade amqp-client to 4.8 Closes gh-14259 --- spring-boot-dependencies/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-dependencies/pom.xml b/spring-boot-dependencies/pom.xml index 6a10e69df8..0fa35441df 100644 --- a/spring-boot-dependencies/pom.xml +++ b/spring-boot-dependencies/pom.xml @@ -140,7 +140,7 @@ 2.1.6 9.4.1212.jre7 4.1.4 - 4.0.3 + 4.8 2.0.8.RELEASE 2.0.7.RELEASE 2.53.1 From a9e8116a99cf38be2ddd3a0915ef2d6feb6a6e8a Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Wed, 5 Sep 2018 13:24:14 -0700 Subject: [PATCH 2/2] Only check for Mockito once Update `MockReset` so that checking for Mockito only happens once. Closes gh-14260 --- .../springframework/boot/test/mock/mockito/MockReset.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockReset.java b/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockReset.java index 1fad5ede47..fee66642f1 100644 --- a/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockReset.java +++ b/spring-boot-test/src/main/java/org/springframework/boot/test/mock/mockito/MockReset.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2017 the original author or authors. + * Copyright 2012-2018 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. @@ -53,6 +53,9 @@ public enum MockReset { */ NONE; + private static final boolean MOCKITO_PRESENT = ClassUtils + .isPresent("org.mockito.internal.util.MockUtil", null); + /** * Create {@link MockSettings settings} to be used with mocks where reset should occur * before each test method runs. @@ -103,7 +106,7 @@ public enum MockReset { @SuppressWarnings("rawtypes") static MockReset get(Object mock) { MockReset reset = MockReset.NONE; - if (ClassUtils.isPresent("org.mockito.internal.util.MockUtil", null)) { + if (MOCKITO_PRESENT) { if (Mockito.mockingDetails(mock).isMock()) { MockCreationSettings settings = MockitoApi.get().getMockSettings(mock); List listeners = settings.getInvocationListeners();