From a8c65401919b1aa8fe617e63feb48f603183c3ff Mon Sep 17 00:00:00 2001 From: contextshuffling Date: Tue, 15 Oct 2019 20:21:11 -0500 Subject: [PATCH] Use LinkedHashSet for deterministic order in test assertion See gh-18612 --- .../boot/actuate/health/CompositeHealthIndicatorTests.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthIndicatorTests.java b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthIndicatorTests.java index 3518d68565..c7ee35a1e1 100644 --- a/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthIndicatorTests.java +++ b/spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/health/CompositeHealthIndicatorTests.java @@ -18,6 +18,7 @@ package org.springframework.boot.actuate.health; import java.util.Collections; import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.Map; import com.fasterxml.jackson.databind.ObjectMapper; @@ -71,7 +72,7 @@ public class CompositeHealthIndicatorTests { @Test public void testSerialization() throws Exception { - Map indicators = new HashMap<>(); + Map indicators = new LinkedHashMap<>(); indicators.put("db1", this.one); indicators.put("db2", this.two); CompositeHealthIndicator innerComposite = new CompositeHealthIndicator(this.healthAggregator, indicators);