use of org.jboss.tools.openshift.core.odo.OperatorCRDSpecDescriptor in project jbosstools-openshift by jbosstools.
the class ServiceTemplateTest method verifyThatServiceTemplatesReturnsCRDInfo.
@Test
public void verifyThatServiceTemplatesReturnsCRDInfo() throws IOException {
List<ServiceTemplate> serviceTemplates = MAPPER.readValue(url, new TypeReference<List<ServiceTemplate>>() {
});
Assert.assertNotNull(serviceTemplates);
Assert.assertEquals(1, serviceTemplates.size());
ServiceTemplate serviceTemplate = serviceTemplates.get(0);
Assert.assertNotNull(serviceTemplate);
Assert.assertEquals("strimzi-cluster-operator.v0.25.0", serviceTemplate.getName());
assertTrue(serviceTemplate instanceof ServiceTemplate);
ServiceTemplate operatorServiceTemplate = (ServiceTemplate) serviceTemplate;
assertNotNull(operatorServiceTemplate.getCRDs());
assertEquals(9, operatorServiceTemplate.getCRDs().size());
OperatorCRD crd = operatorServiceTemplate.getCRDs().get(0);
assertEquals("kafkas.kafka.strimzi.io", crd.getName());
assertEquals("v1beta2", crd.getVersion());
assertEquals("Kafka", crd.getKind());
assertEquals("Kafka", crd.getDisplayName());
assertEquals("Represents a Kafka cluster", crd.getDescription());
assertNotNull(crd.getSample());
assertNull(crd.getSchema());
assertNotNull(crd.getSpecDescriptors());
assertEquals(7, crd.getSpecDescriptors().size());
OperatorCRDSpecDescriptor descriptor = crd.getSpecDescriptors().get(0);
assertEquals("kafka.version", descriptor.getPath());
assertEquals("Version", descriptor.getDisplayName());
assertEquals("Kafka version", descriptor.getDescription());
assertEquals(1, descriptor.getDescriptors().size());
assertEquals("urn:alm:descriptor:com.tectonic.ui:text", descriptor.getDescriptors().get(0));
}
Aggregations