use of org.apache.servicecomb.core.SCBEngine in project java-chassis by ServiceComb.
the class TestHealthBootListener method onBeforeProducerProvider_health_endpoint_disabled.
@Test
public void onBeforeProducerProvider_health_endpoint_disabled() {
ArchaiusUtils.setProperty("servicecomb.health.endpoint.enabled", false);
final HealthBootListener listener = new HealthBootListener();
final List<ProducerMeta> producerMetas = new ArrayList<>();
final BootEvent event = new BootEvent();
final SCBEngine scbEngine = new SCBEngine() {
public final ProducerProviderManager producerProviderManager = new ProducerProviderManager(this) {
@Override
public void addProducerMeta(String schemaId, Object instance) {
producerMetas.add(new ProducerMeta(schemaId, instance));
}
};
@Override
public ProducerProviderManager getProducerProviderManager() {
return producerProviderManager;
}
};
event.setScbEngine(scbEngine);
listener.onBeforeProducerProvider(event);
Assert.assertThat(producerMetas, Matchers.empty());
}
use of org.apache.servicecomb.core.SCBEngine in project java-chassis by ServiceComb.
the class TestInvoker method should_generate_response_meta_for_download.
@Test
public void should_generate_response_meta_for_download() throws NoSuchMethodException {
SCBEngine scbEngine = SCBBootstrap.createSCBEngineForTest().addProducerMeta("download", new DownloadSchema()).run();
PojoConsumerMetaRefresher refresher = new PojoConsumerMetaRefresher(scbEngine.getProducerMicroserviceMeta().getMicroserviceName(), "download", DownloadIntf.class);
Method method = DownloadIntf.class.getMethod("download");
JavaType javaType = refresher.getLatestMeta().ensureFindOperationMeta(method).getResponsesType();
Assert.assertSame(Part.class, javaType.getRawClass());
scbEngine.destroy();
}
Aggregations