public abstract class AbstractHierarchyTest extends Object
Use this test to perform a check of classes and Spring beans hierarchy. Test traverses through whole hierarchy of
both classes and Spring beans and checks if there is only one child per each parent. A class/bean may still have
branched hierarchy, if only it is properly marked with BranchedHierarchy annotation.
BranchedHierarchy| Constructor and Description |
|---|
AbstractHierarchyTest() |
| Modifier and Type | Method and Description |
|---|---|
protected String |
getDefaultTestPackage() |
protected String[] |
getTestPackages() |
protected boolean |
matchesTestPackage(String pkg) |
void |
setUp() |
protected void |
testBeanHierarchy(org.springframework.beans.factory.support.DefaultListableBeanFactory beanDefinitionRegistry,
String beanName,
Map<String,String> checkedHierarchy) |
protected void |
testClassHierarchy(Class<?> clazz,
Map<String,String> checkedHierarchy) |
protected void |
testClassHierarchy(String className,
Map<String,String> checkedHierarchy) |
protected void |
testClassHierarchyDirectly(Class<?> parentClass,
Class<?> clazz,
Map<String,String> checkedHierarchy) |
protected void |
testHierarchy(String parentName,
String childName,
Class<?> parentClass,
Function<BranchedHierarchy,String[]> specificExclusions,
Map<String,String> checkedHierarchy) |
void |
thereShouldBeOnlyOneChildBeanPerParentBean() |
void |
thereShouldBeOnlyOneChildClassPerParentClass() |
public void setUp()
protected String[] getTestPackages()
protected String getDefaultTestPackage()
public void thereShouldBeOnlyOneChildClassPerParentClass()
protected boolean matchesTestPackage(String pkg)
protected void testClassHierarchy(String className, Map<String,String> checkedHierarchy)
protected void testClassHierarchy(Class<?> clazz, Map<String,String> checkedHierarchy)
protected void testClassHierarchyDirectly(Class<?> parentClass, Class<?> clazz, Map<String,String> checkedHierarchy)
protected void testHierarchy(String parentName, String childName, Class<?> parentClass, Function<BranchedHierarchy,String[]> specificExclusions, Map<String,String> checkedHierarchy)
public void thereShouldBeOnlyOneChildBeanPerParentBean()
Copyright © 2018. All rights reserved.