package Ġcom . ach hat ra . th re ep io . testing . mock server . matchers Ċ Ċ import Ġokhttp 3 . mock webserver . Re corded Request Ċ import Ġorg . hamcrest . Description Ċ import Ġorg . hamcrest . Type Safe Matcher Ċ import Ġjava . net . URI Ċ Ċ class ĠPath Matcher ( private Ġval Ġpath : ĠString ): ĠType Safe Matcher < Re corded Request >() Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġdescribe To ( description : ĠDescription ) Ġ{ ĊĠĠĠĠĠĠĠ Ġdescription . append Text (" Ġhas Ġpath Ġ= Ġ$ path ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġmatches S af ely ( request : ĠRe corded Request ): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn ĠURI ( request . path ). path Ġ== Ġpath ĊĠĠĠ Ġ} Ċ } Ċ Ċ class ĠPath StartsWith Matcher ( private Ġval Ġprefix : ĠString ): ĠType Safe Matcher < Re corded Request >() Ġ{ ĊĊĠĠĠ Ġoverride Ġfun Ġdescribe To ( description : ĠDescription ) Ġ{ ĊĠĠĠĠĠĠĠ Ġdescription . append Text (" Ġhas Ġpath Ġstarts Ġwith Ġ$ prefix ") ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġoverride Ġfun Ġmatches S af ely ( request : ĠRe corded Request ): ĠBoolean Ġ{ ĊĠĠĠĠĠĠĠ Ġreturn Ġrequest . path !!. startsWith ( prefix ) ĊĠĠĠ Ġ} Ċ } Ċ Ċ fun ĠRequest Matcher . has Path ( path : ĠString ) Ġ{ ĊĠĠĠ Ġadd ( Path Matcher ( path )) Ċ } Ċ Ċ fun ĠRequest Matcher . has Path That StartsWith ( path : ĠString ) Ġ{ ĊĠĠĠ Ġadd ( Path StartsWith Matcher ( path )) Ċ } Ċ