[SPR-7960] Renamed resolveActivatedProfiles() to resolveActiveProfiles().
This commit is contained in:
parent
f64344b296
commit
3a2afde41d
|
|
@ -212,12 +212,12 @@ abstract class ContextLoaderUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Document resolveActivatedProfiles().
|
* TODO Document resolveActiveProfiles().
|
||||||
*
|
*
|
||||||
* @param clazz
|
* @param clazz
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
static String[] resolveActivatedProfiles(Class<?> clazz) {
|
static String[] resolveActiveProfiles(Class<?> clazz) {
|
||||||
Assert.notNull(clazz, "Class must not be null");
|
Assert.notNull(clazz, "Class must not be null");
|
||||||
|
|
||||||
Class<ActivateProfiles> annotationType = ActivateProfiles.class;
|
Class<ActivateProfiles> annotationType = ActivateProfiles.class;
|
||||||
|
|
|
||||||
|
|
@ -34,29 +34,29 @@ import org.junit.Test;
|
||||||
public class ContextLoaderUtilsTests {
|
public class ContextLoaderUtilsTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void resolveActivatedProfilesWithoutAnnotation() {
|
public void resolveActiveProfilesWithoutAnnotation() {
|
||||||
String[] profiles = ContextLoaderUtils.resolveActivatedProfiles(Enigma.class);
|
String[] profiles = ContextLoaderUtils.resolveActiveProfiles(Enigma.class);
|
||||||
assertNotNull(profiles);
|
assertNotNull(profiles);
|
||||||
assertEquals(0, profiles.length);
|
assertEquals(0, profiles.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void resolveActivatedProfilesWithNoProfilesDeclared() {
|
public void resolveActiveProfilesWithNoProfilesDeclared() {
|
||||||
String[] profiles = ContextLoaderUtils.resolveActivatedProfiles(NoProfilesDeclared.class);
|
String[] profiles = ContextLoaderUtils.resolveActiveProfiles(NoProfilesDeclared.class);
|
||||||
assertNotNull(profiles);
|
assertNotNull(profiles);
|
||||||
assertEquals(0, profiles.length);
|
assertEquals(0, profiles.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void resolveActivatedProfilesWithEmptyProfiles() {
|
public void resolveActiveProfilesWithEmptyProfiles() {
|
||||||
String[] profiles = ContextLoaderUtils.resolveActivatedProfiles(EmptyProfiles.class);
|
String[] profiles = ContextLoaderUtils.resolveActiveProfiles(EmptyProfiles.class);
|
||||||
assertNotNull(profiles);
|
assertNotNull(profiles);
|
||||||
assertEquals(0, profiles.length);
|
assertEquals(0, profiles.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void resolveActivatedProfilesWithDuplicatedProfiles() {
|
public void resolveActiveProfilesWithDuplicatedProfiles() {
|
||||||
String[] profiles = ContextLoaderUtils.resolveActivatedProfiles(DuplicatedProfiles.class);
|
String[] profiles = ContextLoaderUtils.resolveActiveProfiles(DuplicatedProfiles.class);
|
||||||
assertNotNull(profiles);
|
assertNotNull(profiles);
|
||||||
assertEquals(3, profiles.length);
|
assertEquals(3, profiles.length);
|
||||||
|
|
||||||
|
|
@ -67,24 +67,24 @@ public class ContextLoaderUtilsTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void resolveActivatedProfilesWithLocalAnnotation() {
|
public void resolveActiveProfilesWithLocalAnnotation() {
|
||||||
String[] profiles = ContextLoaderUtils.resolveActivatedProfiles(Foo.class);
|
String[] profiles = ContextLoaderUtils.resolveActiveProfiles(Foo.class);
|
||||||
assertNotNull(profiles);
|
assertNotNull(profiles);
|
||||||
assertEquals(1, profiles.length);
|
assertEquals(1, profiles.length);
|
||||||
assertEquals("foo", profiles[0]);
|
assertEquals("foo", profiles[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void resolveActivatedProfilesWithInheritedAnnotation() {
|
public void resolveActiveProfilesWithInheritedAnnotation() {
|
||||||
String[] profiles = ContextLoaderUtils.resolveActivatedProfiles(InheritedFoo.class);
|
String[] profiles = ContextLoaderUtils.resolveActiveProfiles(InheritedFoo.class);
|
||||||
assertNotNull(profiles);
|
assertNotNull(profiles);
|
||||||
assertEquals(1, profiles.length);
|
assertEquals(1, profiles.length);
|
||||||
assertEquals("foo", profiles[0]);
|
assertEquals("foo", profiles[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void resolveActivatedProfilesWithLocalAndInheritedAnnotations() {
|
public void resolveActiveProfilesWithLocalAndInheritedAnnotations() {
|
||||||
String[] profiles = ContextLoaderUtils.resolveActivatedProfiles(Bar.class);
|
String[] profiles = ContextLoaderUtils.resolveActiveProfiles(Bar.class);
|
||||||
assertNotNull(profiles);
|
assertNotNull(profiles);
|
||||||
assertEquals(2, profiles.length);
|
assertEquals(2, profiles.length);
|
||||||
|
|
||||||
|
|
@ -94,8 +94,8 @@ public class ContextLoaderUtilsTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void resolveActivatedProfilesWithOverriddenAnnotation() {
|
public void resolveActiveProfilesWithOverriddenAnnotation() {
|
||||||
String[] profiles = ContextLoaderUtils.resolveActivatedProfiles(Animals.class);
|
String[] profiles = ContextLoaderUtils.resolveActiveProfiles(Animals.class);
|
||||||
assertNotNull(profiles);
|
assertNotNull(profiles);
|
||||||
assertEquals(2, profiles.length);
|
assertEquals(2, profiles.length);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue