@Test public void handleTaskCompleted_exportFormatsListDoesNotMatchResultUrls_exceptionThrown() throws Exception { ProcessTextFieldInput requestMock = mockAbbyyRequest(); AbbyyResponse responseMock = mockAbbyyResponse(); when(responseMock.getResultUrls()).thenReturn(Collections.<String>emptyList()); Map<String, String> resultsDummy = new HashMap<>(); try { this.sut.handleTaskCompleted(requestMock, responseMock, resultsDummy); fail(); } catch (AbbyySdkException ex) { assertTrue(ex.getMessage().contains(ExceptionMsgs.EXPORT_FORMAT_AND_RESULT_URLS_DO_NOT_MATCH)); } }
@Override protected void handleTaskCompleted(@NotNull ProcessTextFieldInput request, @NotNull AbbyyResponse response, @NotNull Map<String, String> results) throws Exception { super.handleTaskCompleted(request, response, results); String xml = getResult(request, response); results.put(OutputNames.XML_RESULT, EncodingUtils.escapePotentialMaliciousCharsInXml(xml)); if (request.getDestinationFile() != null) { saveClearTextResultOnDisk(request, xml); } }
ProcessTextFieldService extends AbbyyService<ProcessTextFieldInput> { @Override protected void handleTaskCompleted(@NotNull ProcessTextFieldInput request, @NotNull AbbyyResponse response, @NotNull Map<String, String> results) throws Exception { super.handleTaskCompleted(request, response, results); String xml = getResult(request, response); results.put(OutputNames.XML_RESULT, EncodingUtils.escapePotentialMaliciousCharsInXml(xml)); if (request.getDestinationFile() != null) { saveClearTextResultOnDisk(request, xml); } } }
ProcessTextFieldService extends AbbyyService<ProcessTextFieldInput> { @Override protected void handleTaskCompleted(@NotNull ProcessTextFieldInput request, @NotNull AbbyyResponse response, @NotNull Map<String, String> results) throws Exception { super.handleTaskCompleted(request, response, results); String xml = getResult(request, response); results.put(OutputNames.XML_RESULT, EncodingUtils.escapePotentialMaliciousCharsInXml(xml)); if (request.getDestinationFile() != null) { saveClearTextResultOnDisk(request, xml); } } ProcessTextFieldService();   ProcessTextFieldService(@NotNull AbbyyInputValidator<ProcessTextFieldInput> requestValidator,
                            @Nullable AbbyyResultValidator xmlResultValidator,
                            @NotNull AbbyyApi abbyyApi); }
ProcessTextFieldService extends AbbyyService<ProcessTextFieldInput> { @Override protected void handleTaskCompleted(@NotNull ProcessTextFieldInput request, @NotNull AbbyyResponse response, @NotNull Map<String, String> results) throws Exception { super.handleTaskCompleted(request, response, results); String xml = getResult(request, response); results.put(OutputNames.XML_RESULT, EncodingUtils.escapePotentialMaliciousCharsInXml(xml)); if (request.getDestinationFile() != null) { saveClearTextResultOnDisk(request, xml); } } ProcessTextFieldService();   ProcessTextFieldService(@NotNull AbbyyInputValidator<ProcessTextFieldInput> requestValidator,
                            @Nullable AbbyyResultValidator xmlResultValidator,
                            @NotNull AbbyyApi abbyyApi);  }
ProcessTextFieldService extends AbbyyService<ProcessTextFieldInput> { @Override protected void handleTaskCompleted(@NotNull ProcessTextFieldInput request, @NotNull AbbyyResponse response, @NotNull Map<String, String> results) throws Exception { super.handleTaskCompleted(request, response, results); String xml = getResult(request, response); results.put(OutputNames.XML_RESULT, EncodingUtils.escapePotentialMaliciousCharsInXml(xml)); if (request.getDestinationFile() != null) { saveClearTextResultOnDisk(request, xml); } } ProcessTextFieldService();   ProcessTextFieldService(@NotNull AbbyyInputValidator<ProcessTextFieldInput> requestValidator,
                            @Nullable AbbyyResultValidator xmlResultValidator,
                            @NotNull AbbyyApi abbyyApi);   }