Simplify exception handling in JsonPathExpectationsHelper

master
Sam Brannen 8 years ago
parent 2e4a7480fc
commit 5998a297ce
  1. 10
      spring-test/src/main/java/org/springframework/test/util/JsonPathExpectationsHelper.java

@ -1,5 +1,5 @@
/*
* Copyright 2002-2015 the original author or authors.
* Copyright 2002-2016 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.
@ -227,13 +227,7 @@ public class JsonPathExpectationsHelper {
try {
return this.jsonPath.read(content);
}
catch (InvalidPathException ex) {
throw new AssertionError(message + ex.getMessage());
}
catch (ArrayIndexOutOfBoundsException ex) {
throw new AssertionError(message + ex.getMessage());
}
catch (IndexOutOfBoundsException ex) {
catch (InvalidPathException | IndexOutOfBoundsException ex) {
throw new AssertionError(message + ex.getMessage());
}
}

Loading…
Cancel
Save