Skip to content

fix(cts): friendly error message when test is missing #976

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 30, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,18 @@ public void run(Map<String, CodegenModel> models, Map<String, CodegenOperation>
for (Map.Entry<String, CodegenOperation> entry : operations.entrySet()) {
String operationId = entry.getKey();
if (!cts.containsKey(operationId)) {
throw new CTSException("operationId " + operationId + " does not exist in the spec");
throw new CTSException(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea, should be good

"operationId '" +
operationId +
"' does not exist in the tests suite, please create the file:" +
" 'tests/CTS/methods/requests/" +
client +
"/" +
operationId +
".json'.\n" +
"You can read more on the documentation:" +
" https://api-clients-automation.netlify.app/docs/contributing/testing/common-test-suite"
);
}
Request[] op = cts.get(operationId);

Expand Down