@Test public void shouldHandleResource() { KubernetesCrudAttributesExtractor extractor = new KubernetesCrudAttributesExtractor(); Pod pod = new PodBuilder().withNewMetadata().withName("mypod").withNamespace("myns").endMetadata().build(); AttributeSet attributes = extractor.extract(pod); AttributeSet expected1 = new AttributeSet(); expected1 = expected1.add(new Attribute("kind", "pod")); expected1 = expected1.add(new Attribute("namespace", "myns")); expected1 = expected1.add(new Attribute("name", "mypod")); assertFalse(attributes.matches(expected1)); AttributeSet expected2 = new AttributeSet(); expected2 = expected2.add(new Attribute("namespace", "myns")); expected2 = expected2.add(new Attribute("name", "mypod")); assertTrue(attributes.matches(expected2)); }
@Override public AttributeSet extract(HasMetadata hasMetadata) { return extractMetadataAttributes(hasMetadata); }
KubernetesCrudAttributesExtractor extends KubernetesAttributesExtractor { @Override public AttributeSet extract(HasMetadata hasMetadata) { return extractMetadataAttributes(hasMetadata); } }
KubernetesCrudAttributesExtractor extends KubernetesAttributesExtractor { @Override public AttributeSet extract(HasMetadata hasMetadata) { return extractMetadataAttributes(hasMetadata); } KubernetesCrudAttributesExtractor();  KubernetesCrudAttributesExtractor(List<CustomResourceDefinitionContext> crdContexts); }
KubernetesCrudAttributesExtractor extends KubernetesAttributesExtractor { @Override public AttributeSet extract(HasMetadata hasMetadata) { return extractMetadataAttributes(hasMetadata); } KubernetesCrudAttributesExtractor();  KubernetesCrudAttributesExtractor(List<CustomResourceDefinitionContext> crdContexts); @Override AttributeSet extract(HasMetadata hasMetadata); }
KubernetesCrudAttributesExtractor extends KubernetesAttributesExtractor { @Override public AttributeSet extract(HasMetadata hasMetadata) { return extractMetadataAttributes(hasMetadata); } KubernetesCrudAttributesExtractor();  KubernetesCrudAttributesExtractor(List<CustomResourceDefinitionContext> crdContexts); @Override AttributeSet extract(HasMetadata hasMetadata);  }