Skip to content

Commit a8c6540

Browse files
contextshufflingsnicoll
authored andcommitted
Use LinkedHashSet for deterministic order in test assertion
See gh-18612
1 parent 00d4b44 commit a8c6540

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthIndicatorTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
import java.util.Collections;
2020
import java.util.HashMap;
21+
import java.util.LinkedHashMap;
2122
import java.util.Map;
2223

2324
import com.fasterxml.jackson.databind.ObjectMapper;
@@ -71,7 +72,7 @@ public void createWithIndicators() {
7172

7273
@Test
7374
public void testSerialization() throws Exception {
74-
Map<String, HealthIndicator> indicators = new HashMap<>();
75+
Map<String, HealthIndicator> indicators = new LinkedHashMap<>();
7576
indicators.put("db1", this.one);
7677
indicators.put("db2", this.two);
7778
CompositeHealthIndicator innerComposite = new CompositeHealthIndicator(this.healthAggregator, indicators);

0 commit comments

Comments
 (0)