Skip to content

Commit 08dbb2d

Browse files
committed
Polish
1 parent 199606d commit 08dbb2d

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/source/SpringIterableConfigurationPropertySourceTests.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ void simpleMapPropertySourceKeyDataChangeInvalidatesCache() {
163163
EnumerablePropertySource<?> source = new MapPropertySource("test", map);
164164
SpringIterableConfigurationPropertySource adapter = new SpringIterableConfigurationPropertySource(source,
165165
DefaultPropertyMapper.INSTANCE);
166-
assertThat(adapter.stream().count()).isEqualTo(2);
166+
assertThat(adapter.stream()).hasSize(2);
167167
map.put("key3", "value3");
168-
assertThat(adapter.stream().count()).isEqualTo(3);
168+
assertThat(adapter.stream()).hasSize(3);
169169
}
170170

171171
@Test
@@ -177,10 +177,10 @@ void concurrentModificationExceptionInvalidatesCache() {
177177
EnumerablePropertySource<?> source = new MapPropertySource("test", map);
178178
SpringIterableConfigurationPropertySource adapter = new SpringIterableConfigurationPropertySource(source,
179179
DefaultPropertyMapper.INSTANCE);
180-
assertThat(adapter.stream().count()).isEqualTo(2);
180+
assertThat(adapter.stream()).hasSize(2);
181181
map.setThrowException(true);
182182
map.put("key3", "value3");
183-
assertThat(adapter.stream().count()).isEqualTo(3);
183+
assertThat(adapter.stream()).hasSize(3);
184184
}
185185

186186
@Test
@@ -192,9 +192,9 @@ public void originTrackedMapPropertySourceKeyAdditionInvalidatesCache() {
192192
EnumerablePropertySource<?> source = new OriginTrackedMapPropertySource("test", map);
193193
SpringIterableConfigurationPropertySource adapter = new SpringIterableConfigurationPropertySource(source,
194194
DefaultPropertyMapper.INSTANCE);
195-
assertThat(adapter.stream().count()).isEqualTo(2);
195+
assertThat(adapter.stream()).hasSize(2);
196196
map.put("key3", "value3");
197-
assertThat(adapter.stream().count()).isEqualTo(3);
197+
assertThat(adapter.stream()).hasSize(3);
198198
}
199199

200200
@Test
@@ -206,9 +206,9 @@ public void readOnlyOriginTrackedMapPropertySourceKeyAdditionDoesNotInvalidateCa
206206
EnumerablePropertySource<?> source = new OriginTrackedMapPropertySource("test", map, true);
207207
SpringIterableConfigurationPropertySource adapter = new SpringIterableConfigurationPropertySource(source,
208208
DefaultPropertyMapper.INSTANCE);
209-
assertThat(adapter.stream().count()).isEqualTo(2);
209+
assertThat(adapter.stream()).hasSize(2);
210210
map.put("key3", "value3");
211-
assertThat(adapter.stream().count()).isEqualTo(2);
211+
assertThat(adapter.stream()).hasSize(2);
212212
}
213213

214214
/**

0 commit comments

Comments
 (0)