From fef0c7b15193e61a19302554ec3c421b64af7b7f Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 7 Mar 2018 13:22:21 +0100 Subject: [PATCH] Throw AssertionError instead of IAE in MockRestRequestMatchers --- .../test/web/client/match/MockRestRequestMatchers.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-test/src/main/java/org/springframework/test/web/client/match/MockRestRequestMatchers.java b/spring-test/src/main/java/org/springframework/test/web/client/match/MockRestRequestMatchers.java index f9b7a825bd..be1b3e9df7 100644 --- a/spring-test/src/main/java/org/springframework/test/web/client/match/MockRestRequestMatchers.java +++ b/spring-test/src/main/java/org/springframework/test/web/client/match/MockRestRequestMatchers.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-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. @@ -147,7 +147,7 @@ public abstract class MockRestRequestMatchers { List values = map.get(name); String message = "Expected " + valueType + " <" + name + ">"; - Assert.notNull(values, message); + assertTrue(message + " to exist but was null", values != null); assertTrue(message + " to have at least <" + count + "> values but found " + values, count <= values.size());