ResourceMetrics { public static CampaignListResponse getCampaignsList(IRestConnection conn, String match, String limit) throws SparkPostException { Endpoint ep = new Endpoint("metrics/campaigns"); ep.addParam("match", match); ep.addParam("limit", limit); Response response = conn.get(ep); CampaignListResponse newResponse = CampaignListResponse.decode(response, CampaignListResponse.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 testCampaignsList() throws SparkPostException { StubRestConnection conn = buildStubConnection(); String match = "match"; String limit = "limit"; Response discoverabilityLinks = ResourceMetrics.getCampaignsList(conn, match, limit); Assert.assertNotNull(discoverabilityLinks); Assert.assertEquals(conn.getRequestUri(), "/metrics/campaigns?match=match&limit=limit"); verifyWasGet(conn); }