Upgrade to Mockito 2.11

Includes fixes for invalid exception declarations in Mockito-based unit tests. Also includes FreeMarker 2.3.27, Commons Pool 2.4.3, JSON-P 1.1.2.

Issue: SPR-16157
This commit is contained in:
Juergen Hoeller
2017-11-04 01:06:59 +01:00
parent a37fce854f
commit 996d747aed
8 changed files with 27 additions and 24 deletions

View File

@@ -48,7 +48,7 @@ public class ByteArrayResource extends AbstractResource {
/**
* Create a new ByteArrayResource.
* Create a new {@code ByteArrayResource}.
* @param byteArray the byte array to wrap
*/
public ByteArrayResource(byte[] byteArray) {
@@ -56,7 +56,7 @@ public class ByteArrayResource extends AbstractResource {
}
/**
* Create a new ByteArrayResource.
* Create a new {@code ByteArrayResource} with a description.
* @param byteArray the byte array to wrap
* @param description where the byte array comes from
*/
@@ -66,6 +66,7 @@ public class ByteArrayResource extends AbstractResource {
this.description = (description != null ? description : "");
}
/**
* Return the underlying byte array.
*/
@@ -73,7 +74,6 @@ public class ByteArrayResource extends AbstractResource {
return this.byteArray;
}
/**
* This implementation always returns {@code true}.
*/

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2016 the original author or authors.
* Copyright 2002-2017 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.
@@ -19,6 +19,7 @@ package org.springframework.tests;
import java.util.List;
import org.mockito.Mockito;
import org.mockito.internal.stubbing.InvocationContainerImpl;
import org.mockito.internal.util.MockUtil;
import org.mockito.invocation.Invocation;
@@ -40,8 +41,10 @@ public abstract class MockitoUtils {
* @param argumentAdapters adapters that can be used to change argument values before they are compared
*/
public static <T> void verifySameInvocations(T expected, T actual, InvocationArgumentsAdapter... argumentAdapters) {
List<Invocation> expectedInvocations = MockUtil.getMockHandler(expected).getInvocationContainer().getInvocations();
List<Invocation> actualInvocations = MockUtil.getMockHandler(actual).getInvocationContainer().getInvocations();
List<Invocation> expectedInvocations =
((InvocationContainerImpl) MockUtil.getMockHandler(expected).getInvocationContainer()).getInvocations();
List<Invocation> actualInvocations =
((InvocationContainerImpl) MockUtil.getMockHandler(actual).getInvocationContainer()).getInvocations();
verifySameInvocations(expectedInvocations, actualInvocations, argumentAdapters);
}