use of org.apache.servicecomb.swagger.invocation.schemas.JaxrsAddBodyV1 in project java-chassis by ServiceComb.
the class TestJaxrs method addBody.
@Test
public void addBody() {
SwaggerProducer swaggerProducer = new SwaggerEnvironment().createProducer(new JaxrsAddBodyV1(), null);
ProducerArgumentsMapper mapper = swaggerProducer.findOperation("add").getArgumentsMapper();
AddWrapperV1 addBody = new AddWrapperV1();
Map<String, Object> arguments = new HashMap<>();
arguments.put("addBody", addBody);
SwaggerInvocation invocation = new SwaggerInvocation();
Map<String, Object> result = mapper.swaggerArgumentToInvocationArguments(invocation, arguments);
Assert.assertEquals(1, result.size());
Assert.assertSame(addBody, result.get("addBody"));
}
Aggregations