Skip to content

Commit ddd5fd3

Browse files
authored
fix(cts): friendly error message when test is missing (#976)
1 parent 4914844 commit ddd5fd3

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

generators/src/main/java/com/algolia/codegen/cts/tests/TestsRequest.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,18 @@ public void run(Map<String, CodegenModel> models, Map<String, CodegenOperation>
5454
for (Map.Entry<String, CodegenOperation> entry : operations.entrySet()) {
5555
String operationId = entry.getKey();
5656
if (!cts.containsKey(operationId)) {
57-
throw new CTSException("operationId " + operationId + " does not exist in the spec");
57+
throw new CTSException(
58+
"operationId '" +
59+
operationId +
60+
"' does not exist in the tests suite, please create the file:" +
61+
" 'tests/CTS/methods/requests/" +
62+
client +
63+
"/" +
64+
operationId +
65+
".json'.\n" +
66+
"You can read more on the documentation:" +
67+
" https://api-clients-automation.netlify.app/docs/contributing/testing/common-test-suite"
68+
);
5869
}
5970
Request[] op = cts.get(operationId);
6071

0 commit comments

Comments
 (0)