类 TestPropertySourceAttributes
java.lang.Object
cn.taketoday.test.context.support.TestPropertySourceAttributes
TestPropertySourceAttributes encapsulates attributes declared
via @TestPropertySource annotations.
In addition to encapsulating declared attributes,
TestPropertySourceAttributes also enforces configuration rules.
- 从以下版本开始:
- 4.0
- 作者:
- Sam Brannen, Phillip Webb, Harry Yang
- 另请参阅:
-
字段概要
字段 -
构造器概要
构造器构造器说明TestPropertySourceAttributes(cn.taketoday.core.annotation.MergedAnnotation<TestPropertySource> mergedAnnotation) -
方法概要
修饰符和类型方法说明private voidaddAll(boolean prepend, List<cn.taketoday.core.io.PropertySourceDescriptor> list, List<cn.taketoday.core.io.PropertySourceDescriptor> elements) Add all the supplied elements to the provided list, honoring theprependflag.private voidAdd all the supplied elements to the provided list, honoring theprependflag.private voidaddPropertiesAndLocations(List<cn.taketoday.core.io.PropertySourceDescriptor> descriptors, String[] properties, Class<?> declaringClass, String encoding, boolean prepend) private voidaddPropertiesAndLocationsFrom(cn.taketoday.core.annotation.MergedAnnotation<TestPropertySource> mergedAnnotation, Class<?> declaringClass) private voidassertSameBooleanAttribute(boolean expected, boolean actual, String attributeName, TestPropertySourceAttributes that) private static Class<?>declaringClass(cn.taketoday.core.annotation.MergedAnnotation<?> mergedAnnotation) private StringdetectDefaultPropertiesFile(Class<?> testClass) boolean(专用程序包) Class<?>Get the class that declared@TestPropertySource.(专用程序包) String[]Get the inlined properties that were declared via@TestPropertySource.(专用程序包) List<cn.taketoday.core.io.PropertySourceDescriptor>Get the descriptors for resource locations that were declared via@TestPropertySource.inthashCode()private static booleanhasNoLocations(List<cn.taketoday.core.io.PropertySourceDescriptor> descriptors) Determine if the supplied list contains no descriptor with locations.(专用程序包) booleanisEmpty()(专用程序包) booleanGet theinheritLocationsflag that was declared via@TestPropertySource.(专用程序包) booleanGet theinheritPropertiesflag that was declared via@TestPropertySource.private void(专用程序包) voidmergeWith(TestPropertySourceAttributes attributes) Merge thisTestPropertySourceAttributesinstance with the suppliedTestPropertySourceAttributes, asserting that the two sets of test property source attributes have identical values for theTestPropertySource.inheritLocations()andTestPropertySource.inheritProperties()flags and that the two underlying annotations were declared on the same class.toString()Provide a String representation of the@TestPropertySourceattributes and declaring class.
-
字段详细资料
-
SLASH
- 另请参阅:
-
logger
private static final cn.taketoday.logging.Logger logger -
declaringClass
-
rootAnnotation
private final cn.taketoday.core.annotation.MergedAnnotation<?> rootAnnotation -
descriptors
-
inheritLocations
private final boolean inheritLocations -
properties
-
inheritProperties
private final boolean inheritProperties
-
-
构造器详细资料
-
TestPropertySourceAttributes
TestPropertySourceAttributes(cn.taketoday.core.annotation.MergedAnnotation<TestPropertySource> mergedAnnotation)
-
-
方法详细资料
-
mergeWith
Merge thisTestPropertySourceAttributesinstance with the suppliedTestPropertySourceAttributes, asserting that the two sets of test property source attributes have identical values for theTestPropertySource.inheritLocations()andTestPropertySource.inheritProperties()flags and that the two underlying annotations were declared on the same class. -
assertSameBooleanAttribute
private void assertSameBooleanAttribute(boolean expected, boolean actual, String attributeName, TestPropertySourceAttributes that) -
addPropertiesAndLocationsFrom
private void addPropertiesAndLocationsFrom(cn.taketoday.core.annotation.MergedAnnotation<TestPropertySource> mergedAnnotation, Class<?> declaringClass) -
mergePropertiesAndLocationsFrom
-
addPropertiesAndLocations
-
addAll
private void addAll(boolean prepend, List<cn.taketoday.core.io.PropertySourceDescriptor> list, List<cn.taketoday.core.io.PropertySourceDescriptor> elements) Add all the supplied elements to the provided list, honoring theprependflag.If the
prependflag isfalse, the elements will be appended to the list.- 参数:
prepend- whether the elements should be prepended to the listlist- the list to which to add the elementselements- the elements to add to the list
-
addAll
Add all the supplied elements to the provided list, honoring theprependflag.If the
prependflag isfalse, the elements will be appended to the list.- 参数:
prepend- whether the elements should be prepended to the listlist- the list to which to add the elementselements- the elements to add to the list
-
detectDefaultPropertiesFile
-
getDeclaringClass
Class<?> getDeclaringClass()Get the class that declared@TestPropertySource.- 返回:
- the declaring class; never
null
-
getPropertySourceDescriptors
List<cn.taketoday.core.io.PropertySourceDescriptor> getPropertySourceDescriptors()Get the descriptors for resource locations that were declared via@TestPropertySource.Note: The returned value may represent a detected default or merged locations that do not match the original value declared via a single
@TestPropertySourceannotation.- 返回:
- the resource location descriptors; potentially empty
- 另请参阅:
-
isInheritLocations
boolean isInheritLocations()Get theinheritLocationsflag that was declared via@TestPropertySource.- 返回:
- the
inheritLocationsflag - 另请参阅:
-
getProperties
String[] getProperties()Get the inlined properties that were declared via@TestPropertySource.Note: The returned value may represent merged properties that do not match the original value declared via a single
@TestPropertySourceannotation.- 返回:
- the inlined properties; potentially empty
- 另请参阅:
-
isInheritProperties
boolean isInheritProperties()Get theinheritPropertiesflag that was declared via@TestPropertySource.- 返回:
- the
inheritPropertiesflag - 另请参阅:
-
isEmpty
boolean isEmpty() -
equals
-
hashCode
public int hashCode() -
toString
Provide a String representation of the@TestPropertySourceattributes and declaring class. -
declaringClass
private static Class<?> declaringClass(cn.taketoday.core.annotation.MergedAnnotation<?> mergedAnnotation) -
hasNoLocations
private static boolean hasNoLocations(List<cn.taketoday.core.io.PropertySourceDescriptor> descriptors) Determine if the supplied list contains no descriptor with locations.
-