use of org.apache.servicecomb.provider.pojo.schema.PojoProducerMeta in project incubator-servicecomb-java-chassis by apache.
the class PojoProducerProvider method init.
@Override
public void init() throws Exception {
for (PojoProducerMeta pojoProducerMeta : pojoProducers.getProducers()) {
initPojoProducerMeta(pojoProducerMeta);
Microservice microservice = RegistryUtils.getMicroservice();
try {
producerSchemaFactory.getOrCreateProducerSchema(microservice.getServiceName(), pojoProducerMeta.getSchemaId(), pojoProducerMeta.getInstanceClass(), pojoProducerMeta.getInstance());
} catch (Throwable e) {
throw new IllegalArgumentException("create producer schema failed, class=" + pojoProducerMeta.getInstanceClass().getName(), e);
}
}
}
use of org.apache.servicecomb.provider.pojo.schema.PojoProducerMeta in project incubator-servicecomb-java-chassis by apache.
the class MockUtil method mockAbstractServiceProvider.
public void mockAbstractServiceProvider() {
new MockUp<AbstractProducerProvider>() {
@SuppressWarnings("unchecked")
@Mock
protected <T> T findProviderSchema(OperationMeta operationMeta) {
PojoProducerMeta lPojoSchemaMeta = Mockito.mock(PojoProducerMeta.class);
Mockito.when(lPojoSchemaMeta.getInstance()).thenReturn(lPojoSchemaMeta);
return (T) lPojoSchemaMeta;
}
};
}
Aggregations