Skip to content

Commit

Permalink
Added MockService files
Browse files Browse the repository at this point in the history
  • Loading branch information
tstefanovicius committed Dec 3, 2024
1 parent 8169987 commit 60be83e
Show file tree
Hide file tree
Showing 11 changed files with 9,366 additions and 0 deletions.
48 changes: 48 additions & 0 deletions Apps/W1/EDocumentConnectors/Logiq/test/MockService/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<!--Declare custom configuration sections here-->
<configSections>
<section name="packet" type="MockService.MockServiceConfig, MockService"/>
</configSections>
<!--End declaration of custom configuration sections-->

<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>

<appSettings>
<add key="Server Name" value="localhost"/>
<add key="Port" value="8080"/>
<add key="Max Connections" value="10"/>

<!-- How many microseconds we should wait for new data to arrive
before assuming the client has finished sending their request. -->
<add key="New Incoming Data Timeout" value="5000"/>
</appSettings>

<!--Beginning of custom data section of the app config file-->
<!--
Anything contained in the <packet> section relates to how we read packets, in particular
- Compare containts the string that the program will parse any request for
- If the "compare" string is found the contents of the file location designated in "response" will be sent exactly
- A key value of "Exit" is a particular packet the program will look for to exit gracefully, a response file is optional
but if one is found it will be sent to the client before program exit
-->
<packet>

<!-- E-Document - Logiq Connector -->
<parse key="Packet469" compare="/logiq/auth" response="EDocument\Logiq\AccessToken.txt" />
<parse key="Packet470" compare="/logiq/2.0/transfer/200" response="EDocument\Logiq\DocumentSent.txt" />
<parse key="Packet471" compare="/logiq/2.0/transfer-status/externalId/received" response="EDocument\Logiq\DocumentStatusReceived.txt" />
<parse key="Packet472" compare="/logiq/2.0/transfer-status/externalId/distributed" response="EDocument\Logiq\DocumentStatusDistributed.txt" />
<parse key="Packet473" compare="/logiq/2.0/transfer-status/externalId/failed" response="EDocument\Logiq\DocumentStatusFailed.txt" />
<parse key="Packet474" compare="/logiq/1.0/listfiles/multiple" response="EDocument\Logiq\MultipleDocumentsResponse.txt" />
<parse key="Packet475" compare="/logiq/1.0/getfile/testfile1" response="EDocument\Logiq\testfile1.xml" />
<parse key="Packet476" compare="/logiq/1.0/getfile/testfile2" response="EDocument\Logiq\testfile2.xml" />
<parse key="Packet477" compare="/logiq/1.0/listfiles/one" response="EDocument\Logiq\OneDocumentResponse.txt" />
<parse key="Packet478" compare="/logiq/2.0/transfer/500" response="EDocument\Logiq\ServerError.txt" />

<parse key="Exit" compare="[**EXIT**]" response="Exit Response Example.txt"/>
</packet>
<!--End custom data-->
</configuration>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
HTTP/1.1 200 OK
Date: Fri, 08 Nov 2024 08:59:03 GMT
Content-Type: application/json
Content-Length: 2592

