|
1 | 1 | /* |
2 | | - * Copyright 2002-2013 the original author or authors. |
| 2 | + * Copyright 2002-2014 the original author or authors. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | 5 | * you may not use this file except in compliance with the License. |
@@ -59,15 +59,15 @@ public void merge() { |
59 | 59 | child.setActiveProfiles("c1", "c2"); |
60 | 60 | child.getPropertySources().addLast( |
61 | 61 | new MockPropertySource("childMock") |
62 | | - .withProperty("childKey", "childVal") |
63 | | - .withProperty("bothKey", "childBothVal")); |
| 62 | + .withProperty("childKey", "childVal") |
| 63 | + .withProperty("bothKey", "childBothVal")); |
64 | 64 |
|
65 | 65 | ConfigurableEnvironment parent = new StandardEnvironment(); |
66 | 66 | parent.setActiveProfiles("p1", "p2"); |
67 | 67 | parent.getPropertySources().addLast( |
68 | 68 | new MockPropertySource("parentMock") |
69 | | - .withProperty("parentKey", "parentVal") |
70 | | - .withProperty("bothKey", "parentBothVal")); |
| 69 | + .withProperty("parentKey", "parentVal") |
| 70 | + .withProperty("bothKey", "parentBothVal")); |
71 | 71 |
|
72 | 72 | assertThat(child.getProperty("childKey"), is("childVal")); |
73 | 73 | assertThat(child.getProperty("parentKey"), nullValue()); |
@@ -354,6 +354,13 @@ public void suppressGetenvAccessThroughSpringProperty() { |
354 | 354 | SpringProperties.setProperty("spring.getenv.ignore", null); |
355 | 355 | } |
356 | 356 |
|
| 357 | + @Test |
| 358 | + public void suppressGetenvAccessThroughSpringFlag() { |
| 359 | + SpringProperties.setFlag("spring.getenv.ignore"); |
| 360 | + assertTrue(environment.getSystemEnvironment().isEmpty()); |
| 361 | + SpringProperties.setProperty("spring.getenv.ignore", null); |
| 362 | + } |
| 363 | + |
357 | 364 | @Test |
358 | 365 | public void getSystemProperties_withAndWithoutSecurityManager() { |
359 | 366 | System.setProperty(ALLOWED_PROPERTY_NAME, ALLOWED_PROPERTY_VALUE); |
|
0 commit comments