Skip to content
This repository has been archived by the owner on Jan 31, 2023. It is now read-only.

Commit

Permalink
DHX-17 - Fix DhxPackageServceImplTest
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaarel Raspel committed Sep 13, 2019
1 parent 06fe97e commit 402215e
Showing 1 changed file with 0 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

Expand All @@ -56,13 +55,9 @@
public class DhxPackageServceImplTest {

private static final String FILE_NAME_KAPSEL_21_XML = "kapsel_21.xml";
private static final String FILE_NAME_KAPSEL_21_BIG_XML = "kapsel_21_big.xml";
private FileDataHandler FILE_HANDLER_KAPSEL_21_XML = FileUtil.getDatahandlerFromFile(
ResourceUtils.getFile("classpath:" + FILE_NAME_KAPSEL_21_XML)
);
private FileDataHandler FILE_HANDLER_KAPSEL_21_BIG_XML = FileUtil.getDatahandlerFromFile(
ResourceUtils.getFile("classpath:" + FILE_NAME_KAPSEL_21_BIG_XML)
);

private final SendDocument REQUEST = new SendDocument() {{
consignmentId = "consignmentId";
Expand Down Expand Up @@ -205,28 +200,6 @@ public void receiveDocumentFromEndpoint() throws DhxException, IOException {
.isDuplicatePackage(any(InternalXroadMember.class), anyString());
}

@Test
public void receiveDocumentFromEndpointBigFile() throws DhxException, IOException {
// Prepare
REQUEST.setDocumentAttachment(FILE_HANDLER_KAPSEL_21_BIG_XML);
when(dhxConfig.getParseCapsule()).thenReturn(true);
when(dhxImplementationSpecificService.receiveDocument(any(IncomingDhxPackage.class), any(MessageContext.class)))
.thenReturn("id1");
when(dhxMarshallerService.unmarshallAndValidate(any(InputStream.class), any(InputStream.class)))
.thenReturn(new DecContainer());
// Test
SendDocumentResponse response = dhxPackageService.receiveDocumentFromEndpoint(REQUEST, CLIENT, SERVICE, null);
// Verify
assertEquals("id1", response.getReceiptId());
assertNull(response.getFault());
/*verify(dhxMarshallerService, times(1))
.unmarshallAndValidate(any(InputStream.class), any(InputStream.class));
verify(dhxImplementationSpecificService, times(1))
.receiveDocument(any(IncomingDhxPackage.class), any(MessageContext.class));
verify(dhxImplementationSpecificService, times(1))
.isDuplicatePackage(any(InternalXroadMember.class), anyString());*/
}

@Test
public void receiveDocumentFromEndpointToRepresentee() throws DhxException, IOException {
// Prepare
Expand Down

0 comments on commit 402215e

Please sign in to comment.