|
@@ -75,11 +75,13 @@ public class FakeZincController {
|
75
|
75
|
}
|
76
|
76
|
|
77
|
77
|
/**
|
78
|
|
- * Fake method to test order posting
|
|
78
|
+ * Fake method to test order posting.<br/>
|
79
|
79
|
* Conventions for testing:
|
80
|
80
|
* <ul>
|
81
|
81
|
* <li>if the unmarshalled OrderRequest has a field clientNotes that is a ZincErrorCode, then a ZincError will be returned.</li>
|
82
|
82
|
* <li>else a response containing the idemPotency in the requestId is returned</li>
|
|
83
|
+ * <li>when webhooks are given in the OrderRequest in parameter, then these webhooks are called in the order they are written, with a pause
|
|
84
|
+ * (<code>Thread.sleep</code>) of 30 seconds</li>
|
83
|
85
|
* </ul>
|
84
|
86
|
*/
|
85
|
87
|
@SuppressWarnings("unused")
|
|
@@ -138,6 +140,11 @@ public class FakeZincController {
|
138
|
140
|
orderRequest.getWebhooks()
|
139
|
141
|
.forEach((zincWebhookType, url) -> {
|
140
|
142
|
log.info("Calling webhook for zincWebhookType: " + zincWebhookType + " and URL: " + url);
|
|
143
|
+ try {
|
|
144
|
+ Thread.sleep(30000);
|
|
145
|
+ } catch (InterruptedException e) {
|
|
146
|
+ e.printStackTrace();
|
|
147
|
+ }
|
141
|
148
|
restTemplate.postForObject(url, orderResponse, String.class);
|
142
|
149
|
}
|
143
|
150
|
);
|