Skip to content

Commit

Permalink
add path variable test case
Browse files Browse the repository at this point in the history
  • Loading branch information
何亮 committed Nov 3, 2024
1 parent 7b8d15d commit beba584
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,10 @@ service Greeter {
};
}

// Health check interface, maps the name field from request body
// Health check interface
rpc CheckName(HelloRequest) returns (HelloReply) {
option (google.api.http) = {
put: "/v1/hello/check-name" // PUT request URI
body: "name" // Field from request body
put: "/v1/hello/check-name/{name}" // PUT request URI
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void checkName() {
data.add("name", "He");

String result = webClient.put()
.uri(toUri("/v1/hello/check-name"))
.uri(toUri("/v1/hello/check-name/heliang"))
.contentType(MediaType.APPLICATION_JSON)
.body(data)
.retrieve()
Expand Down Expand Up @@ -135,5 +135,4 @@ public void actionCheckWithName() {

Assert.assertEquals("{\"message\":\"Action check with name: He\"}", result);
}

}

0 comments on commit beba584

Please sign in to comment.