Skip to content

Commit 86da476

Browse files
committed
fix(tests): add test case on every clients
1 parent 61fa08e commit 86da476

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

templates/go/tests/client/suite.mustache

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,12 @@ func Test{{#lambda.titlecase}}{{clientPrefix}}{{testType}}{{/lambda.titlecase}}{
7575
require.JSONEq(t, `{{{match.parameters}}}`, string(rawBody))
7676
{{/matchIsJSON}}
7777
{{^matchIsJSON}}
78+
{{#matchIsNull}}
79+
require.Nil(t, res)
80+
{{/matchIsNull}}
81+
{{^matchIsNull}}
7882
require.Equal(t, `{{{match}}}`, res)
83+
{{/matchIsNull}}
7984
{{/matchIsJSON}}
8085
{{/testResponse}}
8186
{{/match}}

templates/kotlin/tests/client/suite.mustache

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,12 @@ class {{clientPrefix}}Test {
6262
assertEquals("{{#lambda.escapeQuotes}}{{{match.parameters}}}{{/lambda.escapeQuotes}}", response)
6363
{{/matchIsJSON}}
6464
{{^matchIsJSON}}
65+
{{#matchIsNull}}
66+
assertNull(it)
67+
{{/matchIsNull}}
68+
{{^matchIsNull}}
6569
assertEquals("{{{match}}}", it)
70+
{{/matchIsNull}}
6671
{{/matchIsJSON}}
6772
}{{/testResponse}}
6873
{{/match}}

templates/ruby/tests/client/suite.mustache

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ class TestClient{{#lambda.pascalcase}}{{{client}}}{{/lambda.pascalcase}} < Test:
4343
assert_equal({{{match.parameters}}}, req.is_a?(Array) ? req.map(&:to_hash) : req.to_hash)
4444
{{/matchIsJSON}}
4545
{{^matchIsJSON}}
46+
{{#matchIsNull}}
47+
assert_nil(req)
48+
{{/matchIsNull}}
49+
{{^matchIsNull}}
4650
assert_equal('{{{match}}}', req)
51+
{{/matchIsNull}}
4752
{{/matchIsJSON}}
4853
{{/testResponse}}
4954
{{/match}}

templates/scala/tests/client/suite.mustache

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,12 @@ class {{clientPrefix}}Test extends AnyFunSuite {
7373
assert(write(res) == "{{#lambda.escapeQuotes}}{{{match.parameters}}}{{/lambda.escapeQuotes}}")
7474
{{/matchIsJSON}}
7575
{{^matchIsJSON}}
76+
{{#matchIsNull}}
77+
assert(res == null)
78+
{{/matchIsNull}}
79+
{{^matchIsNull}}
7680
assert(res == "{{{match}}}")
81+
{{/matchIsNull}}
7782
{{/matchIsJSON}}
7883
{{/testResponse}}
7984
{{/match}}

0 commit comments

Comments
 (0)