Skip to content

Commit aa357eb

Browse files
committed
Removed mocking stuffs never used
1 parent 5f9f6ff commit aa357eb

File tree

5 files changed

+0
-350
lines changed

5 files changed

+0
-350
lines changed

core/src/main/java/org/jsmart/zerocode/core/domain/MockStep.java

Lines changed: 0 additions & 114 deletions
This file was deleted.

core/src/main/java/org/jsmart/zerocode/core/domain/MockSteps.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

core/src/main/java/org/jsmart/zerocode/core/engine/executor/httpapi/HttpApiExecutorImpl.java

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
import org.slf4j.LoggerFactory;
1717

1818
import static org.apache.commons.lang3.StringUtils.isEmpty;
19-
import static org.jsmart.zerocode.core.engine.mocker.RestEndPointMocker.createWithLocalMock;
20-
import static org.jsmart.zerocode.core.engine.mocker.RestEndPointMocker.createWithVirtuosoMock;
2119
import static org.jsmart.zerocode.core.utils.SmartUtils.prettyPrintJson;
2220

2321
public class HttpApiExecutorImpl implements HttpApiExecutor {
@@ -43,16 +41,6 @@ public String execute(String httpUrl, String methodName, String requestJson) thr
4341
HashMap headers = (HashMap) readJsonPathOrElseNull(requestJson, "$.headers");
4442
Object bodyContent = readJsonPathOrElseNull(requestJson, "$.body");
4543

46-
/*
47-
* $MOCK: Create mock endpoints supplied for this scenario
48-
*/
49-
if (completedMockingEndPoints(httpUrl, requestJson, methodName, bodyContent)) {
50-
/*
51-
* All mocks done? Then return a success message
52-
*/
53-
return "{\"status\": 200}";
54-
}
55-
5644
final HttpResponse serverResponse = httpClient.execute(httpUrl, methodName, headers, queryParams, bodyContent);
5745

5846
/*
@@ -99,28 +87,6 @@ private Response deriveZeroCodeResponseFrom(int responseStatus,
9987
return new Response(responseStatus, responseHeaders, jsonBody, rawBody, null);
10088
}
10189

102-
private boolean completedMockingEndPoints(String httpUrl, String requestJson, String methodName, Object bodyContent) throws java.io.IOException {
103-
if (httpUrl.contains("/$MOCK") && methodName.equals("$USE.VIRTUOSO")) {
104-
LOGGER.debug("\n#body:\n" + bodyContent);
105-
106-
//read the content of the "request". This contains the complete rest API.
107-
createWithVirtuosoMock(bodyContent != null ? bodyContent.toString() : null);
108-
109-
LOGGER.debug("#SUCCESS: End point simulated via virtuoso.");
110-
return true;
111-
} else if (httpUrl.contains("/$MOCK") && methodName.equals("$USE.SIMULATOR")) {
112-
LOGGER.debug("\n#body:\n" + bodyContent);
113-
114-
//read the content of the "request". This contains the complete rest API.
115-
createWithLocalMock(bodyContent != null ? bodyContent.toString() : null);
116-
117-
LOGGER.debug("#SUCCESS: End point simulated via local simulator.");
118-
119-
return true;
120-
}
121-
return false;
122-
}
123-
12490
private Object readJsonPathOrElseNull(String requestJson, String jsonPath) {
12591
try {
12692
return JsonPath.read(requestJson, jsonPath);

core/src/main/java/org/jsmart/zerocode/core/engine/mocker/RestEndPointMocker.java

Lines changed: 0 additions & 46 deletions
This file was deleted.

core/src/test/java/org/jsmart/zerocode/core/domain/MockStepTest.java

Lines changed: 0 additions & 126 deletions
This file was deleted.

0 commit comments

Comments
 (0)