@ -19,6 +19,7 @@ package org.springframework.cloud.context.named;
@@ -19,6 +19,7 @@ package org.springframework.cloud.context.named;
import java.util.Arrays ;
import java.util.Map ;
import org.assertj.core.api.Assertions ;
import org.junit.Test ;
import org.springframework.context.annotation.AnnotationConfigApplicationContext ;
@ -65,6 +66,13 @@ public class NamedContextFactoryTests {
@@ -65,6 +66,13 @@ public class NamedContextFactoryTests {
AnnotationConfigApplicationContext fooContext = factory . getContext ( "foo" ) ;
AnnotationConfigApplicationContext barContext = factory . getContext ( "bar" ) ;
then ( fooContext . getClassLoader ( ) )
. as ( "foo context classloader does not match parent" )
. isSameAs ( parent . getClassLoader ( ) ) ;
Assertions . assertThat ( fooContext ) . hasFieldOrPropertyWithValue ( "customClassLoader" ,
true ) ;
factory . destroy ( ) ;
then ( fooContext . isActive ( ) ) . as ( "foo context wasn't closed" ) . isFalse ( ) ;