Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
fawind committed Oct 20, 2023
1 parent 7834d8f commit 4610af8
Show file tree
Hide file tree
Showing 10 changed files with 179 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,11 @@ public long externalLongPath(AuthHeader _authHeader, long param) {
return param;
}

@Override
public String pathParamRegex(AuthHeader authHeader, String paramOne, String paramTwo, String paramThree) {
return paramOne + "," + paramTwo + "," + paramThree;
}

@Override
public Optional<Long> optionalExternalLongQuery(AuthHeader _authHeader, Optional<Long> param) {
return param;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,12 @@ public void testSpaceInPathParam() {
.isEqualTo(expected);
}

@Test
public void testRegexPath() {
assertThat(client.pathParamRegex(AuthHeader.valueOf("bearer"), "foo", "bar", "baz"))
.isEqualTo("foo,bar,baz");
}

@Test
public void testBinaryOptionalEmptyResponse() {
Optional<ResponseBody> response =
Expand Down
12 changes: 12 additions & 0 deletions conjure-java-core/src/test/resources/ete-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,18 @@ services:
param: Long
returns: Long

# The Conjure spec technically supports path params regexes even though they are unused
pathParamRegex:
http: GET /path/{paramOne}/{paramTwo:.+}/{paramThree:.*}
args:
paramOne:
type: string
paramTwo:
type: string
paramThree:
type: string
returns: string

optionalExternalLongQuery:
http: GET /optionalExternalLong
args:
Expand Down

0 comments on commit 4610af8

Please sign in to comment.