{"access_token":"eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJtMHVLVkNzWmVsVDhPZ2REYlJtZDlwVHBra0M5S29BRWw3QUd0ZXNqQVRBIn0.eyJleHAiOjE3MzEwNTk5NDMsImlhdCI6MTczMTA1NjM0MywianRpIjoiOGZiNTBjYmQtZGZjOS00ODcxLTg0MTUtZjdhZjFmODJmNzg2IiwiaXNzIjoiaHR0cHM6Ly9waWxvdC1zc28ubG9naXEubm8vYXV0aC9yZWFsbXMvY29ubmVjdC1hcGkiLCJhdWQiOiJhY2NvdW50Iiwic3ViIjoiMWVlMTM5MDItMTNhNS00MmMyLWI1MWItOGM3Y2Y3ODVmZjEwIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoiY29ubmVjdCIsInNlc3Npb25fc3RhdGUiOiJhNjE0NjNlYy0yMjUzLTQ0YWItOWJjZC0yZmNiN2ExOTEzMjIiLCJhbGxvd2VkLW9yaWdpbnMiOlsiKiJdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsib2ZmbGluZV9hY2Nlc3MiLCJ1bWFfYXV0aG9yaXphdGlvbiIsImRlZmF1bHQtcm9sZXMtY29ubmVjdCJdfSwicmVzb3VyY2VfYWNjZXNzIjp7ImNvbm5lY3QiOnsicm9sZXMiOlsiZm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lkIiA6ICIwNmZkYjgwOC03MTY3LTQ0NTQtOTcxMS1jMGNkMjM4YTczY2IifQ.eyJleHAiOjE3MzEwNjM1NDMsImlhdCI6MTczMTA1NjM0MywianRpIjoiYjQ0MzUwZGQtOGVlZC00ZjA5LWE5M2ItYWY2MmZiYzRiZjFiIiwiaXNzIjoiaHR0cHM6Ly9waWxvdC1zc28ubG9naXEubm8vYXV0aC9yZWFsbXMvY29ubmVjdC1hcGkiLCJhdWQiOiJodHRwczovL3BpbG90LXNzby5sb2dpcS5uby9hdXRoL3JlYWxtcy9jb25uZWN0LWFwaSIsInN1YiI6IjFlZTEzOTAyLTEzYTUtNDJjMi1iNTFiLThjN2NmNzg1ZmYxMCIsInR5cCI6IlJlZnJlc2giLCJhenAiOiJjb25uZWN0Iiwic2Vzc2lvbl9zdGF0ZSI6ImE2MTQ2M2VjLTIyNTMtNDRhYi05YmNkLTJmY2I3YTE5MTMyMiIsInNjb3BlIjoicHJvZmlsZSBlbWFpbCIsInNpZCI6ImE2MTQ2M2VjLTIyNTMtNDRhYi05YmNkLTJmY2I3YTE5MTMyMiJ9.7u-VemqOYkSGuWBXQ0zZjqNEG0TgU2x1r7m1kkBmalk","token_type":"Bearer","not-before-policy":1576748055,"session_state":"a61463ec-2253-44ab-9bcd-2fcb7a191322","scope":"profile email"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
HTTP/1.1 200 OK
Date: Fri, 08 Nov 2024 08:59:03 GMT
Content-Type: application/json

{"externalId":{"value": "12345678"}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
HTTP/1.1 200 OK
Date: Fri, 08 Nov 2024 08:59:03 GMT
Content-Type: application/json

{
"messageId": "f77f441a-ed9e-4066-8974-f82ec5761992",
"timestamp": "2024-11-06T11:41:36",
"state": "distributed",
"channel": null,
"documentType": null,
"documentNumber": null,
"email": null,
"ourId": {
"source": "e1",
"value": "15731753"
},
"supplier": {
"organisationNumber": null,
"name": null
},
"receiver": {
"organisationNumber": null,
"name": null
},
"error": {
"errorCode": "",
"errorMessage": ""
},
"otherIds": null,
"externalId": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
HTTP/1.1 200 OK
Date: Fri, 08 Nov 2024 08:59:03 GMT
Content-Type: application/json

{
"messageId": "f77f441a-ed9e-4066-8974-f82ec5761992",
"timestamp": "2024-11-06T11:41:36",
"state": "failed",
"channel": null,
"documentType": null,
"documentNumber": null,
"email": null,
"ourId": {
"source": "e1",
"value": "15731753"
},
"supplier": {
"organisationNumber": null,
"name": null
},
"receiver": {
"organisationNumber": null,
"name": null
},
"error": {
"errorCode": "E404_UNKNOWN",
"errorMessage": "[SystemError - Wed Nov 06 11:41:36 CET 2024]\n[Fileinfo]\n Infile id : 15731753\n - name : api_ms-business-central_test.xml\n - path : /download\n[Stacktrace]\n-SysErr- nbs.imljava.util.exception.UnrecognizedFileTypeException: Ukjent XML-format\n\tat nbs.imljava.parser.XMLFileParser.parseFile(XMLFileParser.java:2167)\n\tat nbs.imljava.main.worker.ParserService.invokeParser(ParserService.java:1270)\n\tat nbs.imljava.main.ImlinkWorkerThread.startParsingFile(ImlinkWorkerThread.java:1912)\n\tat nbs.imljava.main.ImlinkWorkerThread.parseClob(ImlinkWorkerThread.java:578)\n\tat nbs.imljava.main.ImlinkWorkerThread.run(ImlinkWorkerThread.java:245)\n\tat nbs.imljava.main.ImlinkEngine.pollDatabase(ImlinkEngine.java:191)\n\tat nbs.imljava.main.ImlinkEngine.main(ImlinkEngine.java:74)\n\tat nbs.imljava.main.concurrent.startup.BootstrapEngineY.main(BootstrapEngineY.java:14)\n"
},
"otherIds": null,
"externalId": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
HTTP/1.1 200 OK
Date: Fri, 08 Nov 2024 08:59:03 GMT
Content-Type: application/json

{
"messageId": "f77f441a-ed9e-4066-8974-f82ec5761992",
"timestamp": "2024-11-06T11:41:36",
"state": "received",
"channel": null,
"documentType": null,
"documentNumber": null,
"email": null,
"ourId": {
"source": "e1",
"value": "15731753"
},
"supplier": {
"organisationNumber": null,
"name": null
},
"receiver": {
"organisationNumber": null,
"name": null
},
"error": {
"errorCode": "",
"errorMessage": ""
},
"otherIds": null,
"externalId": null
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
HTTP/1.1 200 OK
Date: Fri, 08 Nov 2024 08:59:03 GMT
Content-Type: application/json

[{"fileName" : "http://localhost:8080/logiq/1.0/getfile/testfile1.xml"},{"fileName" : "http://localhost:8080/logiq/1.0/getfile/testfile2.xml"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
HTTP/1.1 200 OK
Date: Fri, 08 Nov 2024 08:59:03 GMT
Content-Type: application/json

[{"fileName" : "http://localhost:8080/logiq/1.0/getfile/testfile1.xml"}]
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
HTTP/1.1 500 Internal Server Error
Date: Fri, 08 Nov 2024 08:59:03 GMT

{
"error": "An error occurred"
}
Loading

0 comments on commit 60be83e

Please sign in to comment.