@Test public void testNonMatchingPath() { Resource matching = Mockito.mock(Resource.class); Mockito.when(matching.getPath()).thenReturn("/conf/sling"); Mockito.when(matching.getResourceType()).thenReturn(CMSConstants.NT_SITE); assertFalse(rea.matches(matching)); }
public boolean matches(Resource resource) { if (StringUtils.isNotBlank(parentType) && !hasParentType(resource)) { return false; } if (StringUtils.isNotBlank(resourceType) && !resourceType.equals(resource.getResourceType())) { return false; } return pathPattern.matcher(resource.getPath()).matches(); }
ResourceEditorAssociation { public boolean matches(Resource resource) { if (StringUtils.isNotBlank(parentType) && !hasParentType(resource)) { return false; } if (StringUtils.isNotBlank(resourceType) && !resourceType.equals(resource.getResourceType())) { return false; } return pathPattern.matcher(resource.getPath()).matches(); } }
ResourceEditorAssociation { public boolean matches(Resource resource) { if (StringUtils.isNotBlank(parentType) && !hasParentType(resource)) { return false; } if (StringUtils.isNotBlank(resourceType) && !resourceType.equals(resource.getResourceType())) { return false; } return pathPattern.matcher(resource.getPath()).matches(); }  }
ResourceEditorAssociation { public boolean matches(Resource resource) { if (StringUtils.isNotBlank(parentType) && !hasParentType(resource)) { return false; } if (StringUtils.isNotBlank(resourceType) && !resourceType.equals(resource.getResourceType())) { return false; } return pathPattern.matcher(resource.getPath()).matches(); }  @Activate void activate(ResourceEditorAssociationConfig config); boolean matches(Resource resource); String getEditor(); @Override String toString(); }
ResourceEditorAssociation { public boolean matches(Resource resource) { if (StringUtils.isNotBlank(parentType) && !hasParentType(resource)) { return false; } if (StringUtils.isNotBlank(resourceType) && !resourceType.equals(resource.getResourceType())) { return false; } return pathPattern.matcher(resource.getPath()).matches(); }  @Activate void activate(ResourceEditorAssociationConfig config); boolean matches(Resource resource); String getEditor(); @Override String toString();  }