Added test for SpringProperties setFlag method
Issue: SPR-9014 Issue: SPR-11297
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2013 the original author or authors.
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -354,6 +354,13 @@ public class StandardEnvironmentTests {
|
||||
SpringProperties.setProperty("spring.getenv.ignore", null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void suppressGetenvAccessThroughSpringFlag() {
|
||||
SpringProperties.setFlag("spring.getenv.ignore");
|
||||
assertTrue(environment.getSystemEnvironment().isEmpty());
|
||||
SpringProperties.setProperty("spring.getenv.ignore", null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getSystemProperties_withAndWithoutSecurityManager() {
|
||||
System.setProperty(ALLOWED_PROPERTY_NAME, ALLOWED_PROPERTY_VALUE);
|
||||
|
||||
Reference in New Issue
Block a user