use of io.servicecomb.swagger.invocation.response.producer.ProducerResponseSame in project java-chassis by ServiceComb.
the class TestProducerSchemaFactory method init.
@BeforeClass
public static void init() {
ProducerResponseMapperFactory responseMapperFactory = new ProducerResponseMapperFactory();
responseMapperFactory.setMapperList(Arrays.asList(new ProducerResponseSame()));
ProducerArgumentsMapperFactory producerArgsMapperFactory = new ProducerArgumentsMapperFactory();
MicroserviceMetaManager microserviceMetaManager = new MicroserviceMetaManager();
SchemaLoader schemaLoader = new SchemaLoader() {
@Override
public void putSelfBasePathIfAbsent(String microserviceName, String basePath) {
}
};
CompositeSwaggerGeneratorContext compositeSwaggerGeneratorContext = new CompositeSwaggerGeneratorContext();
ReflectUtils.setField(producerSchemaFactory, "producerArgsMapperFactory", producerArgsMapperFactory);
ReflectUtils.setField(producerSchemaFactory, "responseMapperFactory", responseMapperFactory);
ReflectUtils.setField(producerSchemaFactory, "microserviceMetaManager", microserviceMetaManager);
ReflectUtils.setField(producerSchemaFactory, "schemaLoader", schemaLoader);
ReflectUtils.setField(producerSchemaFactory, "compositeSwaggerGeneratorContext", compositeSwaggerGeneratorContext);
BeanUtils.setContext(Mockito.mock(ApplicationContext.class));
UnitTestMeta.init();
schemaMeta = producerSchemaFactory.getOrCreateProducerSchema("app:ms", "schema", TestProducerSchemaFactoryImpl.class, new TestProducerSchemaFactoryImpl());
}
Aggregations