Fix failing CompositePropertySourceTests

Fix CompositePropertySourceTests which fails when run we debug logging.
master
Phillip Webb 10 years ago
parent 84564a0c7b
commit 5ba3db6a7d
  1. 8
      spring-core/src/test/java/org/springframework/core/env/CompositePropertySourceTests.java

@ -20,7 +20,6 @@ import java.util.Collections;
import org.junit.Test;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
/**
@ -39,8 +38,11 @@ public class CompositePropertySourceTests {
composite.addPropertySource(p3);
composite.addPropertySource(p1);
composite.addFirstPropertySource(p1);
assertThat(composite.toString(), containsString("MapPropertySource [name='p1'], "
+ "MapPropertySource [name='p2'], MapPropertySource [name='p3']"));
String s = composite.toString();
int i1 = s.indexOf("name='p1'");
int i2 = s.indexOf("name='p2'");
int i3 = s.indexOf("name='p3'");
assertTrue("Bad order: " + s, ((i1 < i2) && (i2 < i3)));
}
}

Loading…
Cancel
Save