Skip to content

Commit

Permalink
test placeholder used inside string expression
Browse files Browse the repository at this point in the history
  • Loading branch information
xingyutangyuan committed Dec 3, 2023
1 parent e99cff7 commit a05df9b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ public void template_boolArg() {

@Test
public void template_stringArg() {
StringFormat.To<QueryJobConfiguration> query = template("SELECT * where id = {id};");
StringFormat.To<QueryJobConfiguration> query = template("SELECT * where message like '%{id}%'");
assertThat(query.with("1's id"))
.isEqualTo(
QueryJobConfiguration.newBuilder("SELECT * where id = @id;")
QueryJobConfiguration.newBuilder("SELECT * where message like '%@id%'")
.addNamedParameter("id", QueryParameterValue.string("1's id"))
.build());
}
Expand Down

0 comments on commit a05df9b

Please sign in to comment.