Browse Source

Polishing

pull/28119/head
Sam Brannen 3 years ago
parent
commit
a13ad3e969
  1. 14
      spring-test/src/main/java/org/springframework/test/util/JsonExpectationsHelper.java

14
spring-test/src/main/java/org/springframework/test/util/JsonExpectationsHelper.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2018 the original author or authors. * Copyright 2002-2022 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -32,8 +32,8 @@ public class JsonExpectationsHelper {
/** /**
* Parse the expected and actual strings as JSON and assert the two * Parse the expected and actual strings as JSON and assert the two
* are "similar" - i.e. they contain the same attribute-value pairs * are "similar" - i.e. they contain the same attribute-value pairs
* regardless of formatting with a lenient checking (extensible, and non-strict * regardless of formatting with lenient checking (extensible content and
* array ordering). * non-strict array ordering).
* @param expected the expected JSON content * @param expected the expected JSON content
* @param actual the actual JSON content * @param actual the actual JSON content
* @since 4.1 * @since 4.1
@ -47,14 +47,14 @@ public class JsonExpectationsHelper {
* Parse the expected and actual strings as JSON and assert the two * Parse the expected and actual strings as JSON and assert the two
* are "similar" - i.e. they contain the same attribute-value pairs * are "similar" - i.e. they contain the same attribute-value pairs
* regardless of formatting. * regardless of formatting.
* <p>Can compare in two modes, depending on {@code strict} parameter value: * <p>Can compare in two modes, depending on the {@code strict} parameter value:
* <ul> * <ul>
* <li>{@code true}: strict checking. Not extensible, and strict array ordering.</li> * <li>{@code true}: strict checking. Not extensible and strict array ordering.</li>
* <li>{@code false}: lenient checking. Extensible, and non-strict array ordering.</li> * <li>{@code false}: lenient checking. Extensible and non-strict array ordering.</li>
* </ul> * </ul>
* @param expected the expected JSON content * @param expected the expected JSON content
* @param actual the actual JSON content * @param actual the actual JSON content
* @param strict enables strict checking * @param strict enables strict checking if {@code true}
* @since 4.2 * @since 4.2
*/ */
public void assertJsonEqual(String expected, String actual, boolean strict) throws Exception { public void assertJsonEqual(String expected, String actual, boolean strict) throws Exception {

Loading…
Cancel
Save