use of org.openstack4j.model.identity.v3.Domain in project weblogic-kubernetes-operator by oracle.
the class ServiceHelperTest method createReadListUpdate.
@Test
public void createReadListUpdate() throws Exception {
CallBuilderFactory factory = new CallBuilderFactory(null);
// Domain
Domain dom = new Domain();
V1ObjectMeta metadata = new V1ObjectMeta();
metadata.setResourceVersion("12345");
metadata.setNamespace("tests");
dom.setMetadata(metadata);
DomainSpec spec = new DomainSpec();
spec.setDomainUID("domain-uid");
spec.setDomainName("base_domain");
dom.setSpec(spec);
// Create a new service.
System.out.println("Creating service");
Step s = ServiceHelper.createForServerStep(null);
Engine e = new Engine("ServiceHelperTest");
Packet p = new Packet();
DomainPresenceInfo info = new DomainPresenceInfo(dom);
p.getComponents().put(ProcessingConstants.DOMAIN_COMPONENT_NAME, Component.createFor(info));
p.put(ProcessingConstants.SERVER_NAME, "admin");
p.put(ProcessingConstants.PORT, Integer.valueOf(7001));
Fiber f = e.createFiber();
f.start(s, p, null);
f.get();
// Read the service we just created.
System.out.println("Reading service");
V1Service service = factory.create().readService("domain-uid-admin", "tests");
checkService(service, false);
// Get a list of services.
System.out.println("Listing services");
V1ServiceList serviceList = factory.create().listService("tests");
boolean serviceFound = false;
for (V1Service item : serviceList.getItems()) {
if (item.getMetadata().getName().equals("domain-uid-admin")) {
serviceFound = true;
break;
}
}
Assert.assertTrue("Expected service domain-uid-admin not found in list", serviceFound);
// Add a second selector to this service.
Map<String, String> selector = service.getSpec().getSelector();
selector.put("domain", "domain-uid");
service.getSpec().setSelector(selector);
// TODO: uncomment out when bug calling replace service is fixed.
// System.out.println("Replacing service");
// service = serviceHelper.replace("domain-uid-admin", service);
// checkService(service, true);
}
use of org.openstack4j.model.identity.v3.Domain in project weblogic-kubernetes-operator by oracle.
the class WatchBuilderTest method whenDomainWatchReceivesAddResponse_returnItFromIterator.
@Test
public void whenDomainWatchReceivesAddResponse_returnItFromIterator() throws Exception {
Domain domain = new Domain().withApiVersion(API_VERSION).withKind("Domain").withMetadata(createMetaData("domain1", NAMESPACE));
defineHttpResponse(DOMAIN_RESOURCE, withResponses(createAddedResponse(domain)));
WatchI<Domain> domainWatch = new WatchBuilder().createDomainWatch(NAMESPACE);
assertThat(domainWatch, contains(addEvent(domain)));
}
Aggregations