1
2
3
4
5 package com.jcabi.http.wire;
6
7 import com.jcabi.http.request.JdkRequest;
8 import com.jcabi.http.response.XmlResponse;
9 import java.io.IOException;
10 import org.hamcrest.MatcherAssert;
11 import org.hamcrest.Matchers;
12 import org.junit.jupiter.api.Test;
13
14
15
16
17
18
19 final class BasicAuthWireITCase {
20 @Test
21 void basicAuthWorks() throws IOException {
22 final XmlResponse res = new JdkRequest(
23 "https://User:Pass@authenticationtest.com/HTTPAuth/"
24 )
25 .through(BasicAuthWire.class)
26 .through(AutoRedirectingWire.class)
27 .fetch()
28 .as(XmlResponse.class);
29 MatcherAssert.assertThat(
30 "should be success",
31 res.body(),
32 Matchers.containsString("Success!")
33 );
34 }
35 }