Polish "Use idiomatic AssertJ map assertions"

See gh-31752
This commit is contained in:
Stéphane Nicoll
2023-12-05 10:39:33 +01:00
parent 6f11716b6f
commit 1da40b84e7
11 changed files with 48 additions and 81 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2022 the original author or authors.
* Copyright 2002-2023 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.
@@ -189,8 +189,7 @@ class SelectionAndProjectionTests {
Expression exp = parser.parseExpression("colors.^[key.startsWith('b')]");
Map<String, String> colorsMap = (Map<String, String>) exp.getValue(context);
assertThat(colorsMap).hasSize(1);
assertThat(colorsMap.keySet().iterator().next()).isEqualTo("beige");
assertThat(colorsMap).containsOnlyKeys("beige");
}
@Test
@@ -201,8 +200,7 @@ class SelectionAndProjectionTests {
Expression exp = parser.parseExpression("colors.$[key.startsWith('b')]");
Map<String, String> colorsMap = (Map<String, String>) exp.getValue(context);
assertThat(colorsMap).hasSize(1);
assertThat(colorsMap.keySet().iterator().next()).isEqualTo("brown");
assertThat(colorsMap).containsOnlyKeys("brown");
}
@Test