@AfterClass
    public static void after() {
        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            throw new Error(e);
        }

        List<RequestMetric> metrics = TestMetrics.getMetrics();
        Assert.assertNotNull(metrics);
        Assert.assertEquals(11, metrics.size());
        RequestMetric metric = metrics.get(1);
        Assert.assertEquals("SimpleEchoTest", metric.getApiOrgId());
        Assert.assertEquals("echo", metric.getApiId());
        Assert.assertEquals("1.0.0", metric.getApiVersion());

        Assert.assertEquals("SimpleEchoTest", metric.getClientOrgId());
        Assert.assertEquals("test", metric.getClientId());
        Assert.assertEquals("1.0.0", metric.getClientVersion());

        Assert.assertEquals("12345", metric.getContractId());

        Assert.assertTrue("Expected the request duration to be at least 0 ms but was " + metric.getRequestDuration(),
                metric.getRequestDuration() >= 0);
        Assert.assertTrue("Expected the API duration to be at least 0 ms but was " + metric.getApiDuration(),
                metric.getApiDuration() >= 0);

        Assert.assertEquals(200, metric.getResponseCode());
        Assert.assertEquals("OK", metric.getResponseMessage());
    }
Make sure the gateway and test echo server are working.

@author eric.wittmann@redhat.com
gateway/test/src/test/java/io/apiman/gateway/test/SimpleEchoTest.java