@Test public void validateAfterDownload_resultSizeIsTooBig_ValidationException() throws Exception { final AbbyyInput abbyyInput = mock(AbbyyInput.class); String resultMock = PowerMockito.mock(String.class); when(resultMock.getBytes()).thenReturn(new byte[(int)Limits.MAX_SIZE_OF_XML_FILE + 1]); ValidationException ex = this.sut.validateAfterDownload(abbyyInput, resultMock); assertNotNull(ex); }
@Override public ValidationException validateAfterDownload(@NotNull AbbyyInput abbyyInput, @NotNull String result) throws Exception { try { validateSizeAfterDownload(abbyyInput, result); validateAgainstXsdSchema(abbyyInput, result); return null; } catch (ValidationException ex) { return ex; } }
XmlResultValidator implements AbbyyResultValidator { @Override public ValidationException validateAfterDownload(@NotNull AbbyyInput abbyyInput, @NotNull String result) throws Exception { try { validateSizeAfterDownload(abbyyInput, result); validateAgainstXsdSchema(abbyyInput, result); return null; } catch (ValidationException ex) { return ex; } } }
XmlResultValidator implements AbbyyResultValidator { @Override public ValidationException validateAfterDownload(@NotNull AbbyyInput abbyyInput, @NotNull String result) throws Exception { try { validateSizeAfterDownload(abbyyInput, result); validateAgainstXsdSchema(abbyyInput, result); return null; } catch (ValidationException ex) { return ex; } } XmlResultValidator(@NotNull AbbyyApi abbyyApi, @NotNull String xsdSchemaPath); }
XmlResultValidator implements AbbyyResultValidator { @Override public ValidationException validateAfterDownload(@NotNull AbbyyInput abbyyInput, @NotNull String result) throws Exception { try { validateSizeAfterDownload(abbyyInput, result); validateAgainstXsdSchema(abbyyInput, result); return null; } catch (ValidationException ex) { return ex; } } XmlResultValidator(@NotNull AbbyyApi abbyyApi, @NotNull String xsdSchemaPath); @Override ValidationException validateBeforeDownload(@NotNull AbbyyInput abbyyInput, @NotNull String downloadUrl); @Override ValidationException validateAfterDownload(@NotNull AbbyyInput abbyyInput, @NotNull String result); }
XmlResultValidator implements AbbyyResultValidator { @Override public ValidationException validateAfterDownload(@NotNull AbbyyInput abbyyInput, @NotNull String result) throws Exception { try { validateSizeAfterDownload(abbyyInput, result); validateAgainstXsdSchema(abbyyInput, result); return null; } catch (ValidationException ex) { return ex; } } XmlResultValidator(@NotNull AbbyyApi abbyyApi, @NotNull String xsdSchemaPath); @Override ValidationException validateBeforeDownload(@NotNull AbbyyInput abbyyInput, @NotNull String downloadUrl); @Override ValidationException validateAfterDownload(@NotNull AbbyyInput abbyyInput, @NotNull String result);  }