ResourceMetrics { public static DeliverabiltyMetricsResponse getDelayReasonMetricsByDomain( IRestConnection conn, String from, String to, String domains, String campaigns, String templates, String timezone, String limit) throws SparkPostException { Endpoint ep = new Endpoint("metrics/deliverability/delay-reason/domain"); ep.addCommonParams(from, to, domains, campaigns, templates, null, timezone, limit, null); Response response = conn.get(ep); DeliverabiltyMetricsResponse newResponse = DeliverabiltyMetricsResponse.decode(response, DeliverabiltyMetricsResponse.class); return newResponse; }  static Response getDiscoverabilityLinks(IRestConnection conn); static DeliverabiltyMetricsResponse getDeliverabilityMetricsSummary(
            IRestConnection conn,
            String from,
            String to,
            String domains,
            String campaigns,
            String templates,
            String metrics,
            String timezone); static DeliverabiltyMetricsResponse getDeliverabilityMetricsByDomain(
            IRestConnection conn,
            String from,
            String to,
            String domains,
            String campaigns,
            String templates,
            String metrics,
            String timezone,
            String limit,
            String orderBy); static DeliverabiltyMetricsResponse getDeliverabilityMetricsByCampaign(
            IRestConnection conn,
            String from,
            String to,
            String domains,
            String campaigns,
            String templates,
            String metrics,
            String timezone,
            String limit,
            String orderBy); static DeliverabiltyMetricsResponse getDeliverabilityMetricsByTemplate(
            IRestConnection conn,
            String from,
            String to,
            String domains,
            String campaigns,
            String templates,
            String metrics,
            String timezone,
            String limit,
            String orderBy); static DeliverabiltyMetricsResponse getDeliverabilityMetricsByWatchedDomain(
            IRestConnection conn,
            String from,
            String to,
            String domains,
            String campaigns,
            String templates,
            String metrics,
            String timezone,
            String limit,
            String orderBy); static DeliverabiltyMetricsResponse getTimeSeriesMetrics(
            IRestConnection conn,
            String from,
            String to,
            String domains,
            String campaigns,
            String templates,
            String precision,
            String metrics,
            String timezone); static DeliverabiltyMetricsResponse getBounceReasonMetrics(
            IRestConnection conn,
            String from,
            String to,
            String domains,
            String campaigns,
            String templates,
            String metrics,
            String timezone,
            String limit); static DeliverabiltyMetricsResponse getBounceReasonMetricsByDomain(
            IRestConnection conn,
            String from,
            String to,
            String domains,
            String campaigns,
            String templates,
            String metrics,
            String timezone,
            String limit); static DeliverabiltyMetricsResponse getBounceClassificationMetrics(
            IRestConnection conn,
            String from,
            String to,
            String domains,
            String campaigns,
            String templates,
            String metrics,
            String timezone,
            String limit); static DeliverabiltyMetricsResponse getRejectionReasonMetrics(
            IRestConnection conn,
            String from,
            String to,
            String domains,
            String campaigns,
            String templates,
            String timezone,
            String limit); static DeliverabiltyMetricsResponse getRejectionReasonMetricsByDomain(
            IRestConnection conn,
            String from,
            String to,
            String domains,
            String campaigns,
            String templates,
            String timezone,
            String limit); static DeliverabiltyMetricsResponse getDelayReasonMetrics(
            IRestConnection conn,
            String from,
            String to,
            String domains,
            String campaigns,
            String templates,
            String timezone,
            String limit); static DeliverabiltyMetricsResponse getDelayReasonMetricsByDomain(
            IRestConnection conn,
            String from,
            String to,
            String domains,
            String campaigns,
            String templates,
            String timezone,
            String limit); static DeliverabiltyMetricsResponse getEngagementDetails(
            IRestConnection conn,
            String from,
            String to,
            String timezone,
            String metrics,
            String campaigns,
            String templates,
            String limit); static DeliverabiltyMetricsResponse getDeliveriesByAttempt(
            IRestConnection conn,
            String from,
            String to,
            String domains,
            String campaigns,
            String templates,
            String timezone); static CampaignListResponse getCampaignsList(IRestConnection conn, String match, String limit); static DomainListResponse getDomainsList(IRestConnection conn, String match, String limit);  }
@Test public void testDelayReasonMetricsByDomain() throws SparkPostException { StubRestConnection conn = buildStubConnection(); String from = "from@domain.com"; String to = "to@domain.com"; String domains = "domains"; String campaigns = "comapigns"; String templates = "templates"; String timezone = "timezone"; String limit = "limit"; Response discoverabilityLinks = ResourceMetrics.getDelayReasonMetricsByDomain(conn, from, to, domains, campaigns, templates, timezone, limit); Assert.assertNotNull(discoverabilityLinks); Assert.assertEquals( conn.getRequestUri(), "/metrics/deliverability/delay-reason/domain?from=from%40domain.com&to=to%40domain.com&domains=domains&campaigns=comapigns&templates=templates&timezone=timezone&limit=limit"); verifyWasGet(conn); }