Skip to content

Commit ee5ea03

Browse files
committed
Fix deprecations from upstream dependencies
1 parent a8dd918 commit ee5ea03

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

spring-integration-sftp/src/test/java/org/springframework/integration/sftp/session/SftpServerTests.java

Lines changed: 3 additions & 3 deletions
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.
@@ -28,6 +28,7 @@
2828
import java.security.PublicKey;
2929
import java.security.spec.RSAPublicKeySpec;
3030
import java.util.Arrays;
31+
import java.util.Base64;
3132
import java.util.Collections;
3233

3334
import org.apache.sshd.common.file.virtualfs.VirtualFileSystemFactory;
@@ -40,7 +41,6 @@
4041
import org.springframework.core.io.ByteArrayResource;
4142
import org.springframework.core.io.ClassPathResource;
4243
import org.springframework.integration.file.remote.session.Session;
43-
import org.springframework.util.Base64Utils;
4444
import org.springframework.util.FileCopyUtils;
4545

4646
import static org.assertj.core.api.Assertions.assertThat;
@@ -121,7 +121,7 @@ private PublicKey decodePublicKey(String key) throws Exception {
121121
while (keyBytes[keyBytes.length - 1] == 0x0a || keyBytes[keyBytes.length - 1] == 0x0d) {
122122
keyBytes = Arrays.copyOf(keyBytes, keyBytes.length - 1);
123123
}
124-
byte[] decodeBuffer = Base64Utils.decode(keyBytes);
124+
byte[] decodeBuffer = Base64.getDecoder().decode(keyBytes);
125125
ByteBuffer bb = ByteBuffer.wrap(decodeBuffer);
126126
int len = bb.getInt();
127127
byte[] type = new byte[len];

spring-integration-webflux/src/test/java/org/springframework/integration/webflux/outbound/WebFluxRequestExecutingMessageHandlerTests.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2017-2022 the original author or authors.
2+
* Copyright 2017-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.
@@ -16,6 +16,7 @@
1616

1717
package org.springframework.integration.webflux.outbound;
1818

19+
import java.nio.charset.StandardCharsets;
1920
import java.time.Duration;
2021
import java.util.Map;
2122
import java.util.concurrent.atomic.AtomicReference;
@@ -282,9 +283,7 @@ void testClientHttpResponseAsReply() {
282283
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.OK);
283284
assertThat(response.getHeaders().getContentType()).isEqualTo(MediaType.TEXT_PLAIN);
284285

285-
StepVerifier.create(
286-
response.getBody()
287-
.map(dataBuffer -> new String(dataBuffer.toByteBuffer().array())))
286+
StepVerifier.create(response.getBody().map(dataBuffer -> dataBuffer.toString(StandardCharsets.UTF_8)))
288287
.expectNext("foo", "bar", "baz")
289288
.verifyComplete();
290289
}

0 commit comments

Comments
 (0)