@Test public void deleteReportOptionShouldNotAllowNullOptionId() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Option id should not be null"); restApiUnderTest.deleteReportOption("any_id", null); }
public void deleteReportOption( @Nullable String reportUnitUri, @Nullable String optionId) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(reportUnitUri) .addPath("options") .addPath(optionId) .build() .resolve(mNetworkClient.getBaseUrl()); Request request = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .delete() .url(url) .build(); mNetworkClient.makeCall(request); }
ReportOptionRestApi { public void deleteReportOption( @Nullable String reportUnitUri, @Nullable String optionId) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(reportUnitUri) .addPath("options") .addPath(optionId) .build() .resolve(mNetworkClient.getBaseUrl()); Request request = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .delete() .url(url) .build(); mNetworkClient.makeCall(request); } }
ReportOptionRestApi { public void deleteReportOption( @Nullable String reportUnitUri, @Nullable String optionId) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(reportUnitUri) .addPath("options") .addPath(optionId) .build() .resolve(mNetworkClient.getBaseUrl()); Request request = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .delete() .url(url) .build(); mNetworkClient.makeCall(request); } ReportOptionRestApi(NetworkClient networkClient); }
ReportOptionRestApi { public void deleteReportOption( @Nullable String reportUnitUri, @Nullable String optionId) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(reportUnitUri) .addPath("options") .addPath(optionId) .build() .resolve(mNetworkClient.getBaseUrl()); Request request = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .delete() .url(url) .build(); mNetworkClient.makeCall(request); } ReportOptionRestApi(NetworkClient networkClient); @NotNull Set<ReportOptionEntity> requestReportOptionsList(
            @NotNull String reportUnitUri); @NotNull ReportOptionEntity createReportOption(
            @NotNull String reportUnitUri,
            @NotNull String optionLabel,
            @NotNull List<ReportParameter> parameters,
            boolean overwrite); void updateReportOption(
            @NotNull String reportUnitUri,
            @NotNull String optionId,
            @NotNull List<ReportParameter> parameters); void deleteReportOption(
            @Nullable String reportUnitUri,
            @Nullable String optionId); }
ReportOptionRestApi { public void deleteReportOption( @Nullable String reportUnitUri, @Nullable String optionId) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(reportUnitUri) .addPath("options") .addPath(optionId) .build() .resolve(mNetworkClient.getBaseUrl()); Request request = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .delete() .url(url) .build(); mNetworkClient.makeCall(request); } ReportOptionRestApi(NetworkClient networkClient); @NotNull Set<ReportOptionEntity> requestReportOptionsList(
            @NotNull String reportUnitUri); @NotNull ReportOptionEntity createReportOption(
            @NotNull String reportUnitUri,
            @NotNull String optionLabel,
            @NotNull List<ReportParameter> parameters,
            boolean overwrite); void updateReportOption(
            @NotNull String reportUnitUri,
            @NotNull String optionId,
            @NotNull List<ReportParameter> parameters); void deleteReportOption(
            @Nullable String reportUnitUri,
            @Nullable String optionId);  }