File tree Expand file tree Collapse file tree 5 files changed +10
-10
lines changed
main/java/org/springframework/restdocs
test/java/org/springframework/restdocs/cli Expand file tree Collapse file tree 5 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -6,4 +6,4 @@ org.gradle.parallel=true
66
77javaFormatVersion =0.0.39
88jmustacheVersion =1.15
9- springFrameworkVersion =6.0.0
9+ springFrameworkVersion =6.0.14-SNAPSHOT
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2014-2022 the original author or authors.
2+ * Copyright 2014-2023 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
1818
1919import java .net .URI ;
2020import java .util .Arrays ;
21+ import java .util .Base64 ;
2122import java .util .Collection ;
2223import java .util .HashSet ;
2324import java .util .List ;
3031import org .springframework .restdocs .operation .OperationRequest ;
3132import org .springframework .restdocs .operation .OperationRequestPart ;
3233import org .springframework .restdocs .operation .RequestCookie ;
33- import org .springframework .util .Base64Utils ;
3434
3535/**
3636 * An {@link OperationRequest} wrapper with methods that are useful when producing a
@@ -137,7 +137,7 @@ static boolean isBasicAuthHeader(List<String> value) {
137137 }
138138
139139 static String decodeBasicAuthHeader (List <String > value ) {
140- return new String (Base64Utils . decodeFromString (value .get (0 ).substring (6 )));
140+ return new String (Base64 . getDecoder (). decode (value .get (0 ).substring (6 )));
141141 }
142142
143143 }
Original file line number Diff line number Diff line change 11/*
2- * Copyright 2014-2022 the original author or authors.
2+ * Copyright 2014-2023 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -57,7 +57,7 @@ public OperationResponse preprocess(OperationResponse response) {
5757
5858 private HttpHeaders preprocess (HttpHeaders headers ) {
5959 HttpHeaders modifiedHeaders = new HttpHeaders ();
60- modifiedHeaders .putAll (headers );
60+ modifiedHeaders .addAll (headers );
6161 for (Modification modification : this .modifications ) {
6262 modification .applyTo (modifiedHeaders );
6363 }
Original file line number Diff line number Diff line change 1717package org .springframework .restdocs .cli ;
1818
1919import java .io .IOException ;
20+ import java .util .Base64 ;
2021
2122import org .junit .Test ;
2223import org .junit .runner .RunWith ;
2627import org .springframework .http .MediaType ;
2728import org .springframework .restdocs .AbstractSnippetTests ;
2829import org .springframework .restdocs .templates .TemplateFormat ;
29- import org .springframework .util .Base64Utils ;
3030
3131import static org .assertj .core .api .Assertions .assertThat ;
3232
@@ -261,7 +261,7 @@ public void multipartPost() throws IOException {
261261 @ Test
262262 public void basicAuthCredentialsAreSuppliedUsingUserOption () throws IOException {
263263 new CurlRequestSnippet (this .commandFormatter ).document (this .operationBuilder .request ("http://localhost/foo" )
264- .header (HttpHeaders .AUTHORIZATION , "Basic " + Base64Utils .encodeToString ("user:secret" .getBytes ()))
264+ .header (HttpHeaders .AUTHORIZATION , "Basic " + Base64 . getEncoder () .encodeToString ("user:secret" .getBytes ()))
265265 .build ());
266266 assertThat (this .generatedSnippets .curlRequest ())
267267 .is (codeBlock ("bash" ).withContent ("$ curl 'http://localhost/foo' -i -u 'user:secret' -X GET" ));
Original file line number Diff line number Diff line change 1717package org .springframework .restdocs .cli ;
1818
1919import java .io .IOException ;
20+ import java .util .Base64 ;
2021
2122import org .junit .Test ;
2223import org .junit .runner .RunWith ;
2627import org .springframework .http .MediaType ;
2728import org .springframework .restdocs .AbstractSnippetTests ;
2829import org .springframework .restdocs .templates .TemplateFormat ;
29- import org .springframework .util .Base64Utils ;
3030
3131import static org .assertj .core .api .Assertions .assertThat ;
3232
@@ -260,7 +260,7 @@ public void multipartPost() throws IOException {
260260 @ Test
261261 public void basicAuthCredentialsAreSuppliedUsingAuthOption () throws IOException {
262262 new HttpieRequestSnippet (this .commandFormatter ).document (this .operationBuilder .request ("http://localhost/foo" )
263- .header (HttpHeaders .AUTHORIZATION , "Basic " + Base64Utils .encodeToString ("user:secret" .getBytes ()))
263+ .header (HttpHeaders .AUTHORIZATION , "Basic " + Base64 . getEncoder () .encodeToString ("user:secret" .getBytes ()))
264264 .build ());
265265 assertThat (this .generatedSnippets .httpieRequest ())
266266 .is (codeBlock ("bash" ).withContent ("$ http --auth 'user:secret' GET 'http://localhost/foo'" ));
You can’t perform that action at this time.
0 commit comments