@Test public void testAddDistributionTarget() throws Exception { registry.addDistributionTarget(target1); Mockito.verify(target1, Mockito.never()).setTemplateProvider(Matchers.<EPPolicyTemplateProvider>any()); registry.registerTemplateProvider(templateProvider); Mockito.verify(target1).setTemplateProvider(templateProvider); registry.addDistributionTarget(target2); Mockito.verify(target2).setTemplateProvider(templateProvider); }
@Override public void addDistributionTarget(final TemplateProviderDistributionTarget<EPPolicyTemplateProvider> templateProviderDistributionTarget) { distributionTargets.add(templateProviderDistributionTarget); if (templateProvider != null) { templateProviderDistributionTarget.setTemplateProvider(templateProvider); } }
EPPolicyTemplateProviderRegistryImpl implements EPPolicyTemplateProviderRegistry { @Override public void addDistributionTarget(final TemplateProviderDistributionTarget<EPPolicyTemplateProvider> templateProviderDistributionTarget) { distributionTargets.add(templateProviderDistributionTarget); if (templateProvider != null) { templateProviderDistributionTarget.setTemplateProvider(templateProvider); } } }
EPPolicyTemplateProviderRegistryImpl implements EPPolicyTemplateProviderRegistry { @Override public void addDistributionTarget(final TemplateProviderDistributionTarget<EPPolicyTemplateProvider> templateProviderDistributionTarget) { distributionTargets.add(templateProviderDistributionTarget); if (templateProvider != null) { templateProviderDistributionTarget.setTemplateProvider(templateProvider); } }  }
EPPolicyTemplateProviderRegistryImpl implements EPPolicyTemplateProviderRegistry { @Override public void addDistributionTarget(final TemplateProviderDistributionTarget<EPPolicyTemplateProvider> templateProviderDistributionTarget) { distributionTargets.add(templateProviderDistributionTarget); if (templateProvider != null) { templateProviderDistributionTarget.setTemplateProvider(templateProvider); } }  @Override ObjectRegistration<EPPolicyTemplateProvider> registerTemplateProvider(final EPPolicyTemplateProvider templateProvider); @Override void addDistributionTarget(final TemplateProviderDistributionTarget<EPPolicyTemplateProvider> templateProviderDistributionTarget); @Override void close(); }
EPPolicyTemplateProviderRegistryImpl implements EPPolicyTemplateProviderRegistry { @Override public void addDistributionTarget(final TemplateProviderDistributionTarget<EPPolicyTemplateProvider> templateProviderDistributionTarget) { distributionTargets.add(templateProviderDistributionTarget); if (templateProvider != null) { templateProviderDistributionTarget.setTemplateProvider(templateProvider); } }  @Override ObjectRegistration<EPPolicyTemplateProvider> registerTemplateProvider(final EPPolicyTemplateProvider templateProvider); @Override void addDistributionTarget(final TemplateProviderDistributionTarget<EPPolicyTemplateProvider> templateProviderDistributionTarget); @Override void close();  }