1
1
/*
2
- * Copyright 2002-2014 the original author or authors.
2
+ * Copyright 2002-2018 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.
38
38
* @author Chris Beams
39
39
* @author Juergen Hoeller
40
40
*/
41
+ @ SuppressWarnings ("deprecation" )
41
42
public class StandardEnvironmentTests {
42
43
43
44
private static final String ALLOWED_PROPERTY_NAME = "theanswer" ;
@@ -51,7 +52,8 @@ public class StandardEnvironmentTests {
51
52
private static final Object NON_STRING_PROPERTY_NAME = new Object ();
52
53
private static final Object NON_STRING_PROPERTY_VALUE = new Object ();
53
54
54
- private ConfigurableEnvironment environment = new StandardEnvironment ();
55
+ private final ConfigurableEnvironment environment = new StandardEnvironment ();
56
+
55
57
56
58
@ Test
57
59
public void merge () {
@@ -131,12 +133,12 @@ public void setActiveProfiles() {
131
133
132
134
@ Test (expected = IllegalArgumentException .class )
133
135
public void setActiveProfiles_withNullProfileArray () {
134
- environment .setActiveProfiles ((String [])null );
136
+ environment .setActiveProfiles ((String []) null );
135
137
}
136
138
137
139
@ Test (expected = IllegalArgumentException .class )
138
140
public void setActiveProfiles_withNullProfile () {
139
- environment .setActiveProfiles ((String )null );
141
+ environment .setActiveProfiles ((String ) null );
140
142
}
141
143
142
144
@ Test (expected = IllegalArgumentException .class )
@@ -151,12 +153,12 @@ public void setActiveProfiles_withNotOperator() {
151
153
152
154
@ Test (expected = IllegalArgumentException .class )
153
155
public void setDefaultProfiles_withNullProfileArray () {
154
- environment .setDefaultProfiles ((String [])null );
156
+ environment .setDefaultProfiles ((String []) null );
155
157
}
156
158
157
159
@ Test (expected = IllegalArgumentException .class )
158
160
public void setDefaultProfiles_withNullProfile () {
159
- environment .setDefaultProfiles ((String )null );
161
+ environment .setDefaultProfiles ((String ) null );
160
162
}
161
163
162
164
@ Test (expected = IllegalArgumentException .class )
@@ -270,20 +272,19 @@ public void acceptsProfiles_withEmptyArgumentList() {
270
272
271
273
@ Test (expected = IllegalArgumentException .class )
272
274
public void acceptsProfiles_withNullArgumentList () {
273
- environment .acceptsProfiles ((String [])null );
275
+ environment .acceptsProfiles ((String []) null );
274
276
}
275
277
276
278
@ Test (expected = IllegalArgumentException .class )
277
279
public void acceptsProfiles_withNullArgument () {
278
- environment .acceptsProfiles ((String )null );
280
+ environment .acceptsProfiles ((String ) null );
279
281
}
280
282
281
283
@ Test (expected = IllegalArgumentException .class )
282
284
public void acceptsProfiles_withEmptyArgument () {
283
285
environment .acceptsProfiles ("" );
284
286
}
285
287
286
-
287
288
@ Test
288
289
public void acceptsProfiles_activeProfileSetProgrammatically () {
289
290
assertThat (environment .acceptsProfiles ("p1" , "p2" ), is (false ));
@@ -488,6 +489,7 @@ public void checkPermission(Permission perm) {
488
489
getModifiableSystemEnvironment ().remove (DISALLOWED_PROPERTY_NAME );
489
490
}
490
491
492
+
491
493
@ SuppressWarnings ("unchecked" )
492
494
public static Map <String , String > getModifiableSystemEnvironment () {
493
495
// for os x / linux
0 commit comments