target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void shouldCreateInstanceOfGson() { Gson gson = GsonFactory.create(); assertThat(gson, Is.is(notNullValue())); } | public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapterFactory()); gs... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... |
@Test public void shouldModifyReportExecutionParametersField() throws Exception { ReportExecutionRequestOptions options = ReportExecutionRequestOptions.newRequest("/my/uri"); options.withParameters(Collections.singletonList(new ReportParameter("key", Collections.singleton("value")))); Gson gson = GsonFactory.create(); ... | public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapterFactory()); gs... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... |
@Test public void exportIdShouldNotBeNullForCheckRequestExecutionStatus() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Export id should not be null"); restApiUnderTest.checkExportExecutionStatus("any_id", null); } | @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new PathResolver.Builder()... | ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new ... | ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new ... | ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new ... | ReportExportRestApi { @NotNull public ExecutionStatus checkExportExecutionStatus(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new ... |
@Test public void should_parse_only_input_controls_from_dashboard_components() throws Exception { Gson gson = GsonFactory.create(); DashboardComponentCollection components = gson.fromJson(mComponents.asString(), DashboardComponentCollection.class); assertThat(components.getInputControlComponents() , is(not(empty()))); ... | public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapterFactory()); gs... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... |
@Test public void should_deserialize_form_with_custom_rule() throws Exception { Gson gson = GsonFactory.create(); JobFormEntity entity = gson.fromJson(mGetJobResponse.asString(), JobFormEntity.class); assertThat(entity , is(notNullValue())); } | public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapterFactory()); gs... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... | GsonFactory { public static Gson create() { GsonBuilder gsonBuilder = new GsonBuilder(); gsonBuilder.excludeFieldsWithoutExposeAnnotation(); gsonBuilder.disableHtmlEscaping(); gsonBuilder.registerTypeAdapterFactory(new ReportLookupTypeAdapterFactory()); gsonBuilder.registerTypeAdapterFactory(new InputControlTypeAdapter... |
@Test public void shouldAlwaysReturnReportUnitUriAsType() { ReportLookup response = new ReportLookup(); assertThat(response.getResourceType(), is("reportUnit")); } | @Override public String getResourceType() { return "reportUnit"; } | ReportLookup extends ResourceLookup { @Override public String getResourceType() { return "reportUnit"; } } | ReportLookup extends ResourceLookup { @Override public String getResourceType() { return "reportUnit"; } ReportLookup(); } | ReportLookup extends ResourceLookup { @Override public String getResourceType() { return "reportUnit"; } ReportLookup(); @Override String getResourceType(); boolean alwaysPromptControls(); @Override String toString(); } | ReportLookup extends ResourceLookup { @Override public String getResourceType() { return "reportUnit"; } ReportLookup(); @Override String getResourceType(); boolean alwaysPromptControls(); @Override String toString(); } |
@Test public void testEquals() throws Exception { EqualsVerifier.forClass(ReportParameter.class).verify(); } | @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ReportParameter that = (ReportParameter) o; if (name != null ? !name.equals(that.name) : that.name != null) return false; if (value != null ? !value.equals(that.value) : that.value != null)... | ReportParameter { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ReportParameter that = (ReportParameter) o; if (name != null ? !name.equals(that.name) : that.name != null) return false; if (value != null ? !value.equals(that.value) : t... | ReportParameter { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ReportParameter that = (ReportParameter) o; if (name != null ? !name.equals(that.name) : that.name != null) return false; if (value != null ? !value.equals(that.value) : t... | ReportParameter { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ReportParameter that = (ReportParameter) o; if (name != null ? !name.equals(that.name) : that.name != null) return false; if (value != null ? !value.equals(that.value) : t... | ReportParameter { @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ReportParameter that = (ReportParameter) o; if (name != null ? !name.equals(that.name) : that.name != null) return false; if (value != null ? !value.equals(that.value) : t... |
@Test public void factoryMethodShouldNotAllowNull() { mExpectedException.expect(IllegalArgumentException.class); ReportExecutionRequestOptions.newRequest(null); } | public static ReportExecutionRequestOptions newRequest(String uri) { if (uri == null) { throw new IllegalArgumentException("Uri should not be null"); } return new ReportExecutionRequestOptions(uri); } | ReportExecutionRequestOptions extends ExecutionRequestOptions { public static ReportExecutionRequestOptions newRequest(String uri) { if (uri == null) { throw new IllegalArgumentException("Uri should not be null"); } return new ReportExecutionRequestOptions(uri); } } | ReportExecutionRequestOptions extends ExecutionRequestOptions { public static ReportExecutionRequestOptions newRequest(String uri) { if (uri == null) { throw new IllegalArgumentException("Uri should not be null"); } return new ReportExecutionRequestOptions(uri); } private ReportExecutionRequestOptions(String reportUni... | ReportExecutionRequestOptions extends ExecutionRequestOptions { public static ReportExecutionRequestOptions newRequest(String uri) { if (uri == null) { throw new IllegalArgumentException("Uri should not be null"); } return new ReportExecutionRequestOptions(uri); } private ReportExecutionRequestOptions(String reportUni... | ReportExecutionRequestOptions extends ExecutionRequestOptions { public static ReportExecutionRequestOptions newRequest(String uri) { if (uri == null) { throw new IllegalArgumentException("Uri should not be null"); } return new ReportExecutionRequestOptions(uri); } private ReportExecutionRequestOptions(String reportUni... |
@Test public void requestReportOptionsListShouldNotAllowNullReportUnitUri() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Report uri should not be null"); restApiUnderTest.requestReportOptionsList(null); } | @NotNull public Set<ReportOptionEntity> requestReportOptionsList( @NotNull String reportUnitUri) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(reportUnitUri) .addPath("opt... | ReportOptionRestApi { @NotNull public Set<ReportOptionEntity> requestReportOptionsList( @NotNull String reportUnitUri) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(report... | ReportOptionRestApi { @NotNull public Set<ReportOptionEntity> requestReportOptionsList( @NotNull String reportUnitUri) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(report... | ReportOptionRestApi { @NotNull public Set<ReportOptionEntity> requestReportOptionsList( @NotNull String reportUnitUri) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(report... | ReportOptionRestApi { @NotNull public Set<ReportOptionEntity> requestReportOptionsList( @NotNull String reportUnitUri) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(report... |
@Test public void createReportOptionShouldNotAllowNullReportUri() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Report uri should not be null"); restApiUnderTest.createReportOption(null, "label", REPORT_PARAMS, false); } | @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionLabel, "Option... | ReportOptionRestApi { @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNul... | ReportOptionRestApi { @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNul... | ReportOptionRestApi { @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNul... | ReportOptionRestApi { @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNul... |
@Test public void createReportOptionShouldNotAllowNullOptionLabel() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Option label should not be null"); restApiUnderTest.createReportOption("any_id", null, REPORT_PARAMS, false); } | @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionLabel, "Option... | ReportOptionRestApi { @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNul... | ReportOptionRestApi { @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNul... | ReportOptionRestApi { @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNul... | ReportOptionRestApi { @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNul... |
@Test public void createReportOptionShouldNotAllowNullControlsValues() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Parameters values should not be null"); restApiUnderTest.createReportOption("any_id", "label", null, false); } | @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionLabel, "Option... | ReportOptionRestApi { @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNul... | ReportOptionRestApi { @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNul... | ReportOptionRestApi { @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNul... | ReportOptionRestApi { @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNul... |
@Test public void updateReportOptionShouldNotAllowNullReportUri() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Report uri should not be null"); restApiUnderTest.updateReportOption(null, "option_id", REPORT_PARAMS); } | public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); Utils.checkNotNull(par... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... |
@Test public void executionIdParameterShouldNotBeNullForAttachmentRequest() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Execution id should not be null"); restApiUnderTest.requestExportAttachment(null, "any_id", "any_id"); } | @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); Utils.checkNot... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... |
@Test public void updateReportOptionShouldNotAllowNullOptionId() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Option id should not be null"); restApiUnderTest.updateReportOption("any_id", null, REPORT_PARAMS); } | public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); Utils.checkNotNull(par... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... |
@Test public void updateReportOptionShouldNotAllowNullControlsValues() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Parameters values should not be null"); restApiUnderTest.updateReportOption("any_id", "option_id", null); } | public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); Utils.checkNotNull(par... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... |
@Test public void deleteReportOptionShouldNotAllowNullReportUri() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Report uri should not be null"); restApiUnderTest.deleteReportOption(null, "option_id"); } | 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") .a... | 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() ... | 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() ... | 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() ... | 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() ... |
@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") .a... | 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() ... | 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() ... | 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() ... | 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() ... |
@Test public void apiShouldListReportOptions() throws Exception { MockResponse mockResponse = MockResponseFactory.create200().setBody(reportOptionsList.asString()); mWebMockRule.enqueue(mockResponse); Set<ReportOptionEntity> response = restApiUnderTest.requestReportOptionsList("/any/uri"); assertThat(response, is(not(e... | @NotNull public Set<ReportOptionEntity> requestReportOptionsList( @NotNull String reportUnitUri) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(reportUnitUri) .addPath("opt... | ReportOptionRestApi { @NotNull public Set<ReportOptionEntity> requestReportOptionsList( @NotNull String reportUnitUri) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(report... | ReportOptionRestApi { @NotNull public Set<ReportOptionEntity> requestReportOptionsList( @NotNull String reportUnitUri) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(report... | ReportOptionRestApi { @NotNull public Set<ReportOptionEntity> requestReportOptionsList( @NotNull String reportUnitUri) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(report... | ReportOptionRestApi { @NotNull public Set<ReportOptionEntity> requestReportOptionsList( @NotNull String reportUnitUri) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(report... |
@Test public void apiShouldCreateReportOption() throws Exception { MockResponse mockResponse = MockResponseFactory.create200().setBody(reportOption.asString()); mWebMockRule.enqueue(mockResponse); ReportOptionEntity reportOption = restApiUnderTest.createReportOption("/any/uri", "my label", REPORT_PARAMS, true); assertT... | @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionLabel, "Option... | ReportOptionRestApi { @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNul... | ReportOptionRestApi { @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNul... | ReportOptionRestApi { @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNul... | ReportOptionRestApi { @NotNull public ReportOptionEntity createReportOption( @NotNull String reportUnitUri, @NotNull String optionLabel, @NotNull List<ReportParameter> parameters, boolean overwrite) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNul... |
@Test public void apiShouldUpdateReportOption() throws Exception { mWebMockRule.enqueue(MockResponseFactory.create200()); Map<String, Set<String>> params = new HashMap<>(); params.put("sales_fact_ALL__store_sales_2013_1", Collections.singleton("22")); restApiUnderTest.updateReportOption("/any/uri", "option_id", REPORT_... | public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); Utils.checkNotNull(par... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... |
@Test public void apiShouldDeleteReportOption() throws Exception { mWebMockRule.enqueue(MockResponseFactory.create200()); restApiUnderTest.deleteReportOption("/any/uri", "option_id"); RecordedRequest request = mWebMockRule.get().takeRequest(); assertThat(request.getPath(), is("/rest_v2/reports/any/uri/options/option_id... | 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") .a... | 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() ... | 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() ... | 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() ... | 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() ... |
@Test public void requestReportOptionsListShouldThrow500Error() throws Exception { mExpectedException.expect(HttpException.class); mWebMockRule.enqueue(MockResponseFactory.create500()); restApiUnderTest.requestReportOptionsList("any_id"); } | @NotNull public Set<ReportOptionEntity> requestReportOptionsList( @NotNull String reportUnitUri) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(reportUnitUri) .addPath("opt... | ReportOptionRestApi { @NotNull public Set<ReportOptionEntity> requestReportOptionsList( @NotNull String reportUnitUri) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(report... | ReportOptionRestApi { @NotNull public Set<ReportOptionEntity> requestReportOptionsList( @NotNull String reportUnitUri) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(report... | ReportOptionRestApi { @NotNull public Set<ReportOptionEntity> requestReportOptionsList( @NotNull String reportUnitUri) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(report... | ReportOptionRestApi { @NotNull public Set<ReportOptionEntity> requestReportOptionsList( @NotNull String reportUnitUri) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); HttpUrl url = new PathResolver.Builder() .addPath("rest_v2") .addPath("reports") .addPaths(report... |
@Test public void updateReportOptionShouldThrowRestErrorFor500() throws Exception { mExpectedException.expect(HttpException.class); mWebMockRule.enqueue(MockResponseFactory.create500()); restApiUnderTest.updateReportOption("any_id", "option_id", REPORT_PARAMS); } | public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); Utils.checkNotNull(par... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... | ReportOptionRestApi { public void updateReportOption( @NotNull String reportUnitUri, @NotNull String optionId, @NotNull List<ReportParameter> parameters) throws IOException, HttpException { Utils.checkNotNull(reportUnitUri, "Report uri should not be null"); Utils.checkNotNull(optionId, "Option id should not be null"); ... |
@Test public void exportIdParameterShouldNotBeNullForAttachmentRequest() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Export id should not be null"); restApiUnderTest.requestExportAttachment("any_id", null, "any_id"); } | @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); Utils.checkNot... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... |
@Test public void deleteReportOptionShouldThrowRestErrorFor500() throws Exception { mExpectedException.expect(HttpException.class); mWebMockRule.enqueue(MockResponseFactory.create500()); restApiUnderTest.deleteReportOption("any_id", "option_id"); } | 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") .a... | 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() ... | 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() ... | 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() ... | 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() ... |
@Test public void shouldThroughRestErrorForHttpError() throws Exception { mExpectedException.expect(HttpException.class); mWebMockRule.enqueue(MockResponseFactory.create500()); objectUnderTest.requestServerInfo(); } | @NotNull public ServerInfoData requestServerInfo() throws IOException, HttpException { HttpUrl httpUrl = mClientWrapper.getBaseUrl().resolve("rest_v2/serverInfo"); Request request = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(httpUrl) .get() .build(); Response response = mClientWr... | ServerRestApi { @NotNull public ServerInfoData requestServerInfo() throws IOException, HttpException { HttpUrl httpUrl = mClientWrapper.getBaseUrl().resolve("rest_v2/serverInfo"); Request request = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(httpUrl) .get() .build(); Response resp... | ServerRestApi { @NotNull public ServerInfoData requestServerInfo() throws IOException, HttpException { HttpUrl httpUrl = mClientWrapper.getBaseUrl().resolve("rest_v2/serverInfo"); Request request = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(httpUrl) .get() .build(); Response resp... | ServerRestApi { @NotNull public ServerInfoData requestServerInfo() throws IOException, HttpException { HttpUrl httpUrl = mClientWrapper.getBaseUrl().resolve("rest_v2/serverInfo"); Request request = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(httpUrl) .get() .build(); Response resp... | ServerRestApi { @NotNull public ServerInfoData requestServerInfo() throws IOException, HttpException { HttpUrl httpUrl = mClientWrapper.getBaseUrl().resolve("rest_v2/serverInfo"); Request request = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(httpUrl) .get() .build(); Response resp... |
@Test public void shouldBuildAppropriateJsonRequestForServerInfo() throws Exception { mWebMockRule.enqueue( MockResponseFactory.create200().setBody("{}") ); ServerInfoData serverInfoData = objectUnderTest.requestServerInfo(); assertThat("Response not null value", serverInfoData, is(notNullValue())); RecordedRequest rec... | @NotNull public ServerInfoData requestServerInfo() throws IOException, HttpException { HttpUrl httpUrl = mClientWrapper.getBaseUrl().resolve("rest_v2/serverInfo"); Request request = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(httpUrl) .get() .build(); Response response = mClientWr... | ServerRestApi { @NotNull public ServerInfoData requestServerInfo() throws IOException, HttpException { HttpUrl httpUrl = mClientWrapper.getBaseUrl().resolve("rest_v2/serverInfo"); Request request = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(httpUrl) .get() .build(); Response resp... | ServerRestApi { @NotNull public ServerInfoData requestServerInfo() throws IOException, HttpException { HttpUrl httpUrl = mClientWrapper.getBaseUrl().resolve("rest_v2/serverInfo"); Request request = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(httpUrl) .get() .build(); Response resp... | ServerRestApi { @NotNull public ServerInfoData requestServerInfo() throws IOException, HttpException { HttpUrl httpUrl = mClientWrapper.getBaseUrl().resolve("rest_v2/serverInfo"); Request request = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(httpUrl) .get() .build(); Response resp... | ServerRestApi { @NotNull public ServerInfoData requestServerInfo() throws IOException, HttpException { HttpUrl httpUrl = mClientWrapper.getBaseUrl().resolve("rest_v2/serverInfo"); Request request = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(httpUrl) .get() .build(); Response resp... |
@Test public void shouldHandlePlainTextResponseForBuild() throws Exception { mWebMockRule.enqueue( MockResponseFactory.create200().setBody("Enterprise for AWS") ); String editionName = objectUnderTest.requestBuild(); assertThat(editionName, is("Enterprise for AWS")); RecordedRequest recordedRequest = mWebMockRule.get()... | @NotNull public String requestBuild() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/build"); } | ServerRestApi { @NotNull public String requestBuild() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/build"); } } | ServerRestApi { @NotNull public String requestBuild() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/build"); } ServerRestApi(NetworkClient networkClient); } | ServerRestApi { @NotNull public String requestBuild() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/build"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdition(); @NotNull String requestV... | ServerRestApi { @NotNull public String requestBuild() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/build"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdition(); @NotNull String requestV... |
@Test public void shouldHandlePlainTextResponseForDateFormatPattern() throws Exception { mWebMockRule.enqueue( MockResponseFactory.create200().setBody("yyyy-MM-dd") ); String editionName = objectUnderTest.requestDateFormatPattern(); assertThat(editionName, is("yyyy-MM-dd")); RecordedRequest recordedRequest = mWebMockRu... | @NotNull public String requestDateFormatPattern() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/dateFormatPattern"); } | ServerRestApi { @NotNull public String requestDateFormatPattern() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/dateFormatPattern"); } } | ServerRestApi { @NotNull public String requestDateFormatPattern() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/dateFormatPattern"); } ServerRestApi(NetworkClient networkClient); } | ServerRestApi { @NotNull public String requestDateFormatPattern() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/dateFormatPattern"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdition(); ... | ServerRestApi { @NotNull public String requestDateFormatPattern() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/dateFormatPattern"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdition(); ... |
@Test public void shouldHandlePlainTextResponseForDatetimeFormatPattern() throws Exception { mWebMockRule.enqueue( MockResponseFactory.create200().setBody("yyyy-MM-dd'T'HH:mm:ss") ); String editionName = objectUnderTest.requestDateTimeFormatPattern(); assertThat(editionName, is("yyyy-MM-dd'T'HH:mm:ss")); RecordedReques... | @NotNull public String requestDateTimeFormatPattern() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/datetimeFormatPattern"); } | ServerRestApi { @NotNull public String requestDateTimeFormatPattern() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/datetimeFormatPattern"); } } | ServerRestApi { @NotNull public String requestDateTimeFormatPattern() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/datetimeFormatPattern"); } ServerRestApi(NetworkClient networkClient); } | ServerRestApi { @NotNull public String requestDateTimeFormatPattern() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/datetimeFormatPattern"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdi... | ServerRestApi { @NotNull public String requestDateTimeFormatPattern() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/datetimeFormatPattern"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdi... |
@Test public void shouldHandlePlainTextResponseForEdition() throws Exception { mWebMockRule.enqueue( MockResponseFactory.create200().setBody("PRO") ); String editionName = objectUnderTest.requestEdition(); assertThat(editionName, is("PRO")); RecordedRequest recordedRequest = mWebMockRule.get().takeRequest(); assertThat... | @NotNull public String requestEdition() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/edition"); } | ServerRestApi { @NotNull public String requestEdition() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/edition"); } } | ServerRestApi { @NotNull public String requestEdition() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/edition"); } ServerRestApi(NetworkClient networkClient); } | ServerRestApi { @NotNull public String requestEdition() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/edition"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdition(); @NotNull String requ... | ServerRestApi { @NotNull public String requestEdition() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/edition"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdition(); @NotNull String requ... |
@Test public void shouldHandlePlainTextResponseForEditionName() throws Exception { mWebMockRule.enqueue( MockResponseFactory.create200().setBody("Enterprise for AWS") ); String editionName = objectUnderTest.requestEditionName(); assertThat(editionName, is("Enterprise for AWS")); RecordedRequest recordedRequest = mWebMo... | @NotNull public String requestEditionName() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/editionName"); } | ServerRestApi { @NotNull public String requestEditionName() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/editionName"); } } | ServerRestApi { @NotNull public String requestEditionName() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/editionName"); } ServerRestApi(NetworkClient networkClient); } | ServerRestApi { @NotNull public String requestEditionName() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/editionName"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdition(); @NotNull Str... | ServerRestApi { @NotNull public String requestEditionName() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/editionName"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdition(); @NotNull Str... |
@Test public void shouldHandlePlainTextResponseForExpiration() throws Exception { mWebMockRule.enqueue( MockResponseFactory.create200().setBody("1000") ); String editionName = objectUnderTest.requestExpiration(); assertThat(editionName, is("1000")); RecordedRequest recordedRequest = mWebMockRule.get().takeRequest(); as... | @NotNull public String requestExpiration() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/expiration"); } | ServerRestApi { @NotNull public String requestExpiration() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/expiration"); } } | ServerRestApi { @NotNull public String requestExpiration() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/expiration"); } ServerRestApi(NetworkClient networkClient); } | ServerRestApi { @NotNull public String requestExpiration() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/expiration"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdition(); @NotNull Strin... | ServerRestApi { @NotNull public String requestExpiration() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/expiration"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdition(); @NotNull Strin... |
@Test public void shouldHandlePlainTextResponseForFeatures() throws Exception { mWebMockRule.enqueue( MockResponseFactory.create200().setBody("Fusion AHD EXP DB ANA AUD MT ") ); String editionName = objectUnderTest.requestFeatures(); assertThat(editionName, is("Fusion AHD EXP DB ANA AUD MT ")); RecordedRequest recorded... | @NotNull public String requestFeatures() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/features"); } | ServerRestApi { @NotNull public String requestFeatures() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/features"); } } | ServerRestApi { @NotNull public String requestFeatures() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/features"); } ServerRestApi(NetworkClient networkClient); } | ServerRestApi { @NotNull public String requestFeatures() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/features"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdition(); @NotNull String re... | ServerRestApi { @NotNull public String requestFeatures() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/features"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdition(); @NotNull String re... |
@Test public void attachmentIdParameterShouldNotBeNullForAttachmentRequest() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Attachment id should not be null"); restApiUnderTest.requestExportAttachment("any_id", "any_id", null); } | @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); Utils.checkNot... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... | ReportExportRestApi { @NotNull public OutputResource requestExportAttachment(@NotNull String executionId, @NotNull String exportId, @NotNull String attachmentId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be ... |
@Test public void shouldHandlePlainTextResponseForLicenseType() throws Exception { mWebMockRule.enqueue( MockResponseFactory.create200().setBody("Commercial") ); String editionName = objectUnderTest.requestLicenseType(); assertThat(editionName, is("Commercial")); RecordedRequest recordedRequest = mWebMockRule.get().tak... | @NotNull public String requestLicenseType() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/licenseType"); } | ServerRestApi { @NotNull public String requestLicenseType() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/licenseType"); } } | ServerRestApi { @NotNull public String requestLicenseType() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/licenseType"); } ServerRestApi(NetworkClient networkClient); } | ServerRestApi { @NotNull public String requestLicenseType() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/licenseType"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdition(); @NotNull Str... | ServerRestApi { @NotNull public String requestLicenseType() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/licenseType"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdition(); @NotNull Str... |
@Test public void shouldHandlePlainTextResponseFor() throws Exception { mWebMockRule.enqueue( MockResponseFactory.create200().setBody("5.5.0") ); String editionName = objectUnderTest.requestVersion(); assertThat(editionName, is("5.5.0")); RecordedRequest recordedRequest = mWebMockRule.get().takeRequest(); assertThat("S... | @NotNull public String requestVersion() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/version"); } | ServerRestApi { @NotNull public String requestVersion() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/version"); } } | ServerRestApi { @NotNull public String requestVersion() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/version"); } ServerRestApi(NetworkClient networkClient); } | ServerRestApi { @NotNull public String requestVersion() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/version"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdition(); @NotNull String requ... | ServerRestApi { @NotNull public String requestVersion() throws IOException, HttpException { return plainRequest("rest_v2/serverInfo/version"); } ServerRestApi(NetworkClient networkClient); @NotNull ServerInfoData requestServerInfo(); @NotNull String requestBuild(); @NotNull String requestEdition(); @NotNull String requ... |
@Test public void shouldThroughRestErrorOnSearchRequestIfHttpError() throws Exception { mExpectedException.expect(HttpException.class); mWebMockRule.enqueue(MockResponseFactory.create500()); restApiUnderTest.runReportExecution(ReportExecutionRequestOptions.newRequest("/any/uri")); } | @NotNull public ReportExecutionDescriptor runReportExecution(@NotNull ReportExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionOptions, "Execution options should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/reportExecutions"); RequestBo... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor runReportExecution(@NotNull ReportExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionOptions, "Execution options should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/repo... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor runReportExecution(@NotNull ReportExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionOptions, "Execution options should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/repo... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor runReportExecution(@NotNull ReportExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionOptions, "Execution options should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/repo... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor runReportExecution(@NotNull ReportExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionOptions, "Execution options should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/repo... |
@Test public void bodyParameterShouldNotBeNullForRunReportExecution() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Execution options should not be null"); restApiUnderTest.runReportExecution(null); } | @NotNull public ReportExecutionDescriptor runReportExecution(@NotNull ReportExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionOptions, "Execution options should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/reportExecutions"); RequestBo... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor runReportExecution(@NotNull ReportExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionOptions, "Execution options should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/repo... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor runReportExecution(@NotNull ReportExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionOptions, "Execution options should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/repo... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor runReportExecution(@NotNull ReportExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionOptions, "Execution options should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/repo... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor runReportExecution(@NotNull ReportExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionOptions, "Execution options should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/repo... |
@Test public void executionIdShouldNotBeNullForRequestExecutionDetails() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Execution id should not be null"); restApiUnderTest.requestReportExecutionDetails(null); } | @NotNull public ReportExecutionDescriptor requestReportExecutionDetails(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executi... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor requestReportExecutionDetails(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/reportExecutions") .newBuilder(... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor requestReportExecutionDetails(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/reportExecutions") .newBuilder(... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor requestReportExecutionDetails(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/reportExecutions") .newBuilder(... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor requestReportExecutionDetails(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/reportExecutions") .newBuilder(... |
@Test public void executionIdShouldNotBeNullForRequestExecutionStatus() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Execution id should not be null"); restApiUnderTest.requestReportExecutionStatus(null); } | @NotNull public ExecutionStatus requestReportExecutionStatus(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .add... | ReportExecutionRestApi { @NotNull public ExecutionStatus requestReportExecutionStatus(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPath... | ReportExecutionRestApi { @NotNull public ExecutionStatus requestReportExecutionStatus(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPath... | ReportExecutionRestApi { @NotNull public ExecutionStatus requestReportExecutionStatus(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPath... | ReportExecutionRestApi { @NotNull public ExecutionStatus requestReportExecutionStatus(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPath... |
@Test public void executionIdShouldNotBeNullForCancelRequestExecution() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Execution id should not be null"); restApiUnderTest.cancelReportExecution(null); } | public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .addPathSegment("status") .b... | ReportExecutionRestApi { public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .ad... | ReportExecutionRestApi { public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .ad... | ReportExecutionRestApi { public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .ad... | ReportExecutionRestApi { public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .ad... |
@Test public void bodyParameterShouldNotBeNullForExecutionUpdate() throws Exception { mExpectedException.expect(NullPointerException.class); mExpectedException.expectMessage("Execution params should not be null"); restApiUnderTest.updateReportExecution("any_id", null); } | public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument(params.isEmpty(), "Execu... | ReportExecutionRestApi { public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument... | ReportExecutionRestApi { public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument... | ReportExecutionRestApi { public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument... | ReportExecutionRestApi { public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument... |
@Test public void bodyParameterShouldNotBeEmptyForExecutionUpdate() throws Exception { mExpectedException.expect(IllegalArgumentException.class); mExpectedException.expectMessage("Execution params should not be empty"); restApiUnderTest.updateReportExecution("any_id", Collections.<ReportParameter>emptyList()); } | public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument(params.isEmpty(), "Execu... | ReportExecutionRestApi { public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument... | ReportExecutionRestApi { public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument... | ReportExecutionRestApi { public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument... | ReportExecutionRestApi { public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument... |
@Test public void shouldStartReportExecution() throws Exception { MockResponse response = MockResponseFactory.create200().setBody(reportExecutionResponse.asString()); mWebMockRule.enqueue(response); ReportExecutionRequestOptions options = ReportExecutionRequestOptions.newRequest("/my/uri"); restApiUnderTest.runReportEx... | @NotNull public ReportExecutionDescriptor runReportExecution(@NotNull ReportExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionOptions, "Execution options should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/reportExecutions"); RequestBo... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor runReportExecution(@NotNull ReportExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionOptions, "Execution options should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/repo... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor runReportExecution(@NotNull ReportExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionOptions, "Execution options should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/repo... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor runReportExecution(@NotNull ReportExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionOptions, "Execution options should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/repo... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor runReportExecution(@NotNull ReportExecutionRequestOptions executionOptions) throws IOException, HttpException { Utils.checkNotNull(executionOptions, "Execution options should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/repo... |
@Test public void requestForOutputShouldParsePagesFromHeader() throws Exception { MockResponse mockResponse = MockResponseFactory.create200() .setBody("") .addHeader("report-pages", "1-10"); mWebMockRule.enqueue(mockResponse); ExportOutputResource resource = restApiUnderTest.requestExportOutput(EXECUTION_ID, EXPORT_ID)... | @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new PathResolver.Builder() .... | ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new Pa... | ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new Pa... | ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new Pa... | ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new Pa... |
@Test public void shouldRequestReportExecutionDetails() throws Exception { MockResponse response = MockResponseFactory.create200().setBody(reportExecutionDetailsResponse.asString()); mWebMockRule.enqueue(response); ReportExecutionDescriptor details = restApiUnderTest.requestReportExecutionDetails(EXEC_ID); assertThat(d... | @NotNull public ReportExecutionDescriptor requestReportExecutionDetails(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executi... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor requestReportExecutionDetails(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/reportExecutions") .newBuilder(... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor requestReportExecutionDetails(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/reportExecutions") .newBuilder(... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor requestReportExecutionDetails(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/reportExecutions") .newBuilder(... | ReportExecutionRestApi { @NotNull public ReportExecutionDescriptor requestReportExecutionDetails(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl().resolve("rest_v2/reportExecutions") .newBuilder(... |
@Test public void shouldRequestReportExecutionStatus() throws Exception { MockResponse response = MockResponseFactory.create200().setBody("{\"value\":\"execution\"}"); mWebMockRule.enqueue(response); ExecutionStatus status = restApiUnderTest.requestReportExecutionStatus(EXEC_ID); assertThat(status, is(notNullValue()));... | @NotNull public ExecutionStatus requestReportExecutionStatus(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .add... | ReportExecutionRestApi { @NotNull public ExecutionStatus requestReportExecutionStatus(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPath... | ReportExecutionRestApi { @NotNull public ExecutionStatus requestReportExecutionStatus(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPath... | ReportExecutionRestApi { @NotNull public ExecutionStatus requestReportExecutionStatus(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPath... | ReportExecutionRestApi { @NotNull public ExecutionStatus requestReportExecutionStatus(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPath... |
@Test public void shouldCancelReportExecution() throws Exception { MockResponse response = MockResponseFactory.create200(); mWebMockRule.enqueue(response); restApiUnderTest.cancelReportExecution(EXEC_ID); RecordedRequest request = mWebMockRule.get().takeRequest(); assertThat(request, containsHeader("Accept", "applicati... | public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .addPathSegment("status") .b... | ReportExecutionRestApi { public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .ad... | ReportExecutionRestApi { public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .ad... | ReportExecutionRestApi { public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .ad... | ReportExecutionRestApi { public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .ad... |
@Test public void shouldUpdateReportExecution() throws Exception { MockResponse response = MockResponseFactory.create204(); mWebMockRule.enqueue(response); restApiUnderTest.updateReportExecution(EXEC_ID, PARAMS); RecordedRequest request = mWebMockRule.get().takeRequest(); assertThat(request, containsHeader("Accept", "a... | public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument(params.isEmpty(), "Execu... | ReportExecutionRestApi { public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument... | ReportExecutionRestApi { public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument... | ReportExecutionRestApi { public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument... | ReportExecutionRestApi { public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument... |
@Test public void responseShouldNotBeCancelledIfResponseIs204() throws Exception { mWebMockRule.enqueue(MockResponseFactory.create204()); boolean cancelled = restApiUnderTest.cancelReportExecution("any_id"); assertThat(cancelled, is(false)); } | public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .addPathSegment("status") .b... | ReportExecutionRestApi { public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .ad... | ReportExecutionRestApi { public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .ad... | ReportExecutionRestApi { public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .ad... | ReportExecutionRestApi { public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .ad... |
@Test public void responseShouldBeCancelledIfResponseIs200() throws Exception { MockResponse response = MockResponseFactory.create200().setBody(cancelledResponse.asString()); mWebMockRule.enqueue(response); boolean cancelled = restApiUnderTest.cancelReportExecution("any_id"); assertThat(cancelled, is(true)); } | public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .addPathSegment("status") .b... | ReportExecutionRestApi { public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .ad... | ReportExecutionRestApi { public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .ad... | ReportExecutionRestApi { public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .ad... | ReportExecutionRestApi { public boolean cancelReportExecution(@NotNull String executionId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); HttpUrl url = mNetworkClient.getBaseUrl() .resolve("rest_v2/reportExecutions") .newBuilder() .addPathSegment(executionId) .ad... |
@Test public void executionUpdateRequestShouldBeSuccessIfResponseIs204() throws Exception { mWebMockRule.enqueue(MockResponseFactory.create204()); boolean response = restApiUnderTest.updateReportExecution("any_id", PARAMS); assertThat(response, is(true)); } | public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument(params.isEmpty(), "Execu... | ReportExecutionRestApi { public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument... | ReportExecutionRestApi { public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument... | ReportExecutionRestApi { public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument... | ReportExecutionRestApi { public boolean updateReportExecution(@NotNull String executionId, @NotNull List<ReportParameter> params) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(params, "Execution params should not be null"); Utils.checkArgument... |
@Test public void shouldDelegateMimeType() { when(mTypedInput.contentType()).thenReturn(MediaType.parse("multipart/form-data")); objectUnderTest.getMimeType(); verify(mTypedInput, times(1)).contentType(); } | @Override public String getMimeType() { return mResponse.contentType().type(); } | RetrofitOutputResource implements OutputResource { @Override public String getMimeType() { return mResponse.contentType().type(); } } | RetrofitOutputResource implements OutputResource { @Override public String getMimeType() { return mResponse.contentType().type(); } RetrofitOutputResource(ResponseBody input); } | RetrofitOutputResource implements OutputResource { @Override public String getMimeType() { return mResponse.contentType().type(); } RetrofitOutputResource(ResponseBody input); @Override String getMimeType(); @Override long getLength(); @Override InputStream getStream(); } | RetrofitOutputResource implements OutputResource { @Override public String getMimeType() { return mResponse.contentType().type(); } RetrofitOutputResource(ResponseBody input); @Override String getMimeType(); @Override long getLength(); @Override InputStream getStream(); } |
@Test public void shouldDelegateLength() throws IOException { objectUnderTest.getLength(); verify(mTypedInput, times(1)).contentLength(); } | @Override public long getLength() { try { return mResponse.contentLength(); } catch (IOException e) { return -1; } } | RetrofitOutputResource implements OutputResource { @Override public long getLength() { try { return mResponse.contentLength(); } catch (IOException e) { return -1; } } } | RetrofitOutputResource implements OutputResource { @Override public long getLength() { try { return mResponse.contentLength(); } catch (IOException e) { return -1; } } RetrofitOutputResource(ResponseBody input); } | RetrofitOutputResource implements OutputResource { @Override public long getLength() { try { return mResponse.contentLength(); } catch (IOException e) { return -1; } } RetrofitOutputResource(ResponseBody input); @Override String getMimeType(); @Override long getLength(); @Override InputStream getStream(); } | RetrofitOutputResource implements OutputResource { @Override public long getLength() { try { return mResponse.contentLength(); } catch (IOException e) { return -1; } } RetrofitOutputResource(ResponseBody input); @Override String getMimeType(); @Override long getLength(); @Override InputStream getStream(); } |
@Test public void shouldDelegateInputStream() throws IOException { when(mTypedInput.byteStream()).thenReturn(input); objectUnderTest.getStream(); verify(mTypedInput, times(1)).byteStream(); } | @Override public InputStream getStream() throws IOException { return mResponse.byteStream(); } | RetrofitOutputResource implements OutputResource { @Override public InputStream getStream() throws IOException { return mResponse.byteStream(); } } | RetrofitOutputResource implements OutputResource { @Override public InputStream getStream() throws IOException { return mResponse.byteStream(); } RetrofitOutputResource(ResponseBody input); } | RetrofitOutputResource implements OutputResource { @Override public InputStream getStream() throws IOException { return mResponse.byteStream(); } RetrofitOutputResource(ResponseBody input); @Override String getMimeType(); @Override long getLength(); @Override InputStream getStream(); } | RetrofitOutputResource implements OutputResource { @Override public InputStream getStream() throws IOException { return mResponse.byteStream(); } RetrofitOutputResource(ResponseBody input); @Override String getMimeType(); @Override long getLength(); @Override InputStream getStream(); } |
@Test public void requestForOutputShouldParseIsFinalHeader() throws Exception { MockResponse mockResponse = MockResponseFactory.create200() .setBody("") .addHeader("output-final", "true"); mWebMockRule.enqueue(mockResponse); ExportOutputResource resource = restApiUnderTest.requestExportOutput(EXECUTION_ID, EXPORT_ID); ... | @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new PathResolver.Builder() .... | ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new Pa... | ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new Pa... | ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new Pa... | ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new Pa... |
@Test public void should_parse_success_full_location_path() throws Exception { MockResponse mockResponse = MockResponseFactory.create302() .addHeader("Set-Cookie", "cookie1=12") .addHeader("Location", mWebMockRule.getRootUrl() + LOCATION_SUCCESS); mWebMockRule.enqueue(mockResponse); apiUnderTest.springAuth("joeuser", "... | public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (organization != ... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... |
@Test public void should_parse_success_relative_location_path() throws Exception { MockResponse mockResponse = MockResponseFactory.create302() .addHeader("Set-Cookie", "cookie1=12") .addHeader("Location", LOCATION_SUCCESS); mWebMockRule.enqueue(mockResponse); apiUnderTest.springAuth("joeuser", "joeuser", null, null); } | public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (organization != ... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... |
@Test public void should_parse_error_full_location_path() throws Exception { mExpectedException.expect(HttpException.class); MockResponse mockResponse = MockResponseFactory.create302() .addHeader("Location", mWebMockRule.getRootUrl() + LOCATION_ERROR) .addHeader("Set-Cookie", "cookie1"); mWebMockRule.enqueue(mockRespon... | public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (organization != ... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... |
@Test public void should_parse_error_relative_location_path() throws Exception { mExpectedException.expect(HttpException.class); MockResponse mockResponse = MockResponseFactory.create302() .addHeader("Location", LOCATION_ERROR) .addHeader("Set-Cookie", "cookie1"); mWebMockRule.enqueue(mockResponse); apiUnderTest.spring... | public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (organization != ... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... |
@Test public void shouldRiseErrorForHttpException() throws Exception { mExpectedException.expect(HttpException.class); mWebMockRule.enqueue(MockResponseFactory.create500()); apiUnderTest.springAuth("joeuser", "joeuser", "null", null); } | public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (organization != ... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... |
@Test public void shouldReturnEncryptionKeyIfApiAvailable() throws Exception { MockResponse encryptionKey = MockResponseFactory.create200() .setBody(mKey.asString()); mWebMockRule.enqueue(encryptionKey); EncryptionKey keyResponse = apiUnderTest.requestEncryptionMetadata(); assertThat(keyResponse, Is.is(notNullValue()))... | @NotNull public EncryptionKey requestEncryptionMetadata() throws IOException, HttpException { HttpUrl url2 = mNetworkClient.getBaseUrl().resolve("GetEncryptionKey"); Request request2 = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(url2) .get() .build(); try { Response response = mNe... | AuthRestApi { @NotNull public EncryptionKey requestEncryptionMetadata() throws IOException, HttpException { HttpUrl url2 = mNetworkClient.getBaseUrl().resolve("GetEncryptionKey"); Request request2 = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(url2) .get() .build(); try { Response ... | AuthRestApi { @NotNull public EncryptionKey requestEncryptionMetadata() throws IOException, HttpException { HttpUrl url2 = mNetworkClient.getBaseUrl().resolve("GetEncryptionKey"); Request request2 = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(url2) .get() .build(); try { Response ... | AuthRestApi { @NotNull public EncryptionKey requestEncryptionMetadata() throws IOException, HttpException { HttpUrl url2 = mNetworkClient.getBaseUrl().resolve("GetEncryptionKey"); Request request2 = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(url2) .get() .build(); try { Response ... | AuthRestApi { @NotNull public EncryptionKey requestEncryptionMetadata() throws IOException, HttpException { HttpUrl url2 = mNetworkClient.getBaseUrl().resolve("GetEncryptionKey"); Request request2 = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(url2) .get() .build(); try { Response ... |
@Test public void shouldReturnEmptyEncryptionKeyIfApiNotAvailable() throws Exception { String malformedJson = "{Error: Key generation is off}"; MockResponse encryptionKey = MockResponseFactory.create200() .setBody(malformedJson); mWebMockRule.enqueue(encryptionKey); EncryptionKey keyResponse = apiUnderTest.requestEncry... | @NotNull public EncryptionKey requestEncryptionMetadata() throws IOException, HttpException { HttpUrl url2 = mNetworkClient.getBaseUrl().resolve("GetEncryptionKey"); Request request2 = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(url2) .get() .build(); try { Response response = mNe... | AuthRestApi { @NotNull public EncryptionKey requestEncryptionMetadata() throws IOException, HttpException { HttpUrl url2 = mNetworkClient.getBaseUrl().resolve("GetEncryptionKey"); Request request2 = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(url2) .get() .build(); try { Response ... | AuthRestApi { @NotNull public EncryptionKey requestEncryptionMetadata() throws IOException, HttpException { HttpUrl url2 = mNetworkClient.getBaseUrl().resolve("GetEncryptionKey"); Request request2 = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(url2) .get() .build(); try { Response ... | AuthRestApi { @NotNull public EncryptionKey requestEncryptionMetadata() throws IOException, HttpException { HttpUrl url2 = mNetworkClient.getBaseUrl().resolve("GetEncryptionKey"); Request request2 = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(url2) .get() .build(); try { Response ... | AuthRestApi { @NotNull public EncryptionKey requestEncryptionMetadata() throws IOException, HttpException { HttpUrl url2 = mNetworkClient.getBaseUrl().resolve("GetEncryptionKey"); Request request2 = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(url2) .get() .build(); try { Response ... |
@Test public void should_include_header_csrf_header() throws Exception { String rootUrl = mWebMockRule.getRootUrl(); MockResponse cookieResponse = MockResponseFactory.create302() .addHeader("Location", rootUrl + LOCATION_SUCCESS) .addHeader("Set-Cookie", "cookie=12"); mWebMockRule.enqueue(cookieResponse); apiUnderTest.... | public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (organization != ... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... | AuthRestApi { public void springAuth(@NotNull final String username, @NotNull final String password, final String organization, final Map<String, String> params) throws HttpException, IOException { FormEncodingBuilder formBody = new FormEncodingBuilder() .add("j_password", password) .add("j_username", username); if (or... |
@Test public void shouldReturnEmptyEncryptionKeyIfApiReturns401Error() throws Exception { MockResponse anonymousCookie = MockResponseFactory.create200() .setBody("6.1") .addHeader("Set-Cookie", "cookie1=12"); String malformedJson = "{Error: Key generation is off}"; MockResponse encryptionKey = MockResponseFactory.creat... | @NotNull public EncryptionKey requestEncryptionMetadata() throws IOException, HttpException { HttpUrl url2 = mNetworkClient.getBaseUrl().resolve("GetEncryptionKey"); Request request2 = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(url2) .get() .build(); try { Response response = mNe... | AuthRestApi { @NotNull public EncryptionKey requestEncryptionMetadata() throws IOException, HttpException { HttpUrl url2 = mNetworkClient.getBaseUrl().resolve("GetEncryptionKey"); Request request2 = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(url2) .get() .build(); try { Response ... | AuthRestApi { @NotNull public EncryptionKey requestEncryptionMetadata() throws IOException, HttpException { HttpUrl url2 = mNetworkClient.getBaseUrl().resolve("GetEncryptionKey"); Request request2 = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(url2) .get() .build(); try { Response ... | AuthRestApi { @NotNull public EncryptionKey requestEncryptionMetadata() throws IOException, HttpException { HttpUrl url2 = mNetworkClient.getBaseUrl().resolve("GetEncryptionKey"); Request request2 = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(url2) .get() .build(); try { Response ... | AuthRestApi { @NotNull public EncryptionKey requestEncryptionMetadata() throws IOException, HttpException { HttpUrl url2 = mNetworkClient.getBaseUrl().resolve("GetEncryptionKey"); Request request2 = new Request.Builder() .addHeader("Accept", "application/json; charset=UTF-8") .url(url2) .get() .build(); try { Response ... |
@Test public void shouldReturnEmptyResponseForNoContentResponse() throws Exception { mWebMockRule.enqueue(MockResponseFactory.create204()); ResourceSearchResult response = restApiUnderTest.searchResources(null); assertThat(response.getResources(), is(empty())); } | @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchParams, url); Request r... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... | RepositoryRestApi { @NotNull public ResourceSearchResult searchResources(@NotNull Map<String, Object> searchParams) throws IOException, HttpException { HttpUrl url = mNetworkClient.getBaseUrl() .newBuilder() .addPathSegment("rest_v2") .addPathSegment("resources") .build(); url = QueryMapper.INSTANCE.mapParams(searchPar... |
@Test public void shouldRequestExportOutput() throws Exception { MockResponse mockResponse = MockResponseFactory.create200(); mWebMockRule.enqueue(mockResponse); restApiUnderTest.requestExportOutput(EXECUTION_ID, "html;pages=1"); RecordedRequest request = mWebMockRule.get().takeRequest(); assertThat(request, containsHe... | @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new PathResolver.Builder() .... | ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new Pa... | ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new Pa... | ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new Pa... | ReportExportRestApi { @NotNull public ExportOutputResource requestExportOutput(@NotNull String executionId, @NotNull String exportId) throws IOException, HttpException { Utils.checkNotNull(executionId, "Execution id should not be null"); Utils.checkNotNull(exportId, "Export id should not be null"); HttpUrl url = new Pa... |
@Test public void testFileAccessResult() throws Exception { String rawXml = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" + " <fileaccess_response>\n" + " <mountPoints>no_idea_what_goes_here</mountPoints>\n" + " <mountPoints>no_idea_what_goes_here</mountPoints>\n" + " <objects>\n" + " <name>foo</name>\n" + " <deviceEx... | public FileAccessResultHandler parseFileAccessResult(InputStream inputStream) throws AmazonClientException { FileAccessResultHandler handler = new FileAccessResultHandler(); parseXmlInputStream(handler, inputStream); return handler; } | ViPRResponsesSaxParser extends XmlResponsesSaxParser { public FileAccessResultHandler parseFileAccessResult(InputStream inputStream) throws AmazonClientException { FileAccessResultHandler handler = new FileAccessResultHandler(); parseXmlInputStream(handler, inputStream); return handler; } } | ViPRResponsesSaxParser extends XmlResponsesSaxParser { public FileAccessResultHandler parseFileAccessResult(InputStream inputStream) throws AmazonClientException { FileAccessResultHandler handler = new FileAccessResultHandler(); parseXmlInputStream(handler, inputStream); return handler; } } | ViPRResponsesSaxParser extends XmlResponsesSaxParser { public FileAccessResultHandler parseFileAccessResult(InputStream inputStream) throws AmazonClientException { FileAccessResultHandler handler = new FileAccessResultHandler(); parseXmlInputStream(handler, inputStream); return handler; } FileAccessResultHandler parse... | ViPRResponsesSaxParser extends XmlResponsesSaxParser { public FileAccessResultHandler parseFileAccessResult(InputStream inputStream) throws AmazonClientException { FileAccessResultHandler handler = new FileAccessResultHandler(); parseXmlInputStream(handler, inputStream); return handler; } FileAccessResultHandler parse... |
@Test(expected=GeneralSecurityException.class) public void testDecodeBadKey() throws Exception { KeyUtils.rsaKeyPairFromBase64("aaaAAAaa", "bbBBBBbbb"); } | public static KeyPair rsaKeyPairFromBase64(String publicKey, String privateKey) throws GeneralSecurityException { try { byte[] pubKeyBytes = Base64.decodeBase64(publicKey.getBytes("US-ASCII")); byte[] privKeyBytes = Base64.decodeBase64(privateKey.getBytes("US-ASCII")); X509EncodedKeySpec pubKeySpec = new X509EncodedKey... | KeyUtils { public static KeyPair rsaKeyPairFromBase64(String publicKey, String privateKey) throws GeneralSecurityException { try { byte[] pubKeyBytes = Base64.decodeBase64(publicKey.getBytes("US-ASCII")); byte[] privKeyBytes = Base64.decodeBase64(privateKey.getBytes("US-ASCII")); X509EncodedKeySpec pubKeySpec = new X50... | KeyUtils { public static KeyPair rsaKeyPairFromBase64(String publicKey, String privateKey) throws GeneralSecurityException { try { byte[] pubKeyBytes = Base64.decodeBase64(publicKey.getBytes("US-ASCII")); byte[] privKeyBytes = Base64.decodeBase64(privateKey.getBytes("US-ASCII")); X509EncodedKeySpec pubKeySpec = new X50... | KeyUtils { public static KeyPair rsaKeyPairFromBase64(String publicKey, String privateKey) throws GeneralSecurityException { try { byte[] pubKeyBytes = Base64.decodeBase64(publicKey.getBytes("US-ASCII")); byte[] privKeyBytes = Base64.decodeBase64(privateKey.getBytes("US-ASCII")); X509EncodedKeySpec pubKeySpec = new X50... | KeyUtils { public static KeyPair rsaKeyPairFromBase64(String publicKey, String privateKey) throws GeneralSecurityException { try { byte[] pubKeyBytes = Base64.decodeBase64(publicKey.getBytes("US-ASCII")); byte[] privKeyBytes = Base64.decodeBase64(privateKey.getBytes("US-ASCII")); X509EncodedKeySpec pubKeySpec = new X50... |
@Test(expected=GeneralSecurityException.class) public void testEncryptBadKey() throws GeneralSecurityException { KeyGenerator kg; try { if(provider != null) { kg = KeyGenerator.getInstance("AES", provider); } else { kg = KeyGenerator.getInstance("AES"); } } catch(NoSuchAlgorithmException e) { throw new RuntimeException... | public static String encryptKey(SecretKey key, Provider provider, PublicKey publicKey) throws GeneralSecurityException { Cipher cipher = null; if(provider != null) { cipher = Cipher.getInstance(TransformConstants.KEY_ENCRYPTION_TRANSFORM, provider); } else { cipher = Cipher.getInstance(TransformConstants.KEY_ENCRYPTION... | KeyUtils { public static String encryptKey(SecretKey key, Provider provider, PublicKey publicKey) throws GeneralSecurityException { Cipher cipher = null; if(provider != null) { cipher = Cipher.getInstance(TransformConstants.KEY_ENCRYPTION_TRANSFORM, provider); } else { cipher = Cipher.getInstance(TransformConstants.KEY... | KeyUtils { public static String encryptKey(SecretKey key, Provider provider, PublicKey publicKey) throws GeneralSecurityException { Cipher cipher = null; if(provider != null) { cipher = Cipher.getInstance(TransformConstants.KEY_ENCRYPTION_TRANSFORM, provider); } else { cipher = Cipher.getInstance(TransformConstants.KEY... | KeyUtils { public static String encryptKey(SecretKey key, Provider provider, PublicKey publicKey) throws GeneralSecurityException { Cipher cipher = null; if(provider != null) { cipher = Cipher.getInstance(TransformConstants.KEY_ENCRYPTION_TRANSFORM, provider); } else { cipher = Cipher.getInstance(TransformConstants.KEY... | KeyUtils { public static String encryptKey(SecretKey key, Provider provider, PublicKey publicKey) throws GeneralSecurityException { Cipher cipher = null; if(provider != null) { cipher = Cipher.getInstance(TransformConstants.KEY_ENCRYPTION_TRANSFORM, provider); } else { cipher = Cipher.getInstance(TransformConstants.KEY... |
@Test public void testRejectSmallKey() throws Exception { BasicEncryptionTransformFactory factory = new BasicEncryptionTransformFactory(); factory.setCryptoProvider(provider); KeyPair smallKey = null; try { smallKey = KeyUtils.rsaKeyPairFromBase64( keyprops.getProperty("smallkey.public"), keyprops.getProperty("smallkey... | public void setMasterEncryptionKey(KeyPair pair) { if (!(pair.getPublic() instanceof RSAPublicKey)) { throw new IllegalArgumentException( "Only RSA KeyPairs are allowed, not " + pair.getPublic().getAlgorithm()); } checkKeyLength(pair); this.masterEncryptionKey = pair; try { this.masterEncryptionKeyFingerprint = KeyUtil... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public void setMasterEncryptionKey(KeyPair pair) { if (!(pair.getPublic() instanceof RSAPublicKey)) { throw new IllegalArgumentException( "Only RSA KeyPairs are allowed, not " + pa... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public void setMasterEncryptionKey(KeyPair pair) { if (!(pair.getPublic() instanceof RSAPublicKey)) { throw new IllegalArgumentException( "Only RSA KeyPairs are allowed, not " + pa... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public void setMasterEncryptionKey(KeyPair pair) { if (!(pair.getPublic() instanceof RSAPublicKey)) { throw new IllegalArgumentException( "Only RSA KeyPairs are allowed, not " + pa... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public void setMasterEncryptionKey(KeyPair pair) { if (!(pair.getPublic() instanceof RSAPublicKey)) { throw new IllegalArgumentException( "Only RSA KeyPairs are allowed, not " + pa... |
@Test public void testSetMasterEncryptionKey() throws Exception { BasicEncryptionTransformFactory factory = new BasicEncryptionTransformFactory(); factory.setCryptoProvider(provider); factory.setMasterEncryptionKey(masterKey); } | public void setMasterEncryptionKey(KeyPair pair) { if (!(pair.getPublic() instanceof RSAPublicKey)) { throw new IllegalArgumentException( "Only RSA KeyPairs are allowed, not " + pair.getPublic().getAlgorithm()); } checkKeyLength(pair); this.masterEncryptionKey = pair; try { this.masterEncryptionKeyFingerprint = KeyUtil... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public void setMasterEncryptionKey(KeyPair pair) { if (!(pair.getPublic() instanceof RSAPublicKey)) { throw new IllegalArgumentException( "Only RSA KeyPairs are allowed, not " + pa... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public void setMasterEncryptionKey(KeyPair pair) { if (!(pair.getPublic() instanceof RSAPublicKey)) { throw new IllegalArgumentException( "Only RSA KeyPairs are allowed, not " + pa... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public void setMasterEncryptionKey(KeyPair pair) { if (!(pair.getPublic() instanceof RSAPublicKey)) { throw new IllegalArgumentException( "Only RSA KeyPairs are allowed, not " + pa... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public void setMasterEncryptionKey(KeyPair pair) { if (!(pair.getPublic() instanceof RSAPublicKey)) { throw new IllegalArgumentException( "Only RSA KeyPairs are allowed, not " + pa... |
@Test public void testAddMasterDecryptionKey() throws Exception { BasicEncryptionTransformFactory factory = new BasicEncryptionTransformFactory(); factory.setCryptoProvider(provider); factory.setMasterEncryptionKey(masterKey); factory.addMasterDecryptionKey(oldKey); } | public void addMasterDecryptionKey(KeyPair pair) { try { String fingerprint = KeyUtils .getRsaPublicKeyFingerprint((RSAPublicKey) pair.getPublic(), provider); masterDecryptionKeys.put(fingerprint, pair); } catch (NoSuchAlgorithmException e) { throw new RuntimeException("Error adding master key", e); } } | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public void addMasterDecryptionKey(KeyPair pair) { try { String fingerprint = KeyUtils .getRsaPublicKeyFingerprint((RSAPublicKey) pair.getPublic(), provider); masterDecryptionKeys.... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public void addMasterDecryptionKey(KeyPair pair) { try { String fingerprint = KeyUtils .getRsaPublicKeyFingerprint((RSAPublicKey) pair.getPublic(), provider); masterDecryptionKeys.... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public void addMasterDecryptionKey(KeyPair pair) { try { String fingerprint = KeyUtils .getRsaPublicKeyFingerprint((RSAPublicKey) pair.getPublic(), provider); masterDecryptionKeys.... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public void addMasterDecryptionKey(KeyPair pair) { try { String fingerprint = KeyUtils .getRsaPublicKeyFingerprint((RSAPublicKey) pair.getPublic(), provider); masterDecryptionKeys.... |
@Test public void testGetInputTransform() throws Exception { Map<String, String> objectMetadata = new HashMap<String, String>(); objectMetadata.put("x-emc-enc-object-key", "holbhxpDq92g0dPRuqmtAt23KaNSm3JjKULdzadKdJyn3SINDSbaHnjmDU/Aa5pNSmq8ij+RWdkBlsrk9g6m/tjQm1gMPbeW+IhWJhInL0Mvsa+olZ+cLkztnKz/yHQ6vj9R0m8OboATweV1TTk... | @Override public BasicEncryptionInputTransform getInputTransform( String transformConfig, InputStream streamToDecode, Map<String, String> metadata) throws IOException, TransformException { String[] transformTuple = splitTransformConfig(transformConfig); if (transformTuple.length != 2) { throw new TransformException("In... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public BasicEncryptionInputTransform getInputTransform( String transformConfig, InputStream streamToDecode, Map<String, String> metadata) throws IOException, TransformExc... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public BasicEncryptionInputTransform getInputTransform( String transformConfig, InputStream streamToDecode, Map<String, String> metadata) throws IOException, TransformExc... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public BasicEncryptionInputTransform getInputTransform( String transformConfig, InputStream streamToDecode, Map<String, String> metadata) throws IOException, TransformExc... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public BasicEncryptionInputTransform getInputTransform( String transformConfig, InputStream streamToDecode, Map<String, String> metadata) throws IOException, TransformExc... |
@Test public void testRejectNonRsaMasterKey() throws Exception { KeyPairGenerator keyGenerator = KeyPairGenerator.getInstance("DSA"); keyGenerator.initialize(512, new SecureRandom()); KeyPair myKeyPair = keyGenerator.generateKeyPair(); BasicEncryptionTransformFactory factory = new BasicEncryptionTransformFactory(); fac... | public void setMasterEncryptionKey(KeyPair pair) { if (!(pair.getPublic() instanceof RSAPublicKey)) { throw new IllegalArgumentException( "Only RSA KeyPairs are allowed, not " + pair.getPublic().getAlgorithm()); } checkKeyLength(pair); this.masterEncryptionKey = pair; try { this.masterEncryptionKeyFingerprint = KeyUtil... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public void setMasterEncryptionKey(KeyPair pair) { if (!(pair.getPublic() instanceof RSAPublicKey)) { throw new IllegalArgumentException( "Only RSA KeyPairs are allowed, not " + pa... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public void setMasterEncryptionKey(KeyPair pair) { if (!(pair.getPublic() instanceof RSAPublicKey)) { throw new IllegalArgumentException( "Only RSA KeyPairs are allowed, not " + pa... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public void setMasterEncryptionKey(KeyPair pair) { if (!(pair.getPublic() instanceof RSAPublicKey)) { throw new IllegalArgumentException( "Only RSA KeyPairs are allowed, not " + pa... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public void setMasterEncryptionKey(KeyPair pair) { if (!(pair.getPublic() instanceof RSAPublicKey)) { throw new IllegalArgumentException( "Only RSA KeyPairs are allowed, not " + pa... |
@Test public void testRekey() throws Exception { BasicEncryptionTransformFactory factory = new BasicEncryptionTransformFactory(); factory.setCryptoProvider(provider); factory.setMasterEncryptionKey(oldKey); ByteArrayOutputStream out = new ByteArrayOutputStream(); Map<String, String> metadata = new HashMap<String, Strin... | @Override public Map<String, String> rekey(Map<String, String> metadata) throws TransformException { String oldKeyId = metadata .get(TransformConstants.META_ENCRYPTION_KEY_ID); if (oldKeyId == null) { throw new TransformException( "Metadata does not contain a master key ID"); } if (oldKeyId.equals(masterEncryptionKeyFi... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public Map<String, String> rekey(Map<String, String> metadata) throws TransformException { String oldKeyId = metadata .get(TransformConstants.META_ENCRYPTION_KEY_ID); if ... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public Map<String, String> rekey(Map<String, String> metadata) throws TransformException { String oldKeyId = metadata .get(TransformConstants.META_ENCRYPTION_KEY_ID); if ... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public Map<String, String> rekey(Map<String, String> metadata) throws TransformException { String oldKeyId = metadata .get(TransformConstants.META_ENCRYPTION_KEY_ID); if ... | BasicEncryptionTransformFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public Map<String, String> rekey(Map<String, String> metadata) throws TransformException { String oldKeyId = metadata .get(TransformConstants.META_ENCRYPTION_KEY_ID); if ... |
@Test public void testGetTransformClass() { CompressionTransformFactory factory = new CompressionTransformFactory(); assertEquals(TransformConstants.COMPRESSION_CLASS, factory.getTransformClass()); } | @Override public String getTransformClass() { return TransformConstants.COMPRESSION_CLASS; } | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { @Override public String getTransformClass() { return TransformConstants.COMPRESSION_CLASS; } } | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { @Override public String getTransformClass() { return TransformConstants.COMPRESSION_CLASS; } CompressionTransformFactory(); } | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { @Override public String getTransformClass() { return TransformConstants.COMPRESSION_CLASS; } CompressionTransformFactory(); CompressionMode getCompressMode(); void setCompressMode(CompressionMode compre... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { @Override public String getTransformClass() { return TransformConstants.COMPRESSION_CLASS; } CompressionTransformFactory(); CompressionMode getCompressMode(); void setCompressMode(CompressionMode compre... |
@Test public void testGetCompressMode() { CompressionTransformFactory factory = new CompressionTransformFactory(); assertEquals("default mode incorrect", CompressionMode.Deflate, factory.getCompressMode()); } | public CompressionMode getCompressMode() { return compressMode; } | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public CompressionMode getCompressMode() { return compressMode; } } | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public CompressionMode getCompressMode() { return compressMode; } CompressionTransformFactory(); } | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public CompressionMode getCompressMode() { return compressMode; } CompressionTransformFactory(); CompressionMode getCompressMode(); void setCompressMode(CompressionMode compressMode); int getCompression... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public CompressionMode getCompressMode() { return compressMode; } CompressionTransformFactory(); CompressionMode getCompressMode(); void setCompressMode(CompressionMode compressMode); int getCompression... |
@Test public void testDataNodesResult() throws Exception { String rawXml = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n" + " <ListDataNode xmlns=\"http: " <DataNodes> 10.247.102.239</DataNodes>\n" + " <DataNodes>10.247.102.240</DataNodes>\n" + " <DataNodes>10.247.102.241 </DataNodes>\n" + " <Version... | public ListDataNodesResultHandler parseListDataNodeResult(InputStream inputStream) throws AmazonClientException { ListDataNodesResultHandler handler = new ListDataNodesResultHandler(); parseXmlInputStream(handler, inputStream); return handler; } | ViPRResponsesSaxParser extends XmlResponsesSaxParser { public ListDataNodesResultHandler parseListDataNodeResult(InputStream inputStream) throws AmazonClientException { ListDataNodesResultHandler handler = new ListDataNodesResultHandler(); parseXmlInputStream(handler, inputStream); return handler; } } | ViPRResponsesSaxParser extends XmlResponsesSaxParser { public ListDataNodesResultHandler parseListDataNodeResult(InputStream inputStream) throws AmazonClientException { ListDataNodesResultHandler handler = new ListDataNodesResultHandler(); parseXmlInputStream(handler, inputStream); return handler; } } | ViPRResponsesSaxParser extends XmlResponsesSaxParser { public ListDataNodesResultHandler parseListDataNodeResult(InputStream inputStream) throws AmazonClientException { ListDataNodesResultHandler handler = new ListDataNodesResultHandler(); parseXmlInputStream(handler, inputStream); return handler; } FileAccessResultHa... | ViPRResponsesSaxParser extends XmlResponsesSaxParser { public ListDataNodesResultHandler parseListDataNodeResult(InputStream inputStream) throws AmazonClientException { ListDataNodesResultHandler handler = new ListDataNodesResultHandler(); parseXmlInputStream(handler, inputStream); return handler; } FileAccessResultHa... |
@Test public void testSetCompressMode() { CompressionTransformFactory factory = new CompressionTransformFactory(); factory.setCompressMode(CompressionMode.LZMA); assertEquals("mode incorrect", CompressionMode.LZMA, factory.getCompressMode()); } | public void setCompressMode(CompressionMode compressMode) { this.compressMode = compressMode; } | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public void setCompressMode(CompressionMode compressMode) { this.compressMode = compressMode; } } | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public void setCompressMode(CompressionMode compressMode) { this.compressMode = compressMode; } CompressionTransformFactory(); } | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public void setCompressMode(CompressionMode compressMode) { this.compressMode = compressMode; } CompressionTransformFactory(); CompressionMode getCompressMode(); void setCompressMode(CompressionMode com... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public void setCompressMode(CompressionMode compressMode) { this.compressMode = compressMode; } CompressionTransformFactory(); CompressionMode getCompressMode(); void setCompressMode(CompressionMode com... |
@Test public void testGetCompressionLevel() { CompressionTransformFactory factory = new CompressionTransformFactory(); assertEquals("Default compression level incorrect", 5, factory.getCompressionLevel()); } | public int getCompressionLevel() { return compressionLevel; } | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public int getCompressionLevel() { return compressionLevel; } } | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public int getCompressionLevel() { return compressionLevel; } CompressionTransformFactory(); } | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public int getCompressionLevel() { return compressionLevel; } CompressionTransformFactory(); CompressionMode getCompressMode(); void setCompressMode(CompressionMode compressMode); int getCompressionLeve... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public int getCompressionLevel() { return compressionLevel; } CompressionTransformFactory(); CompressionMode getCompressMode(); void setCompressMode(CompressionMode compressMode); int getCompressionLeve... |
@Test public void testSetCompressionLevel() { CompressionTransformFactory factory = new CompressionTransformFactory(); for(int i=0; i<10; i++) { factory.setCompressionLevel(i); assertEquals("Compression level did not set correctly", i, factory.getCompressionLevel()); } checkInvalidCompression(factory, CompressionMode.D... | public void setCompressionLevel(int compressionLevel) { this.compressionLevel = compressionLevel; } | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public void setCompressionLevel(int compressionLevel) { this.compressionLevel = compressionLevel; } } | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public void setCompressionLevel(int compressionLevel) { this.compressionLevel = compressionLevel; } CompressionTransformFactory(); } | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public void setCompressionLevel(int compressionLevel) { this.compressionLevel = compressionLevel; } CompressionTransformFactory(); CompressionMode getCompressMode(); void setCompressMode(CompressionMode... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public void setCompressionLevel(int compressionLevel) { this.compressionLevel = compressionLevel; } CompressionTransformFactory(); CompressionMode getCompressMode(); void setCompressMode(CompressionMode... |
@Test public void testGetOutputTransform() throws IOException { CompressionTransformFactory factory = new CompressionTransformFactory(); CompressionOutputTransform t = factory.getOutputTransform(new ByteArrayOutputStream(), new HashMap<String, String>()); assertNotNull("output transform null", t); } | @Override public CompressionOutputTransform getOutputTransform( OutputStream streamToEncodeTo, Map<String, String> metadataToEncode) throws IOException { switch(compressMode) { case Deflate: return new DeflateOutputTransform(streamToEncodeTo, metadataToEncode, compressionLevel); case LZMA: return new LZMAOutputTransfor... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { @Override public CompressionOutputTransform getOutputTransform( OutputStream streamToEncodeTo, Map<String, String> metadataToEncode) throws IOException { switch(compressMode) { case Deflate: return new ... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { @Override public CompressionOutputTransform getOutputTransform( OutputStream streamToEncodeTo, Map<String, String> metadataToEncode) throws IOException { switch(compressMode) { case Deflate: return new ... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { @Override public CompressionOutputTransform getOutputTransform( OutputStream streamToEncodeTo, Map<String, String> metadataToEncode) throws IOException { switch(compressMode) { case Deflate: return new ... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { @Override public CompressionOutputTransform getOutputTransform( OutputStream streamToEncodeTo, Map<String, String> metadataToEncode) throws IOException { switch(compressMode) { case Deflate: return new ... |
@Test public void testGetInputTransform() throws IOException { CompressionTransformFactory factory = new CompressionTransformFactory(); byte[] lzmaConfig = new byte[] { 0, 0, 0, 0, 0 }; CompressionInputTransform t = factory.getInputTransform("COMP:LZMA/9", new ByteArrayInputStream(lzmaConfig), new HashMap<String, Strin... | @Override public CompressionInputTransform getInputTransform(String transformConfig, InputStream streamToDecode, Map<String, String> metadata) throws IOException { String[] transformTuple = splitTransformConfig(transformConfig); if(!TransformConstants.COMPRESSION_CLASS.equals(transformTuple[0])) { throw new IllegalArgu... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { @Override public CompressionInputTransform getInputTransform(String transformConfig, InputStream streamToDecode, Map<String, String> metadata) throws IOException { String[] transformTuple = splitTransfo... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { @Override public CompressionInputTransform getInputTransform(String transformConfig, InputStream streamToDecode, Map<String, String> metadata) throws IOException { String[] transformTuple = splitTransfo... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { @Override public CompressionInputTransform getInputTransform(String transformConfig, InputStream streamToDecode, Map<String, String> metadata) throws IOException { String[] transformTuple = splitTransfo... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { @Override public CompressionInputTransform getInputTransform(String transformConfig, InputStream streamToDecode, Map<String, String> metadata) throws IOException { String[] transformTuple = splitTransfo... |
@Test public void testCanDecode() { CompressionTransformFactory factory = new CompressionTransformFactory(); checkDecode(factory, "COMP", "LZMA/9", true); checkDecode(factory, "COMP", "Deflate/5", true); checkDecode(factory, "COMP", "Deflate", true); checkDecode(factory, "COMP", "", false); checkDecode(factory, "COMP",... | public boolean canDecode(String transformClass, String config, Map<String,String> metadata) { if(config == null) { logger.warn("Configuration string null"); return false; } String[] configParams = config.split("/"); if(configParams.length < 1) { logger.warn("Could not decode config string {}", config); return false; } ... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public boolean canDecode(String transformClass, String config, Map<String,String> metadata) { if(config == null) { logger.warn("Configuration string null"); return false; } String[] configParams = confi... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public boolean canDecode(String transformClass, String config, Map<String,String> metadata) { if(config == null) { logger.warn("Configuration string null"); return false; } String[] configParams = confi... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public boolean canDecode(String transformClass, String config, Map<String,String> metadata) { if(config == null) { logger.warn("Configuration string null"); return false; } String[] configParams = confi... | CompressionTransformFactory extends
TransformFactory<CompressionOutputTransform, CompressionInputTransform> { public boolean canDecode(String transformClass, String config, Map<String,String> metadata) { if(config == null) { logger.warn("Configuration string null"); return false; } String[] configParams = confi... |
@Test public void testRead() throws Exception { InputStream decompressed = new LZMAInputStream(compressedData); int in1, in2; long offset = 0; while((in1 = uncompressedData.read()) != -1) { in2 = decompressed.read(); assertEquals("Mismatch at offset " + offset, in1, in2); offset++; } in2 = decompressed.read(); assertEq... | @Override public int read() throws IOException { checkStream(); try { return uncompressedPipeIn.read(); } catch(IOException e) { if(getDecompressionComplete()) { return -1; } throw e; } } | LZMAInputStream extends InputStream implements Runnable { @Override public int read() throws IOException { checkStream(); try { return uncompressedPipeIn.read(); } catch(IOException e) { if(getDecompressionComplete()) { return -1; } throw e; } } } | LZMAInputStream extends InputStream implements Runnable { @Override public int read() throws IOException { checkStream(); try { return uncompressedPipeIn.read(); } catch(IOException e) { if(getDecompressionComplete()) { return -1; } throw e; } } LZMAInputStream(InputStream compressedStream); LZMAInputStream(InputStrea... | LZMAInputStream extends InputStream implements Runnable { @Override public int read() throws IOException { checkStream(); try { return uncompressedPipeIn.read(); } catch(IOException e) { if(getDecompressionComplete()) { return -1; } throw e; } } LZMAInputStream(InputStream compressedStream); LZMAInputStream(InputStrea... | LZMAInputStream extends InputStream implements Runnable { @Override public int read() throws IOException { checkStream(); try { return uncompressedPipeIn.read(); } catch(IOException e) { if(getDecompressionComplete()) { return -1; } throw e; } } LZMAInputStream(InputStream compressedStream); LZMAInputStream(InputStrea... |
@Test public void testSkip() throws Exception { InputStream decompressed = new LZMAInputStream(compressedData); int in1, in2; long offset = 0; while((in1 = uncompressedData.read()) != -1) { in2 = decompressed.read(); assertEquals("Mismatch at offset " + offset, in1, in2); long offset1 = uncompressedData.skip(7); long o... | @Override public long skip(long n) throws IOException { checkStream(); try { return uncompressedPipeIn.skip(n); } catch(IOException e) { if(getDecompressionComplete()) { return -1; } throw e; } } | LZMAInputStream extends InputStream implements Runnable { @Override public long skip(long n) throws IOException { checkStream(); try { return uncompressedPipeIn.skip(n); } catch(IOException e) { if(getDecompressionComplete()) { return -1; } throw e; } } } | LZMAInputStream extends InputStream implements Runnable { @Override public long skip(long n) throws IOException { checkStream(); try { return uncompressedPipeIn.skip(n); } catch(IOException e) { if(getDecompressionComplete()) { return -1; } throw e; } } LZMAInputStream(InputStream compressedStream); LZMAInputStream(In... | LZMAInputStream extends InputStream implements Runnable { @Override public long skip(long n) throws IOException { checkStream(); try { return uncompressedPipeIn.skip(n); } catch(IOException e) { if(getDecompressionComplete()) { return -1; } throw e; } } LZMAInputStream(InputStream compressedStream); LZMAInputStream(In... | LZMAInputStream extends InputStream implements Runnable { @Override public long skip(long n) throws IOException { checkStream(); try { return uncompressedPipeIn.skip(n); } catch(IOException e) { if(getDecompressionComplete()) { return -1; } throw e; } } LZMAInputStream(InputStream compressedStream); LZMAInputStream(In... |
@Test public void testMarkSupported() throws Exception { InputStream decompressed = new LZMAInputStream(compressedData); assertFalse(decompressed.markSupported()); decompressed.close(); } | @Override public boolean markSupported() { return false; } | LZMAInputStream extends InputStream implements Runnable { @Override public boolean markSupported() { return false; } } | LZMAInputStream extends InputStream implements Runnable { @Override public boolean markSupported() { return false; } LZMAInputStream(InputStream compressedStream); LZMAInputStream(InputStream compressedStream, int bufferSize); } | LZMAInputStream extends InputStream implements Runnable { @Override public boolean markSupported() { return false; } LZMAInputStream(InputStream compressedStream); LZMAInputStream(InputStream compressedStream, int bufferSize); @Override int read(); @Override int available(); @Override void close(); @Override boolean m... | LZMAInputStream extends InputStream implements Runnable { @Override public boolean markSupported() { return false; } LZMAInputStream(InputStream compressedStream); LZMAInputStream(InputStream compressedStream, int bufferSize); @Override int read(); @Override int available(); @Override void close(); @Override boolean m... |
@Test public void testWrite() throws Exception { ByteArrayOutputStream compressedData = new ByteArrayOutputStream(); DeflateOutputStream out = new DeflateOutputStream(compressedData, 5); out.write(data); try { out.getStreamMetadata(); fail("Should have thrown IllegalStateException that stream was not closed yet."); } c... | @Override public void write(int b) throws IOException { digester.write(b); } | DeflateOutputStream extends OutputStream implements CompressionStream { @Override public void write(int b) throws IOException { digester.write(b); } } | DeflateOutputStream extends OutputStream implements CompressionStream { @Override public void write(int b) throws IOException { digester.write(b); } DeflateOutputStream(OutputStream streamToCompress, int level); } | DeflateOutputStream extends OutputStream implements CompressionStream { @Override public void write(int b) throws IOException { digester.write(b); } DeflateOutputStream(OutputStream streamToCompress, int level); @Override Map<String, String> getStreamMetadata(); @Override void write(int b); @Override void close(); @Ove... | DeflateOutputStream extends OutputStream implements CompressionStream { @Override public void write(int b) throws IOException { digester.write(b); } DeflateOutputStream(OutputStream streamToCompress, int level); @Override Map<String, String> getStreamMetadata(); @Override void write(int b); @Override void close(); @Ove... |
@Test public void testRekey() throws Exception { KeyStoreEncryptionFactory factory = new KeyStoreEncryptionFactory(keystore, "oldkey", keystorePassword.toCharArray(), provider); ByteArrayOutputStream out = new ByteArrayOutputStream(); Map<String, String> metadata = new HashMap<String, String>(); metadata.put("name1", "... | @Override public Map<String, String> rekey(Map<String, String> metadata) throws TransformException, DoesNotNeedRekeyException{ String oldKeyId = metadata .get(TransformConstants.META_ENCRYPTION_KEY_ID); if (oldKeyId == null) { throw new TransformException( "Metadata does not contain a master key ID"); } if (oldKeyId.eq... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public Map<String, String> rekey(Map<String, String> metadata) throws TransformException, DoesNotNeedRekeyException{ String oldKeyId = metadata .get(TransformConstants.META_ENC... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public Map<String, String> rekey(Map<String, String> metadata) throws TransformException, DoesNotNeedRekeyException{ String oldKeyId = metadata .get(TransformConstants.META_ENC... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public Map<String, String> rekey(Map<String, String> metadata) throws TransformException, DoesNotNeedRekeyException{ String oldKeyId = metadata .get(TransformConstants.META_ENC... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public Map<String, String> rekey(Map<String, String> metadata) throws TransformException, DoesNotNeedRekeyException{ String oldKeyId = metadata .get(TransformConstants.META_ENC... |
@Test public void testCompressionMetadata() throws Exception { LZMACompressionFilter lzma = runCompressMode(new LzmaProfile(16 * 1024, 128, Encoder.EMatchFinderTypeBT2)); Map<String, String> m = lzma.getStreamMetadata(); assertEquals("Uncompressed digest incorrect", "027e997e6b1dfc97b93eb28dc9a6804096d85873", m.get(Tra... | @Override public Map<String, String> getStreamMetadata() { if(!closed) { throw new IllegalStateException("Stream must be closed before getting metadata"); } Map<String,String> metadata = new HashMap<String, String>(); long compSize = compressedSize.getByteCount(); long uncompSize = uncompressedSize.getByteCount(); Stri... | LZMACompressionFilter extends InputStream implements CompressionStream, Runnable { @Override public Map<String, String> getStreamMetadata() { if(!closed) { throw new IllegalStateException("Stream must be closed before getting metadata"); } Map<String,String> metadata = new HashMap<String, String>(); long compSize = com... | LZMACompressionFilter extends InputStream implements CompressionStream, Runnable { @Override public Map<String, String> getStreamMetadata() { if(!closed) { throw new IllegalStateException("Stream must be closed before getting metadata"); } Map<String,String> metadata = new HashMap<String, String>(); long compSize = com... | LZMACompressionFilter extends InputStream implements CompressionStream, Runnable { @Override public Map<String, String> getStreamMetadata() { if(!closed) { throw new IllegalStateException("Stream must be closed before getting metadata"); } Map<String,String> metadata = new HashMap<String, String>(); long compSize = com... | LZMACompressionFilter extends InputStream implements CompressionStream, Runnable { @Override public Map<String, String> getStreamMetadata() { if(!closed) { throw new IllegalStateException("Stream must be closed before getting metadata"); } Map<String,String> metadata = new HashMap<String, String>(); long compSize = com... |
@Test public void testCompressionMetadata() throws Exception { LZMAOutputStream lzma = runCompressMode(new LzmaProfile(16 * 1024, 128, Encoder.EMatchFinderTypeBT2)); Map<String, String> m = lzma.getStreamMetadata(); assertEquals("Uncompressed digest incorrect", "027e997e6b1dfc97b93eb28dc9a6804096d85873", m.get(Transfor... | @Override public Map<String, String> getStreamMetadata() { if(!closed) { throw new IllegalStateException("Stream must be closed before getting metadata"); } Map<String,String> metadata = new HashMap<String, String>(); long compSize = compressedOutput.getByteCount(); long uncompSize = uncompressedSize.getByteCount(); St... | LZMAOutputStream extends OutputStream implements CompressionStream, Runnable { @Override public Map<String, String> getStreamMetadata() { if(!closed) { throw new IllegalStateException("Stream must be closed before getting metadata"); } Map<String,String> metadata = new HashMap<String, String>(); long compSize = compres... | LZMAOutputStream extends OutputStream implements CompressionStream, Runnable { @Override public Map<String, String> getStreamMetadata() { if(!closed) { throw new IllegalStateException("Stream must be closed before getting metadata"); } Map<String,String> metadata = new HashMap<String, String>(); long compSize = compres... | LZMAOutputStream extends OutputStream implements CompressionStream, Runnable { @Override public Map<String, String> getStreamMetadata() { if(!closed) { throw new IllegalStateException("Stream must be closed before getting metadata"); } Map<String,String> metadata = new HashMap<String, String>(); long compSize = compres... | LZMAOutputStream extends OutputStream implements CompressionStream, Runnable { @Override public Map<String, String> getStreamMetadata() { if(!closed) { throw new IllegalStateException("Stream must be closed before getting metadata"); } Map<String,String> metadata = new HashMap<String, String>(); long compSize = compres... |
@Test public void testKeyStoreEncryptionFactory() throws Exception { try { new KeyStoreEncryptionFactory(keystore, "NoKey", keystorePassword.toCharArray(), provider); fail("Should not init with invalid key alias"); } catch(InvalidKeyException e) { } } | public KeyStoreEncryptionFactory(KeyStore keyStore, String masterEncryptionKeyAlias, char[] keyStorePassword) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, TransformException { this(keyStore, masterEncryptionKeyAlias, keyStorePassword, null); } | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public KeyStoreEncryptionFactory(KeyStore keyStore, String masterEncryptionKeyAlias, char[] keyStorePassword) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public KeyStoreEncryptionFactory(KeyStore keyStore, String masterEncryptionKeyAlias, char[] keyStorePassword) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public KeyStoreEncryptionFactory(KeyStore keyStore, String masterEncryptionKeyAlias, char[] keyStorePassword) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public KeyStoreEncryptionFactory(KeyStore keyStore, String masterEncryptionKeyAlias, char[] keyStorePassword) throws InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException... |
@Test public void testGetOutputTransform() throws Exception { KeyStoreEncryptionFactory factory = new KeyStoreEncryptionFactory(keystore, keyAlias, keystorePassword.toCharArray(), provider); ByteArrayOutputStream out = new ByteArrayOutputStream(); Map<String, String> metadata = new HashMap<String, String>(); metadata.p... | @Override public BasicEncryptionOutputTransform getOutputTransform( OutputStream streamToEncodeTo, Map<String, String> metadataToEncode) throws IOException, TransformException { KeyPair asymmetricKey = getKeyPair(masterEncryptionKeyAlias); return new BasicEncryptionOutputTransform(streamToEncodeTo, metadataToEncode, ma... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public BasicEncryptionOutputTransform getOutputTransform( OutputStream streamToEncodeTo, Map<String, String> metadataToEncode) throws IOException, TransformException { KeyPair ... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public BasicEncryptionOutputTransform getOutputTransform( OutputStream streamToEncodeTo, Map<String, String> metadataToEncode) throws IOException, TransformException { KeyPair ... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public BasicEncryptionOutputTransform getOutputTransform( OutputStream streamToEncodeTo, Map<String, String> metadataToEncode) throws IOException, TransformException { KeyPair ... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public BasicEncryptionOutputTransform getOutputTransform( OutputStream streamToEncodeTo, Map<String, String> metadataToEncode) throws IOException, TransformException { KeyPair ... |
@Test public void testGetInputTransform() throws Exception { Map<String, String> objectMetadata = new HashMap<String, String>(); objectMetadata.put("x-emc-enc-object-key", "iyuQuDL9qsfZk2XqnRihfw8ejr+OcrsflXvYD1I5o/Bw+wZPkY4Fm6py8ng25K/iw6kO0zbqq5v5Ywkng0pgrUdHLyR6Aq/dD0vKTK46E6sHZKknlM7NSixR8qaieBwwc2QnhOzyFPIVWSgwo9T... | @Override public BasicEncryptionInputTransform getInputTransform( String transformConfig, InputStream streamToDecode, Map<String, String> metadata) throws IOException, TransformException { String[] transformTuple = splitTransformConfig(transformConfig); if (transformTuple.length != 2) { throw new TransformException("In... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public BasicEncryptionInputTransform getInputTransform( String transformConfig, InputStream streamToDecode, Map<String, String> metadata) throws IOException, TransformException... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public BasicEncryptionInputTransform getInputTransform( String transformConfig, InputStream streamToDecode, Map<String, String> metadata) throws IOException, TransformException... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public BasicEncryptionInputTransform getInputTransform( String transformConfig, InputStream streamToDecode, Map<String, String> metadata) throws IOException, TransformException... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { @Override public BasicEncryptionInputTransform getInputTransform( String transformConfig, InputStream streamToDecode, Map<String, String> metadata) throws IOException, TransformException... |
@Test public void testGetInputTransformNoCertSKI() throws Exception { KeyStoreEncryptionFactory factory = new KeyStoreEncryptionFactory(keystore, "masterkey2", keystorePassword.toCharArray(), provider); assertEquals("Wrong master key", "masterkey2", factory.getMasterEncryptionKeyAlias()); } | public String getMasterEncryptionKeyAlias() { return masterEncryptionKeyAlias; } | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public String getMasterEncryptionKeyAlias() { return masterEncryptionKeyAlias; } } | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public String getMasterEncryptionKeyAlias() { return masterEncryptionKeyAlias; } KeyStoreEncryptionFactory(KeyStore keyStore,
String masterEncryptionKeyAlias,
ch... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public String getMasterEncryptionKeyAlias() { return masterEncryptionKeyAlias; } KeyStoreEncryptionFactory(KeyStore keyStore,
String masterEncryptionKeyAlias,
ch... | KeyStoreEncryptionFactory extends
EncryptionTransformFactory<BasicEncryptionOutputTransform, BasicEncryptionInputTransform> { public String getMasterEncryptionKeyAlias() { return masterEncryptionKeyAlias; } KeyStoreEncryptionFactory(KeyStore keyStore,
String masterEncryptionKeyAlias,
ch... |
@Test public void testGetRsaPublicKeyFingerprint() throws NoSuchAlgorithmException { assertEquals("Key fingerprint invalid", "000317457b5645b7b5c4daf4cf6780c05438effd", KeyUtils.getRsaPublicKeyFingerprint((RSAPublicKey) masterKey .getPublic(), provider)); } | public static String getRsaPublicKeyFingerprint(RSAPublicKey pubKey, Provider provider) throws NoSuchAlgorithmException { byte[] pubkeyEnc = derEncodeRSAPublicKey(pubKey); MessageDigest sha1; if(provider != null) { sha1 = MessageDigest.getInstance("sha1", provider); } else { sha1 = MessageDigest.getInstance("sha1"); } ... | KeyUtils { public static String getRsaPublicKeyFingerprint(RSAPublicKey pubKey, Provider provider) throws NoSuchAlgorithmException { byte[] pubkeyEnc = derEncodeRSAPublicKey(pubKey); MessageDigest sha1; if(provider != null) { sha1 = MessageDigest.getInstance("sha1", provider); } else { sha1 = MessageDigest.getInstance(... | KeyUtils { public static String getRsaPublicKeyFingerprint(RSAPublicKey pubKey, Provider provider) throws NoSuchAlgorithmException { byte[] pubkeyEnc = derEncodeRSAPublicKey(pubKey); MessageDigest sha1; if(provider != null) { sha1 = MessageDigest.getInstance("sha1", provider); } else { sha1 = MessageDigest.getInstance(... | KeyUtils { public static String getRsaPublicKeyFingerprint(RSAPublicKey pubKey, Provider provider) throws NoSuchAlgorithmException { byte[] pubkeyEnc = derEncodeRSAPublicKey(pubKey); MessageDigest sha1; if(provider != null) { sha1 = MessageDigest.getInstance("sha1", provider); } else { sha1 = MessageDigest.getInstance(... | KeyUtils { public static String getRsaPublicKeyFingerprint(RSAPublicKey pubKey, Provider provider) throws NoSuchAlgorithmException { byte[] pubkeyEnc = derEncodeRSAPublicKey(pubKey); MessageDigest sha1; if(provider != null) { sha1 = MessageDigest.getInstance("sha1", provider); } else { sha1 = MessageDigest.getInstance(... |
@Test public void testToHexPadded() { byte[] dataWithoutZeroes = new byte[] { 0x11, 0x22, 0x33 }; assertEquals("Without zeroes incorrect", "112233", KeyUtils.toHexPadded(dataWithoutZeroes)); byte[] dataWithLeadingZero = new byte[] { 0x01, 0x22, 0x33 }; assertEquals("With leading zero incorrect", "012233", KeyUtils.toHe... | public static String toHexPadded(byte[] data) { BigInteger bi = new BigInteger(1, data); String s = bi.toString(16); while(s.length() < (data.length*2)) { s = "0" + s; } return s; } | KeyUtils { public static String toHexPadded(byte[] data) { BigInteger bi = new BigInteger(1, data); String s = bi.toString(16); while(s.length() < (data.length*2)) { s = "0" + s; } return s; } } | KeyUtils { public static String toHexPadded(byte[] data) { BigInteger bi = new BigInteger(1, data); String s = bi.toString(16); while(s.length() < (data.length*2)) { s = "0" + s; } return s; } } | KeyUtils { public static String toHexPadded(byte[] data) { BigInteger bi = new BigInteger(1, data); String s = bi.toString(16); while(s.length() < (data.length*2)) { s = "0" + s; } return s; } static String getRsaPublicKeyFingerprint(RSAPublicKey pubKey, Provider provider); static String toHexPadded(byte[] data); stat... | KeyUtils { public static String toHexPadded(byte[] data) { BigInteger bi = new BigInteger(1, data); String s = bi.toString(16); while(s.length() < (data.length*2)) { s = "0" + s; } return s; } static String getRsaPublicKeyFingerprint(RSAPublicKey pubKey, Provider provider); static String toHexPadded(byte[] data); stat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.