CanDeleteComponentPolicy implements Policy { public CanDeleteComponentPolicy() { } CanDeleteComponentPolicy(); @Override ExecutionResult execute(PolicyContext context);  }
@Test public void testCanDeleteComponentPolicy() { PolicyContext context = new PolicyContext(); context = new PolicyContext(); context.setProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), mockPrivateComponent); ExecutionResult exResult = policy.execute(context); Assert.assertTrue(exResult.getStatus()); context = new PolicyContext(); context.setProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), mockPrivateComponentWithDifferentOwner); exResult = policy.execute(context); Assert.assertFalse(exResult.getStatus()); MineTaxonomyComponent mockMine = Mockito.mock(MineTaxonomyComponent.class); context = new PolicyContext(); context.setProperty(PolicyContext.PropertyName.TARGET_COMPONENT.getName(), mockMine); exResult = policy.execute(context); Assert.assertFalse(exResult.getStatus()); }