use of org.kie.server.services.api.SupportedTransports in project droolsjbpm-integration by kiegroup.
the class AbstractKieServerImplTest method testHealthCheckFailedExtension.
@Test
public void testHealthCheckFailedExtension() {
extensions.add(new KieServerExtension() {
@Override
public List<Message> healthCheck(boolean report) {
List<Message> messages = KieServerExtension.super.healthCheck(report);
messages.add(new Message(Severity.ERROR, "TEST extension is unhealthy"));
return messages;
}
@Override
public void updateContainer(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters) {
}
@Override
public boolean isUpdateContainerAllowed(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters) {
return false;
}
@Override
public boolean isInitialized() {
return true;
}
@Override
public boolean isActive() {
return true;
}
@Override
public void init(KieServerImpl kieServer, KieServerRegistry registry) {
}
@Override
public Integer getStartOrder() {
return 10;
}
@Override
public List<Object> getServices() {
return null;
}
@Override
public String getImplementedCapability() {
return "TEST";
}
@Override
public String getExtensionName() {
return "TEST";
}
@Override
public <T> T getAppComponents(Class<T> serviceType) {
return null;
}
@Override
public List<Object> getAppComponents(SupportedTransports type) {
return null;
}
@Override
public void disposeContainer(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters) {
}
@Override
public void destroy(KieServerImpl kieServer, KieServerRegistry registry) {
}
@Override
public void createContainer(String id, KieContainerInstance kieContainerInstance, Map<String, Object> parameters) {
}
});
kieServer.init();
List<Message> healthMessages = kieServer.healthCheck(false);
assertEquals(healthMessages.size(), 1);
Message failedContainer = healthMessages.get(0);
assertEquals(Severity.ERROR, failedContainer.getSeverity());
assertEquals(1, failedContainer.getMessages().size());
assertEquals("TEST extension is unhealthy", failedContainer.getMessages().iterator().next());
}
Aggregations