Simplify JsonPathExpectationsHelperTests with text blocks

This commit is contained in:
Sam Brannen 2021-10-13 20:43:13 +02:00
parent 1ef47fa369
commit 373b90d263
1 changed files with 23 additions and 19 deletions

View File

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2020 the original author or authors. * Copyright 2002-2021 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.
@ -30,25 +30,29 @@ import static org.hamcrest.core.Is.is;
*/ */
class JsonPathExpectationsHelperTests { class JsonPathExpectationsHelperTests {
private static final String CONTENT = "{" + // private static final String CONTENT = """
"'str': 'foo', " + // {
"'num': 5, " + // 'str': 'foo',
"'bool': true, " + // 'num': 5,
"'arr': [42], " + // 'bool': true,
"'colorMap': {'red': 'rojo'}, " + // 'arr': [42],
"'whitespace': ' ', " + // 'colorMap': {'red': 'rojo'},
"'emptyString': '', " + // 'whitespace': ' ',
"'emptyArray': [], " + // 'emptyString': '',
"'emptyMap': {} " + // 'emptyArray': [],
"}"; 'emptyMap': {}
}""";
private static final String SIMPSONS = "{ 'familyMembers': [ " + // private static final String SIMPSONS = """
"{'name': 'Homer' }, " + // {
"{'name': 'Marge' }, " + // 'familyMembers': [
"{'name': 'Bart' }, " + // {'name': 'Homer' },
"{'name': 'Lisa' }, " + // {'name': 'Marge' },
"{'name': 'Maggie'} " + // {'name': 'Bart' },
" ] }"; {'name': 'Lisa' },
{'name': 'Maggie'}
]
}""";
@Test @Test