use of org.apache.servicecomb.core.definition.SchemaMeta in project incubator-servicecomb-java-chassis by apache.
the class SchemaListenerManager method notifySchemaListener.
public void notifySchemaListener(MicroserviceMeta... microserviceMetas) {
List<SchemaMeta> schemaMetaList = new ArrayList<>();
for (MicroserviceMeta microserviceMeta : microserviceMetas) {
schemaMetaList.addAll(microserviceMeta.getSchemaMetas());
}
notifySchemaListener(schemaMetaList.toArray(new SchemaMeta[schemaMetaList.size()]));
}
use of org.apache.servicecomb.core.definition.SchemaMeta in project incubator-servicecomb-java-chassis by apache.
the class MockUtil method mockRequestMeta.
public void mockRequestMeta() {
new MockUp<RequestMeta>() {
@Mock
public OperationMeta getOperationMeta() throws Exception {
OperationMeta om = new OperationMeta();
om.init(new SchemaMeta(null, new MicroserviceMeta("test"), null), this.getClass().getMethods()[0], "path", "get", null);
return om;
}
};
}
use of org.apache.servicecomb.core.definition.SchemaMeta in project incubator-servicecomb-java-chassis by apache.
the class QpsControllerManagerTest method getMockOperationMeta.
public static OperationMeta getMockOperationMeta(String microserviceName, String schemaId, String operationId) {
OperationMeta operationMeta = Mockito.mock(OperationMeta.class);
SchemaMeta schemaMeta = Mockito.mock(SchemaMeta.class);
Mockito.when(operationMeta.getSchemaMeta()).thenReturn(schemaMeta);
Mockito.when(operationMeta.getSchemaQualifiedName()).thenReturn(schemaId + QpsControllerManager.SEPARATOR + operationId);
Mockito.when(operationMeta.getMicroserviceQualifiedName()).thenReturn(microserviceName + QpsControllerManager.SEPARATOR + schemaId + QpsControllerManager.SEPARATOR + operationId);
Mockito.when(operationMeta.getMicroserviceName()).thenReturn(microserviceName);
Mockito.when(schemaMeta.getSchemaId()).thenReturn(schemaId);
return operationMeta;
}
use of org.apache.servicecomb.core.definition.SchemaMeta in project incubator-servicecomb-java-chassis by apache.
the class QpsControllerManagerTest method testMock.
@Test
public void testMock() {
Invocation invocation = getMockInvocation("service", "schema", "oper");
OperationMeta operationMeta = invocation.getOperationMeta();
SchemaMeta schemaMeta = operationMeta.getSchemaMeta();
Assert.assertEquals("service", operationMeta.getMicroserviceName());
Assert.assertEquals("service.schema.oper", operationMeta.getMicroserviceQualifiedName());
Assert.assertEquals("schema.oper", operationMeta.getSchemaQualifiedName());
Assert.assertEquals("schema", schemaMeta.getSchemaId());
}
use of org.apache.servicecomb.core.definition.SchemaMeta in project java-chassis by ServiceComb.
the class TestApiParam method pojoSimple.
@Test
public void pojoSimple() {
SchemaMeta schemaMeta = microserviceMeta.findSchemaMeta("apiParamPojo");
OperationMeta operationMeta = schemaMeta.findOperation("simple");
parameter = operationMeta.getSwaggerOperation().getParameters().get(0);
ModelImpl model = SwaggerUtils.getModelImpl(schemaMeta.getSwagger(), (BodyParameter) parameter);
Assert.assertEquals("desc of simple param", model.getProperties().get("input").getDescription());
}
Aggregations