From c4975af670ea02f13e3c157f9777e76a7b6e75f9 Mon Sep 17 00:00:00 2001 From: Juho Saarinen Date: Sun, 29 Jul 2018 21:02:13 +0300 Subject: [PATCH] Preparasion for 0.0.1 --- README.md | 8 +++++--- pom.xml | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 393ed68..a0ef18f 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ Server makes all connections at the TCP level. This might cause some issues espe Caller <-> \IncomingGateway <-> \MockIncomingChannel -> Transformer (adds mockName to headers) -> ServiceChannel -> Service activator (handleRequestMessage) -> sendToBackend -gateway -> mockTargetTransformer -> fixHttpMessageHost -transformer (adds real endpoint host to HTTP messages) -> mockTargetRouter -> router -> \TargetOutgoingChannel -> \OutgoingGateway -> real system |<------------Cached response returned from service activator-----------------------------------| | |<------------Response returned to the caller through gateway-----------------------------------|<----------------------------------------------------------------Response returned to service activator which caches it-----------------------------------------------------------------------------------------------------------------| + |<------------Response from specific mock service-----------------------------------------------| ``` \ comes from mock configuration, and all elements containing that are dynamically created (either from properties or while adding mock runtime) @@ -23,8 +24,9 @@ Application configuration keys are under mock.services as a list services: - name: mockPort: - targetHost: - targetPort: + targetHost: + targetPort: + mockBeanName: endpointType: messageStarter: bytesToClear: @@ -36,7 +38,7 @@ Application configuration keys are under mock.services as a list There's 2 ways to extend the mock: 1 for how to parse the incoming message in a way, that dynamic data (e.g. timestamps) are not interfering with the hashing. Second possibility is to create Mockservices, that generate responses to calls. ### Parser extensions -Parser should implement interface `IPayloadParser`, and return the payload (as String) that is OK to be used for hash calculation. Bean name should be formed as Parser (e.g. SoapParser in the `com.github.hi_fi.tcpMockeServer.parserscom.github.hi_fi.tcpMockeServer.parsers`. +Parser should implement interface `IPayloadParser`, and return the payload (as String) that is OK to be used for hash calculation. Bean name should be formed as Parser (e.g. SoapParser in the `com.github.hi_fi.tcpMockeServer.parserscom.github.hi_fi.tcpMockeServer.parsers`). ### Mocking services Service's default approach is to proxy the request to real backend, and next times respond directly with that cached content. Other option is to create class that implements `IMockService`, and configure the bean name to application configuration. That way the call is not sent to backend (unless that call is made in the implementing service). Request-response are still cached, so that generation might be done only once (note this if wanting to get e.g. latest timestamp with each call). diff --git a/pom.xml b/pom.xml index c86c3a1..b0f18db 100644 --- a/pom.xml +++ b/pom.xml @@ -9,7 +9,7 @@ com.github.hi-fi tcp-mocker-server - 0.0.1-SNAPSHOT + 0.0.1 tcp-mocker-server Test server to proxy and mock dependencies in testing.