Skip to content

Commit ef07abb

Browse files
committed
Start building against Spring Framework 6.0.14 snapshots
See gh-904 Closes gh-906
1 parent 5a20c02 commit ef07abb

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ org.gradle.parallel=true
66

77
javaFormatVersion=0.0.39
88
jmustacheVersion=1.15
9-
springFrameworkVersion=6.0.0
9+
springFrameworkVersion=6.0.14-SNAPSHOT

spring-restdocs-core/src/main/java/org/springframework/restdocs/cli/CliOperationRequest.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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.
@@ -18,6 +18,7 @@
1818

1919
import java.net.URI;
2020
import java.util.Arrays;
21+
import java.util.Base64;
2122
import java.util.Collection;
2223
import java.util.HashSet;
2324
import java.util.List;
@@ -30,7 +31,6 @@
3031
import org.springframework.restdocs.operation.OperationRequest;
3132
import org.springframework.restdocs.operation.OperationRequestPart;
3233
import 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
}

spring-restdocs-core/src/main/java/org/springframework/restdocs/operation/preprocess/HeadersModifyingOperationPreprocessor.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
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
}

spring-restdocs-core/src/test/java/org/springframework/restdocs/cli/CurlRequestSnippetTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.springframework.restdocs.cli;
1818

1919
import java.io.IOException;
20+
import java.util.Base64;
2021

2122
import org.junit.Test;
2223
import org.junit.runner.RunWith;
@@ -26,7 +27,6 @@
2627
import org.springframework.http.MediaType;
2728
import org.springframework.restdocs.AbstractSnippetTests;
2829
import org.springframework.restdocs.templates.TemplateFormat;
29-
import org.springframework.util.Base64Utils;
3030

3131
import 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"));

spring-restdocs-core/src/test/java/org/springframework/restdocs/cli/HttpieRequestSnippetTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.springframework.restdocs.cli;
1818

1919
import java.io.IOException;
20+
import java.util.Base64;
2021

2122
import org.junit.Test;
2223
import org.junit.runner.RunWith;
@@ -26,7 +27,6 @@
2627
import org.springframework.http.MediaType;
2728
import org.springframework.restdocs.AbstractSnippetTests;
2829
import org.springframework.restdocs.templates.TemplateFormat;
29-
import org.springframework.util.Base64Utils;
3030

3131
import 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'"));

0 commit comments

Comments
 (0)