File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed
httpclient/src/test/java/org/baeldung/httpclient/advancedconfig Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -38,12 +38,12 @@ public class HttpClientAdvancedConfiguration {
3838 @ Test
3939 public void givenClientWithCustomUserAgentHeader_whenExecuteRequest_shouldReturn200 () throws IOException {
4040 //given
41+ String userAgent = "BaeldungAgent/1.0" ;
4142 serviceMock .stubFor (get (urlEqualTo ("/detail" ))
42- .withHeader ("User-Agent" , equalTo ("BaeldungAgent/1.0" ))
43+ .withHeader ("User-Agent" , equalTo (userAgent ))
4344 .willReturn (aResponse ()
4445 .withStatus (200 )));
4546
46- String userAgent = "BaeldungAgent/1.0" ;
4747 HttpClient httpClient = HttpClients .createDefault ();
4848 final HttpGet httpGet = new HttpGet ("http://localhost:8089/detail" );
4949 httpGet .setHeader (HttpHeaders .USER_AGENT , userAgent );
You can’t perform that action at this time.
0 commit comments