@@ -54,7 +54,7 @@ public abstract class AbstractApplicationContextRunnerTests<T extends AbstractAp
54
54
public void runWithSystemPropertiesShouldSetAndRemoveProperties () {
55
55
String key = "test." + UUID .randomUUID ().toString ();
56
56
assertThat (System .getProperties ().containsKey (key )).isFalse ();
57
- get ().withSystemProperties (key + "=value" ).run ((loaded ) -> {
57
+ get ().withSystemProperties (key + "=value" ).run ((context ) -> {
58
58
assertThat (System .getProperties ()).containsEntry (key , "value" );
59
59
});
60
60
assertThat (System .getProperties ().containsKey (key )).isFalse ();
@@ -66,8 +66,8 @@ public void runWithSystemPropertiesWhenContextFailsShouldRemoveProperties()
66
66
String key = "test." + UUID .randomUUID ().toString ();
67
67
assertThat (System .getProperties ().containsKey (key )).isFalse ();
68
68
get ().withSystemProperties (key + "=value" )
69
- .withUserConfiguration (FailingConfig .class ).run ((loaded ) -> {
70
- assertThat (loaded ).hasFailed ();
69
+ .withUserConfiguration (FailingConfig .class ).run ((context ) -> {
70
+ assertThat (context ).hasFailed ();
71
71
});
72
72
assertThat (System .getProperties ().containsKey (key )).isFalse ();
73
73
}
@@ -79,7 +79,7 @@ public void runWithSystemPropertiesShouldRestoreOriginalProperties()
79
79
System .setProperty (key , "value" );
80
80
try {
81
81
assertThat (System .getProperties ().getProperty (key )).isEqualTo ("value" );
82
- get ().withSystemProperties (key + "=newValue" ).run ((loaded ) -> {
82
+ get ().withSystemProperties (key + "=newValue" ).run ((context ) -> {
83
83
assertThat (System .getProperties ()).containsEntry (key , "newValue" );
84
84
});
85
85
assertThat (System .getProperties ().getProperty (key )).isEqualTo ("value" );
@@ -96,7 +96,7 @@ public void runWithSystemPropertiesWhenValueIsNullShouldRemoveProperty()
96
96
System .setProperty (key , "value" );
97
97
try {
98
98
assertThat (System .getProperties ().getProperty (key )).isEqualTo ("value" );
99
- get ().withSystemProperties (key + "=" ).run ((loaded ) -> {
99
+ get ().withSystemProperties (key + "=" ).run ((context ) -> {
100
100
assertThat (System .getProperties ()).doesNotContainKey (key );
101
101
});
102
102
assertThat (System .getProperties ().getProperty (key )).isEqualTo ("value" );
@@ -109,8 +109,8 @@ public void runWithSystemPropertiesWhenValueIsNullShouldRemoveProperty()
109
109
@ Test
110
110
public void runWithMultiplePropertyValuesShouldAllAllValues () throws Exception {
111
111
get ().withPropertyValues ("test.foo=1" ).withPropertyValues ("test.bar=2" )
112
- .run ((loaded ) -> {
113
- Environment environment = loaded .getEnvironment ();
112
+ .run ((context ) -> {
113
+ Environment environment = context .getEnvironment ();
114
114
assertThat (environment .getProperty ("test.foo" )).isEqualTo ("1" );
115
115
assertThat (environment .getProperty ("test.bar" )).isEqualTo ("2" );
116
116
});
@@ -120,40 +120,40 @@ public void runWithMultiplePropertyValuesShouldAllAllValues() throws Exception {
120
120
public void runWithPropertyValuesWhenHasExistingShouldReplaceValue ()
121
121
throws Exception {
122
122
get ().withPropertyValues ("test.foo=1" ).withPropertyValues ("test.foo=2" )
123
- .run ((loaded ) -> {
124
- Environment environment = loaded .getEnvironment ();
123
+ .run ((context ) -> {
124
+ Environment environment = context .getEnvironment ();
125
125
assertThat (environment .getProperty ("test.foo" )).isEqualTo ("2" );
126
126
});
127
127
}
128
128
129
129
@ Test
130
130
public void runWithConfigurationsShouldRegisterConfigurations () throws Exception {
131
131
get ().withUserConfiguration (FooConfig .class )
132
- .run ((loaded ) -> assertThat (loaded ).hasBean ("foo" ));
132
+ .run ((context ) -> assertThat (context ).hasBean ("foo" ));
133
133
}
134
134
135
135
@ Test
136
136
public void runWithMultipleConfigurationsShouldRegisterAllConfigurations ()
137
137
throws Exception {
138
138
get ().withUserConfiguration (FooConfig .class )
139
139
.withConfiguration (UserConfigurations .of (BarConfig .class ))
140
- .run ((loaded ) -> assertThat (loaded ).hasBean ("foo" ).hasBean ("bar" ));
140
+ .run ((context ) -> assertThat (context ).hasBean ("foo" ).hasBean ("bar" ));
141
141
}
142
142
143
143
@ Test
144
144
public void runWithFailedContextShouldReturnFailedAssertableContext ()
145
145
throws Exception {
146
146
get ().withUserConfiguration (FailingConfig .class )
147
- .run ((loaded ) -> assertThat (loaded ).hasFailed ());
147
+ .run ((context ) -> assertThat (context ).hasFailed ());
148
148
}
149
149
150
150
@ Test
151
151
public void runWithClassLoaderShouldSetClassLoader () throws Exception {
152
152
get ().withClassLoader (
153
153
new HidePackagesClassLoader (Gson .class .getPackage ().getName ()))
154
- .run ((loaded ) -> {
154
+ .run ((context ) -> {
155
155
try {
156
- ClassUtils .forName (Gson .class .getName (), loaded .getClassLoader ());
156
+ ClassUtils .forName (Gson .class .getName (), context .getClassLoader ());
157
157
fail ("Should have thrown a ClassNotFoundException" );
158
158
}
159
159
catch (ClassNotFoundException e ) {
0 commit comments