Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
MathisSenicourt committed Oct 5, 2023
2 parents bfc03ee + 5cfac7f commit 3e3cd19
Show file tree
Hide file tree
Showing 17 changed files with 408 additions and 98 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Various ressources are available :

[Cerberus Testing LinkedIn Page](https://www.linkedin.com/company/cerberus-testing/)

[Cerberus Testing Demo](http://demo.cerberus-testing.org)
[Cerberus Testing Demo](https://demo.cerberus-testing.com/)

[Cerberus Testing Jenkins Plugin](https://github.com/jenkinsci/cerberus-testing-plugin)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ public JSONObject toJSONOnKAFKAExecution() {
JSONObject jsonProps = new JSONObject();
for (AppServiceContent prop : this.getContentList()) {
if (prop.getKey().contains("passw")) {
jsonProps.put(prop.getKey(), "XXXXXXXX");
jsonProps.put(prop.getKey(), StringUtil.SECRET_STRING);
} else {
jsonProps.put(prop.getKey(), prop.getValue());
}
Expand All @@ -317,7 +317,7 @@ public JSONObject toJSONOnKAFKAExecution() {
JSONObject jsonHeaders = new JSONObject();
for (AppServiceHeader header : this.getHeaderList()) {
if (header.getKey().contains("passw")) {
jsonHeaders.put(header.getKey(), "XXXXXXXX");
jsonHeaders.put(header.getKey(), StringUtil.SECRET_STRING);
} else {
jsonHeaders.put(header.getKey(), header.getValue());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ public JSONObject toJson(boolean secured) {
result.put("host", this.getHost());
if (secured) {
if (this.getHostPassword() != null && !this.getHostPassword().isEmpty()) {
result.put("hostPassword", "XXXXXXXXXX");
result.put("hostPassword", StringUtil.SECRET_STRING);
} else {
result.put("hostPassword", "");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,8 @@ public Answer save(Parameter object, HttpServletRequest request) {

} else if (resp.getItem() == null) {
finalAnswer = create(object);
} else if (!((object.getValue()).equals(resp.getItem().getValue()))) {
} else if (!((object.getValue()).equals(resp.getItem().getValue())) && !StringUtil.SECRET_STRING.equals(object.getValue())) {
// Parameter value is modified only if different from hiddem value (XXXXXXXXXX)
finalAnswer = update(object);
} else {
/**
Expand Down Expand Up @@ -423,9 +424,9 @@ public boolean hasPermissionsDelete(Parameter parameter, HttpServletRequest requ
@Override
public Parameter secureParameter(Parameter parameter) {
if (isToSecureParameter(parameter)) {
parameter.setValue("XXXXXXXXXX");
parameter.setValue(StringUtil.SECRET_STRING);
if (StringUtil.isNotEmptyOrNullValue(parameter.getSystem1value())) {
parameter.setSystem1value("XXXXXXXXXX");
parameter.setSystem1value(StringUtil.SECRET_STRING);
}
}
return parameter;
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -1705,22 +1705,22 @@ public MessageEvent doActionDragAndDrop(TestCaseExecution tCExecution, String va
private MessageEvent doActionCallService(TestCaseStepActionExecution action, String value1, String value2, String value3) {

MessageEvent message = new MessageEvent(MessageEventEnum.ACTION_FAILED_CALLSERVICE);
TestCaseExecution tCExecution = action.getTestCaseStepExecution().gettCExecution();
TestCaseExecution execution = action.getTestCaseStepExecution().gettCExecution();
AnswerItem lastServiceCalledAnswer;

lastServiceCalledAnswer = serviceService.callService(value1, value2, value3, null, null, null, null, tCExecution, robotServerService.getFromOptions(action.getOptions(), RobotServerService.OPTIONS_TIMEOUT_SYNTAX));
lastServiceCalledAnswer = serviceService.callService(value1, value2, value3, null, null, null, null, execution, robotServerService.getFromOptions(action.getOptions(), RobotServerService.OPTIONS_TIMEOUT_SYNTAX));
message = lastServiceCalledAnswer.getResultMessage();

if (lastServiceCalledAnswer.getItem() != null) {
AppService lastServiceCalled = (AppService) lastServiceCalledAnswer.getItem();
tCExecution.setLastServiceCalled(lastServiceCalled);
tCExecution.setOriginalLastServiceCalled(lastServiceCalled.getResponseHTTPBody());
tCExecution.setOriginalLastServiceCalledContent(lastServiceCalled.getResponseHTTPBodyContentType());

execution.setLastServiceCalled(lastServiceCalled);
execution.setOriginalLastServiceCalled(lastServiceCalled.getResponseHTTPBody());
execution.setOriginalLastServiceCalledContent(lastServiceCalled.getResponseHTTPBodyContentType());
/**
* Record the Request and Response in file system.
*/
action.addFileList(recorderService.recordServiceCall(tCExecution, action, 0, null, lastServiceCalled));
action.addFileList(recorderService.recordServiceCall(execution, action, 0, null, lastServiceCalled));
}

return message;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,9 @@ public enum MessageEventEnum {
ACTION_FAILED_CALLSERVICE_SEEKALLTOPICS(286, "FA", "Failed when getting latest offset of every topics. %DESCRIPTION%.", true, true, false, MessageGeneralEnum.EXECUTION_FA_ACTION),
ACTION_FAILED_CALLSERVICE(286, "FA", "Failed to call the Service '%SERVICENAME%'. Caused by : %DESCRIPTION%.", true, true, false, MessageGeneralEnum.EXECUTION_FA_ACTION),
ACTION_FAILED_CALLSERVICE_TIMEOUT(286, "FA", "Failed to call the Service '%SERVICEURL%' due to timeout (%TIMEOUT% ms).", true, true, false, MessageGeneralEnum.EXECUTION_FA_ACTION),
ACTION_FAILED_CALLSERVICE_MONGO_COLLECTIONFORMAT(286, "FA", "Failed to call the Service '%SERVICEURL%' due to invalid format of database and collection path '%COLLECTIONPATH%' (should be : DATABASE.COLLECTION).", true, true, false, MessageGeneralEnum.EXECUTION_FA_ACTION),
ACTION_FAILED_CALLSERVICE_MONGO_DATABASENOTEXIST(286, "FA", "Failed to call the Service '%SERVICEURL%' due to unknown database '%DATABASE%'.", true, true, false, MessageGeneralEnum.EXECUTION_FA_ACTION),
ACTION_FAILED_CALLSERVICE_MONGO_COLLECTIONNOTEXIST(286, "FA", "Failed to call the Service '%SERVICEURL%' due to unknown collection '%COLLECTION%'.", true, true, false, MessageGeneralEnum.EXECUTION_FA_ACTION),
ACTION_FAILED_CALLSERVICEWITHPATH(286, "FA", "Failed to call the Service '%SERVICENAME%' on Service Path '%SERVICEPATH%'. Caused by : %DESCRIPTION%.", true, true, false, MessageGeneralEnum.EXECUTION_FA_ACTION),
ACTION_FAILED_CALLSERVICE_METHODMISSING(286, "FA", "Failed to call the Service because Method is not defined.", true, true, false, MessageGeneralEnum.EXECUTION_FA_ACTION),
ACTION_FAILED_CALLSERVICE_SERVICEPATHMISSING(286, "FA", "Failed to call the Service because Service Path is not defined.", true, true, false, MessageGeneralEnum.EXECUTION_FA_ACTION),
Expand Down
Loading

0 comments on commit 3e3cd19

Please sign in to comment.