Search in sources :

Example 1 with TestPathSchema

use of org.apache.servicecomb.common.rest.locator.TestPathSchema in project java-chassis by ServiceComb.

the class TestRestProducerInvocation method classSetup.

@BeforeClass
public static void classSetup() {
    ConfigUtil.installDynamicConfig();
    scbEngine = SCBBootstrap.createSCBEngineForTest().addProducerMeta("sid1", new TestPathSchema()).run();
    operationMeta = scbEngine.getProducerMicroserviceMeta().operationMetas().get("test.sid1.dynamicId");
    restOperationMeta = RestMetaUtils.getRestOperationMeta(operationMeta);
    microserviceMeta = operationMeta.getMicroserviceMeta();
}
Also used : TestPathSchema(org.apache.servicecomb.common.rest.locator.TestPathSchema) BeforeClass(org.junit.BeforeClass)

Example 2 with TestPathSchema

use of org.apache.servicecomb.common.rest.locator.TestPathSchema in project java-chassis by ServiceComb.

the class TestAbstractRestInvocation method setup.

@Before
public void setup() {
    ConfigUtil.installDynamicConfig();
    scbEngine = SCBBootstrap.createSCBEngineForTest().addProducerMeta("sid1", new TestPathSchema()).run();
    operationMeta = scbEngine.getProducerMicroserviceMeta().operationMetas().get("test.sid1.dynamicId");
    restOperation = RestMetaUtils.getRestOperationMeta(operationMeta);
    new MockUp<System>() {

        @Mock
        long nanoTime() {
            return nanoTime;
        }
    };
    if (responseEx == null) {
        responseEx = new StandardHttpServletResponseEx(servletResponse);
    }
    invocation = new Invocation(endpoint, operationMeta, operationMeta.buildBaseConsumerRuntimeType(), arguments);
    initRestInvocation();
    List<HttpServerFilter> httpServerFilters = SPIServiceUtils.getSortedService(HttpServerFilter.class);
    restInvocation.setHttpServerFilters(httpServerFilters);
}
Also used : HttpServerFilter(org.apache.servicecomb.common.rest.filter.HttpServerFilter) Invocation(org.apache.servicecomb.core.Invocation) TestPathSchema(org.apache.servicecomb.common.rest.locator.TestPathSchema) StandardHttpServletResponseEx(org.apache.servicecomb.foundation.vertx.http.StandardHttpServletResponseEx) MockUp(mockit.MockUp) Before(org.junit.Before)

Example 3 with TestPathSchema

use of org.apache.servicecomb.common.rest.locator.TestPathSchema in project java-chassis by ServiceComb.

the class TestRestEngineSchemaListener method setup.

@BeforeClass
public static void setup() {
    ConfigUtil.installDynamicConfig();
    scbEngine = SCBBootstrap.createSCBEngineForTest().addProducerMeta("sid1", new TestPathSchema()).run();
    spm = ServicePathManager.getServicePathManager(scbEngine.getProducerMicroserviceMeta());
}
Also used : TestPathSchema(org.apache.servicecomb.common.rest.locator.TestPathSchema) BeforeClass(org.junit.BeforeClass)

Aggregations

TestPathSchema (org.apache.servicecomb.common.rest.locator.TestPathSchema)3 BeforeClass (org.junit.BeforeClass)2 MockUp (mockit.MockUp)1 HttpServerFilter (org.apache.servicecomb.common.rest.filter.HttpServerFilter)1 Invocation (org.apache.servicecomb.core.Invocation)1 StandardHttpServletResponseEx (org.apache.servicecomb.foundation.vertx.http.StandardHttpServletResponseEx)1 Before (org.junit.Before)1