@Test public void updateAnnotationRule() { final String key1 = "key1", key2 = "key2"; final String value1 = "value1", value2 = "value2"; Map<String, String> annotation = new HashMap<>(); annotation.put(key1, value1); cfg.annotation(annotation); configEvent(NetworkConfigEvent.Type.CONFIG_ADDED); assertAfter(EVENT_MS, () -> { assertTrue(provider.rules().getSuppressedAnnotation().containsKey(key1)); assertEquals(value1, provider.rules().getSuppressedAnnotation().get(key1)); assertFalse(provider.rules().getSuppressedAnnotation().containsKey(key2)); }); annotation.put(key2, value2); cfg.annotation(annotation); configEvent(NetworkConfigEvent.Type.CONFIG_UPDATED); assertAfter(EVENT_MS, () -> { assertTrue(provider.rules().getSuppressedAnnotation().containsKey(key1)); assertEquals(value1, provider.rules().getSuppressedAnnotation().get(key1)); assertTrue(provider.rules().getSuppressedAnnotation().containsKey(key2)); assertEquals(value2, provider.rules().getSuppressedAnnotation().get(key2)); }); }
protected SuppressionRules rules() { return rules; }
LldpLinkProvider extends AbstractProvider implements ProbedLinkProvider { protected SuppressionRules rules() { return rules; } }
LldpLinkProvider extends AbstractProvider implements ProbedLinkProvider { protected SuppressionRules rules() { return rules; } LldpLinkProvider(); }
LldpLinkProvider extends AbstractProvider implements ProbedLinkProvider { protected SuppressionRules rules() { return rules; } LldpLinkProvider(); @Activate void activate(ComponentContext context); @Deactivate void deactivate(); @Modified void modified(ComponentContext context); }
LldpLinkProvider extends AbstractProvider implements ProbedLinkProvider { protected SuppressionRules rules() { return rules; } LldpLinkProvider(); @Activate void activate(ComponentContext context); @Deactivate void deactivate(); @Modified void modified(ComponentContext context); static final String NO_LLDP; static final String CONFIG_KEY; static final String FEATURE_NAME; }