@@ -17,10 +17,10 @@ void shouldMatchIdenticalRequests() {
1717 RequestMatcher matcher = DefaultRequestMatcher .methodAndUri ();
1818
1919 ProxyRequest request1 =
20- new ProxyRequest (
20+ ProxyRequest . fromBytes (
2121 "GET" , URI .create ("http://example.com/api" ), Headers .empty (), null );
2222 ProxyRequest request2 =
23- new ProxyRequest (
23+ ProxyRequest . fromBytes (
2424 "GET" , URI .create ("http://example.com/api" ), Headers .empty (), null );
2525
2626 assertThat (matcher .matches (request1 , request2 )).isTrue ();
@@ -32,10 +32,10 @@ void shouldNotMatchDifferentMethods() {
3232 RequestMatcher matcher = DefaultRequestMatcher .methodAndUri ();
3333
3434 ProxyRequest request1 =
35- new ProxyRequest (
35+ ProxyRequest . fromBytes (
3636 "GET" , URI .create ("http://example.com/api" ), Headers .empty (), null );
3737 ProxyRequest request2 =
38- new ProxyRequest (
38+ ProxyRequest . fromBytes (
3939 "POST" , URI .create ("http://example.com/api" ), Headers .empty (), null );
4040
4141 assertThat (matcher .matches (request1 , request2 )).isFalse ();
@@ -47,10 +47,10 @@ void shouldNotMatchDifferentUris() {
4747 RequestMatcher matcher = DefaultRequestMatcher .methodAndUri ();
4848
4949 ProxyRequest request1 =
50- new ProxyRequest (
50+ ProxyRequest . fromBytes (
5151 "GET" , URI .create ("http://example.com/api" ), Headers .empty (), null );
5252 ProxyRequest request2 =
53- new ProxyRequest (
53+ ProxyRequest . fromBytes (
5454 "GET" , URI .create ("http://example.com/other" ), Headers .empty (), null );
5555
5656 assertThat (matcher .matches (request1 , request2 )).isFalse ();
@@ -62,10 +62,10 @@ void shouldMatchDifferentQueryOrder() {
6262 RequestMatcher matcher = DefaultRequestMatcher .methodAndUri ();
6363
6464 ProxyRequest request1 =
65- new ProxyRequest (
65+ ProxyRequest . fromBytes (
6666 "GET" , URI .create ("http://example.com/api?a=1&b=2" ), Headers .empty (), null );
6767 ProxyRequest request2 =
68- new ProxyRequest (
68+ ProxyRequest . fromBytes (
6969 "GET" , URI .create ("http://example.com/api?b=2&a=1" ), Headers .empty (), null );
7070
7171 // Note: Query parameters order matters in URIs, so this will be false
@@ -80,13 +80,13 @@ void shouldMatchHeaders() {
8080 DefaultRequestMatcher .builder ().matchHeader ("Authorization" ).build ();
8181
8282 ProxyRequest request1 =
83- new ProxyRequest (
83+ ProxyRequest . fromBytes (
8484 "GET" ,
8585 URI .create ("http://example.com/api" ),
8686 Headers .of ("Authorization" , "Bearer token123" ),
8787 null );
8888 ProxyRequest request2 =
89- new ProxyRequest (
89+ ProxyRequest . fromBytes (
9090 "GET" ,
9191 URI .create ("http://example.com/api" ),
9292 Headers .of ("Authorization" , "Bearer token123" ),
@@ -102,13 +102,13 @@ void shouldNotMatchDifferentHeaders() {
102102 DefaultRequestMatcher .builder ().matchHeader ("Authorization" ).build ();
103103
104104 ProxyRequest request1 =
105- new ProxyRequest (
105+ ProxyRequest . fromBytes (
106106 "GET" ,
107107 URI .create ("http://example.com/api" ),
108108 Headers .of ("Authorization" , "Bearer token123" ),
109109 null );
110110 ProxyRequest request2 =
111- new ProxyRequest (
111+ ProxyRequest . fromBytes (
112112 "GET" ,
113113 URI .create ("http://example.com/api" ),
114114 Headers .of ("Authorization" , "Bearer token456" ),
@@ -123,13 +123,13 @@ void shouldMatchBodies() {
123123 RequestMatcher matcher = DefaultRequestMatcher .builder ().matchBody ().build ();
124124
125125 ProxyRequest request1 =
126- new ProxyRequest (
126+ ProxyRequest . fromBytes (
127127 "POST" ,
128128 URI .create ("http://example.com/api" ),
129129 Headers .empty (),
130130 "request body" .getBytes ());
131131 ProxyRequest request2 =
132- new ProxyRequest (
132+ ProxyRequest . fromBytes (
133133 "POST" ,
134134 URI .create ("http://example.com/api" ),
135135 Headers .empty (),
@@ -144,13 +144,13 @@ void shouldNotMatchDifferentBodies() {
144144 RequestMatcher matcher = DefaultRequestMatcher .builder ().matchBody ().build ();
145145
146146 ProxyRequest request1 =
147- new ProxyRequest (
147+ ProxyRequest . fromBytes (
148148 "POST" ,
149149 URI .create ("http://example.com/api" ),
150150 Headers .empty (),
151151 "body1" .getBytes ());
152152 ProxyRequest request2 =
153- new ProxyRequest (
153+ ProxyRequest . fromBytes (
154154 "POST" ,
155155 URI .create ("http://example.com/api" ),
156156 Headers .empty (),
@@ -165,13 +165,13 @@ void shouldIgnoreHeadersByDefault() {
165165 RequestMatcher matcher = DefaultRequestMatcher .methodAndUri ();
166166
167167 ProxyRequest request1 =
168- new ProxyRequest (
168+ ProxyRequest . fromBytes (
169169 "GET" ,
170170 URI .create ("http://example.com/api" ),
171171 Headers .of ("User-Agent" , "Browser1" ),
172172 null );
173173 ProxyRequest request2 =
174- new ProxyRequest (
174+ ProxyRequest . fromBytes (
175175 "GET" ,
176176 URI .create ("http://example.com/api" ),
177177 Headers .of ("User-Agent" , "Browser2" ),
@@ -186,13 +186,13 @@ void shouldIgnoreBodyByDefault() {
186186 RequestMatcher matcher = DefaultRequestMatcher .methodAndUri ();
187187
188188 ProxyRequest request1 =
189- new ProxyRequest (
189+ ProxyRequest . fromBytes (
190190 "POST" ,
191191 URI .create ("http://example.com/api" ),
192192 Headers .empty (),
193193 "body1" .getBytes ());
194194 ProxyRequest request2 =
195- new ProxyRequest (
195+ ProxyRequest . fromBytes (
196196 "POST" ,
197197 URI .create ("http://example.com/api" ),
198198 Headers .empty (),
0 commit comments