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