use of org.apache.servicecomb.codec.protobuf.internal.converter.model.ProtoSchema in project java-chassis by ServiceComb.
the class TestSchemaMetaCodecRestTemplate method setUp.
@Before
public void setUp() {
ProtobufManager.clear();
new Expectations() {
{
providerMicroserviceMeta.getMicroserviceName();
result = "test";
providerMicroserviceMeta.getExtData(ProtobufManager.EXT_ID);
result = null;
consumerMicroserviceMeta.getMicroserviceName();
result = "test";
consumerMicroserviceMeta.getExtData(ProtobufManager.EXT_ID);
result = null;
}
};
SpringmvcSwaggerGenerator swaggerGenerator = new SpringmvcSwaggerGenerator(ProtoSchema.class);
Swagger swagger = swaggerGenerator.generate();
SwaggerEnvironment swaggerEnvironment = new SwaggerEnvironment();
providerSchemaMeta = new SchemaMeta(providerMicroserviceMeta, "ProtoSchema", swagger);
SwaggerProducer swaggerProducer = swaggerEnvironment.createProducer(new ProtoSchema(), swagger);
for (SwaggerProducerOperation producerOperation : swaggerProducer.getAllOperations()) {
OperationMeta operationMeta = providerSchemaMeta.ensureFindOperation(producerOperation.getOperationId());
operationMeta.setSwaggerProducerOperation(producerOperation);
}
consumerSchemaMeta = new SchemaMeta(consumerMicroserviceMeta, "ProtoSchema", swagger);
}
Aggregations