[bs-22] Add tests for OnResourceCondition

[#48127729] [bs-22] Add missing unit tests
This commit is contained in:
Dave Syer
2013-05-21 09:37:07 +01:00
parent c675d9c76e
commit c6b4c48181
2 changed files with 69 additions and 2 deletions

View File

@@ -47,7 +47,7 @@ class OnResourceCondition implements Condition {
String checking = ConditionLogUtils.getPrefix(logger, metadata);
MultiValueMap<String, Object> attributes = metadata.getAllAnnotationAttributes(
ConditionalOnClass.class.getName(), true);
ConditionalOnResource.class.getName(), true);
if (attributes != null) {
List<String> locations = new ArrayList<String>();
collectValues(locations, attributes.get("resources"));
@@ -59,7 +59,7 @@ class OnResourceCondition implements Condition {
}
if (!this.loader.getResource(location).exists()) {
if (logger.isDebugEnabled()) {
logger.debug(checking + "Found resource: " + location
logger.debug(checking + "Resource not found: " + location
+ " (search terminated with matches=false)");
}
return false;