/** Tests building a report query using a copy constructor. */ @Test public void testBuildWithCopyConstructor() { ReportQueryInterface.BuilderInterface oldBuilder = new ReportQuery.Builder() .fields("CampaignId", "CampaignName") .from(ReportDefinitionReportType.CAMPAIGN_PERFORMANCE_REPORT) .where("CampaignStatus").notEqualTo("ENABLED") .during(new LocalDate(2017, 1, 1), new LocalDate(2017, 1, 31)); ReportQueryInterface expectedReportQuery = oldBuilder.build(); ReportQueryInterface newReportQuery = new ReportQuery.Builder(oldBuilder).build(); assertEquals(expectedReportQuery, newReportQuery); checkUtilitiesState(); }
/** Tests building a report query using a copy constructor. */ @Test public void testBuildWithCopyConstructor() { ReportQueryInterface.BuilderInterface oldBuilder = new ReportQuery.Builder() .fields("CampaignId", "CampaignName") .from(ReportDefinitionReportType.CAMPAIGN_PERFORMANCE_REPORT) .where("CampaignStatus").notEqualTo("ENABLED") .during(new LocalDate(2017, 1, 1), new LocalDate(2017, 1, 31)); ReportQueryInterface expectedReportQuery = oldBuilder.build(); ReportQueryInterface newReportQuery = new ReportQuery.Builder(oldBuilder).build(); assertEquals(expectedReportQuery, newReportQuery); checkUtilitiesState(); }
/** Tests building a report query using a copy constructor. */ @Test public void testBuildWithCopyConstructor() { ReportQueryInterface.BuilderInterface oldBuilder = new ReportQuery.Builder() .fields("CampaignId", "CampaignName") .from(ReportDefinitionReportType.CAMPAIGN_PERFORMANCE_REPORT) .where("CampaignStatus").notEqualTo("ENABLED") .during(new LocalDate(2017, 1, 1), new LocalDate(2017, 1, 31)); ReportQueryInterface expectedReportQuery = oldBuilder.build(); ReportQueryInterface newReportQuery = new ReportQuery.Builder(oldBuilder).build(); assertEquals(expectedReportQuery, newReportQuery); checkUtilitiesState(); }
@Override public Builder fields(Iterable<String> fields) { proxy.fields(fields); return this; }
@Override public Builder fields(String... fields) { proxy.fields(fields); return this; }
@Override public Builder during(LocalDate startDate, LocalDate endDate) { proxy.during(startDate, endDate); return this; }
@Override public ReportQuery build() { return (ReportQuery) proxy.build(); } }
@Override public Builder from(Enum<?> reportType) { proxy.from(reportType); return this; }
@Override public Builder fields(Iterable<String> fields) { proxy.fields(fields); return this; }
@Override public Builder fields(Iterable<String> fields) { proxy.fields(fields); return this; }
@Override public Builder during(LocalDate startDate, LocalDate endDate) { proxy.during(startDate, endDate); return this; }
@Override public Builder during(LocalDate startDate, LocalDate endDate) { proxy.during(startDate, endDate); return this; }
@Override public Builder from(String reportType) { proxy.from(reportType); return this; }
@Override @SuppressWarnings("unchecked") public ReportWhereBuilderInterface<Builder> where(String field) { return (ReportWhereBuilderInterface<Builder>) proxy.where(field); }
@Override public ReportQuery build() { return (ReportQuery) proxy.build(); } }
@Override public Builder from(String reportType) { proxy.from(reportType); return this; }
@Override public Builder from(Enum<?> reportType) { proxy.from(reportType); return this; }
@Override @SuppressWarnings("unchecked") public ReportWhereBuilderInterface<Builder> where(String field) { return (ReportWhereBuilderInterface<Builder>) proxy.where(field); }
@Override public Builder fields(String... fields) { proxy.fields(fields); return this; }
@Override public Builder during(LocalDate startDate, LocalDate endDate) { proxy.during(startDate, endDate); return this; }