use of org.apache.servicecomb.registry.DiscoveryManager in project java-chassis by ServiceComb.
the class TestConsumers method deleteWhenCreateMicroserviceVersion.
@Test
public void deleteWhenCreateMicroserviceVersion() {
new MockUp<DiscoveryManager>() {
@Mock
public Microservice getMicroservice(String microserviceId) {
return null;
}
};
try (LogCollector collector = new LogCollector()) {
appManager.getOrCreateMicroserviceVersionRule(appId, serviceName, versionRule);
Assert.assertEquals(0, microserviceManager.getVersionsByName().size());
Assert.assertThat(collector.getEvents().stream().filter(e -> e.getThrowableInformation() != null).map(e -> e.getThrowableInformation().getThrowable().getMessage()).toArray(), Matchers.hasItemInArray("failed to query by microserviceId '002' from ServiceCenter."));
}
}
use of org.apache.servicecomb.registry.DiscoveryManager in project incubator-servicecomb-java-chassis by apache.
the class TestConsumers method deleteWhenCreateMicroserviceVersion.
@Test
public void deleteWhenCreateMicroserviceVersion() {
new MockUp<DiscoveryManager>() {
@Mock
public Microservice getMicroservice(String microserviceId) {
return null;
}
};
try (LogCollector collector = new LogCollector()) {
appManager.getOrCreateMicroserviceVersionRule(appId, serviceName, versionRule);
Assert.assertEquals(0, microserviceManager.getVersionsByName().size());
Assert.assertThat(collector.getEvents().stream().filter(e -> e.getThrowableInformation() != null).map(e -> e.getThrowableInformation().getThrowable().getMessage()).toArray(), Matchers.hasItemInArray("failed to query by microserviceId '002' from ServiceCenter."));
}
}
Aggregations