22
22
import org .w3c .dom .Document ;
23
23
import org .w3c .dom .Node ;
24
24
25
+ import com .helger .commons .CGlobal ;
26
+ import com .helger .commons .concurrent .ThreadHelper ;
25
27
import com .helger .commons .io .resource .ClassPathResource ;
26
28
import com .helger .phase4 .AS4TestConstants ;
27
29
import com .helger .phase4 .config .AS4Configuration ;
@@ -39,7 +41,8 @@ public final class UserMessageDuplicateTest extends AbstractUserMessageTestSetUp
39
41
public void testSendDuplicateMessageOnlyGetOneReceipt () throws Exception
40
42
{
41
43
final Node aPayload = DOMReader .readXMLDOM (new ClassPathResource (AS4TestConstants .TEST_SOAP_BODY_PAYLOAD_XML ));
42
- final Document aDoc = MockMessages .testUserMessageSoapNotSigned (m_eSoapVersion , aPayload , null ).getAsSoapDocument (aPayload );
44
+ final Document aDoc = MockMessages .testUserMessageSoapNotSigned (m_eSoapVersion , aPayload , null )
45
+ .getAsSoapDocument (aPayload );
43
46
44
47
final HttpEntity aEntity = new HttpXMLEntity (aDoc , m_eSoapVersion .getMimeType ());
45
48
@@ -53,7 +56,8 @@ public void testSendDuplicateMessageOnlyGetOneReceipt () throws Exception
53
56
public void testSendDuplicateMessageTestDisposalFeature () throws Exception
54
57
{
55
58
final Node aPayload = DOMReader .readXMLDOM (new ClassPathResource (AS4TestConstants .TEST_SOAP_BODY_PAYLOAD_XML ));
56
- final Document aDoc = MockMessages .testUserMessageSoapNotSigned (m_eSoapVersion , aPayload , null ).getAsSoapDocument (aPayload );
59
+ final Document aDoc = MockMessages .testUserMessageSoapNotSigned (m_eSoapVersion , aPayload , null )
60
+ .getAsSoapDocument (aPayload );
57
61
58
62
final HttpEntity aEntity = new HttpXMLEntity (aDoc , m_eSoapVersion .getMimeType ());
59
63
@@ -63,7 +67,8 @@ public void testSendDuplicateMessageTestDisposalFeature () throws Exception
63
67
// 60 000 = 1 minute, *2 and + 10000 are a buffer
64
68
// test file is configured for 1 minute can take LONGER if configured
65
69
// differently
66
- Thread .sleep (AS4Configuration .getIncomingDuplicateDisposalMinutes () * 60000 * 2 + 10000 );
70
+ ThreadHelper .sleep (AS4Configuration .getIncomingDuplicateDisposalMinutes () * CGlobal .MILLISECONDS_PER_MINUTE * 2 +
71
+ 10 * CGlobal .MILLISECONDS_PER_SECOND );
67
72
68
73
sendPlainMessageAndWait (aEntity , true , null );
69
74
}
0 commit comments