@Test
public void testPostDomainMetricsNoMetrics() {

    SignedDomain signedDomain = createSignedDomain("coretech", "weather", "storage", false);
    store.processDomain(signedDomain, false);
    Principal principal = SimplePrincipal.create("user_domain", "user",
            "v=U1;d=user_domain;n=user;s=signature", 0, null);
    ResourceContext context = createResourceContext(principal);
    // create zts with a metric we can verify
    CloudStore cloudStore = new CloudStore();
    cloudStore.setHttpClient(null);
    ZtsMetricTester metric = new ZtsMetricTester();
    ZTSImpl ztsImpl = new ZTSImpl(cloudStore, store);
    ZTSImpl.serverHostName = "localhost";
    ztsImpl.metric = metric;
    String testDomain = "coretech";
    // create some metrics
    List<DomainMetric> metricList = new ArrayList<>();
    DomainMetrics req = new DomainMetrics().
            setDomainName(testDomain).
            setMetricList(metricList);
    // send the metrics
    try {
        ztsImpl.postDomainMetrics(context, testDomain, req);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 400);
    }
    // metrics with invalid null type
    metricList.add(new DomainMetric().setMetricType(null).setMetricVal(-1));
    try {
        ztsImpl.postDomainMetrics(context, testDomain, req);
        fail();
    } catch (ResourceException ex) {
        assertEquals(ex.getCode(), 400);
    }
}