diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java index 7ba9b16d88..9cb8c627fb 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java @@ -267,7 +267,7 @@ class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationTests { assertThat(cacheManager.getCacheNames()).isEmpty(); RedisCacheConfiguration redisCacheConfiguration = getDefaultRedisCacheConfiguration(cacheManager); assertThat(redisCacheConfiguration.getTtl()).isEqualTo(java.time.Duration.ofSeconds(30)); - assertThat(redisCacheConfiguration.getKeyPrefixFor("")).isEqualTo("bar"); + assertThat(redisCacheConfiguration.getKeyPrefixFor("")).isEqualTo("bar::"); }); } @@ -758,7 +758,7 @@ class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationTests { @Bean org.springframework.data.redis.cache.RedisCacheConfiguration customRedisCacheConfiguration() { return org.springframework.data.redis.cache.RedisCacheConfiguration.defaultCacheConfig() - .entryTtl(java.time.Duration.ofSeconds(30)).prefixKeysWith("bar"); + .entryTtl(java.time.Duration.ofSeconds(30)).prefixCacheNameWith("bar"); } } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/city/City.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/city/City.java index 9b7fe46755..7a47db1a6b 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/city/City.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/city/City.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,7 @@ import java.io.Serializable; import org.springframework.data.annotation.Id; import org.springframework.data.elasticsearch.annotations.Document; -@Document(indexName = "city", type = "city", shards = 1, replicas = 0, refreshInterval = "-1") +@Document(indexName = "city", shards = 1, replicas = 0, refreshInterval = "-1") public class City implements Serializable { private static final long serialVersionUID = 1L; diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientAutoConfigurationTests.java index 40e36c9bd0..04c6e05d8d 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientAutoConfigurationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -145,9 +145,9 @@ class RestClientAutoConfigurationTests { Map source = new HashMap<>(); source.put("a", "alpha"); source.put("b", "bravo"); - IndexRequest index = new IndexRequest("foo", "bar", "1").source(source); + IndexRequest index = new IndexRequest("test").id("1").source(source); client.index(index, RequestOptions.DEFAULT); - GetRequest getRequest = new GetRequest("foo", "bar", "1"); + GetRequest getRequest = new GetRequest("test").id("1"); assertThat(client.get(getRequest, RequestOptions.DEFAULT).isExists()).isTrue(); }); } diff --git a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java index baca05f41a..afcdcfe1c7 100644 --- a/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java @@ -230,11 +230,12 @@ class JacksonAutoConfigurationTests { @Test void enableGeneratorFeature() { - this.contextRunner.withPropertyValues("spring.jackson.generator.write_numbers_as_strings:true") + this.contextRunner.withPropertyValues("spring.jackson.generator.strict_duplicate_detection:true") .run((context) -> { ObjectMapper mapper = context.getBean(ObjectMapper.class); - assertThat(JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS.enabledByDefault()).isFalse(); - assertThat(mapper.getFactory().isEnabled(JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS)).isTrue(); + JsonGenerator.Feature feature = JsonGenerator.Feature.STRICT_DUPLICATE_DETECTION; + assertThat(feature.enabledByDefault()).isFalse(); + assertThat(mapper.getFactory().isEnabled(feature)).isTrue(); }); } diff --git a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/HateoasController.java b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/HateoasController.java index 00ca2cce02..d488867b3f 100644 --- a/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/HateoasController.java +++ b/spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/HateoasController.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import java.util.Map; import org.springframework.hateoas.EntityModel; import org.springframework.hateoas.Link; +import org.springframework.hateoas.LinkRelation; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; @@ -36,7 +37,7 @@ class HateoasController { @RequestMapping("/resource") EntityModel> resource() { - return new EntityModel<>(new HashMap<>(), new Link("self", "https://api.example.com")); + return EntityModel.of(new HashMap<>(), Link.of("self", LinkRelation.of("https://api.example.com"))); } @RequestMapping("/plain") diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactoryTests.java index 05d276fc6c..562a08ece2 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -123,9 +123,8 @@ class NettyReactiveWebServerFactoryTests extends AbstractReactiveWebServerFactor ReactorClientHttpConnector connector = buildTrustAllSslConnector(); WebClient client = WebClient.builder().baseUrl("https://localhost:" + this.webServer.getPort()) .clientConnector(connector).build(); - return client.post().uri("/test").contentType(MediaType.TEXT_PLAIN) - .body(BodyInserters.fromObject("Hello World")).exchange() - .flatMap((response) -> response.bodyToMono(String.class)); + return client.post().uri("/test").contentType(MediaType.TEXT_PLAIN).body(BodyInserters.fromValue("Hello World")) + .exchange().flatMap((response) -> response.bodyToMono(String.class)); } } diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/src/main/java/smoketest/data/elasticsearch/Customer.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/src/main/java/smoketest/data/elasticsearch/Customer.java index ff8bd0b11d..a258004079 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/src/main/java/smoketest/data/elasticsearch/Customer.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/src/main/java/smoketest/data/elasticsearch/Customer.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ package smoketest.data.elasticsearch; import org.springframework.data.annotation.Id; import org.springframework.data.elasticsearch.annotations.Document; -@Document(indexName = "customer", type = "customer", shards = 1, replicas = 0, refreshInterval = "-1") +@Document(indexName = "customer", shards = 1, replicas = 0, refreshInterval = "-1") public class Customer { @Id diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-solr/src/main/java/smoketest/data/solr/Product.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-solr/src/main/java/smoketest/data/solr/Product.java index c62220f579..76f9eb1e66 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-solr/src/main/java/smoketest/data/solr/Product.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-solr/src/main/java/smoketest/data/solr/Product.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ import org.springframework.data.annotation.Id; import org.springframework.data.solr.core.geo.Point; import org.springframework.data.solr.core.mapping.SolrDocument; -@SolrDocument(solrCoreName = "collection1") +@SolrDocument(collection = "collection1") public class Product { @Id diff --git a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-rsocket/src/test/java/smoketest/rsocket/SampleRSocketApplicationTests.java b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-rsocket/src/test/java/smoketest/rsocket/SampleRSocketApplicationTests.java index baefcc9090..b7d38bb1c7 100644 --- a/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-rsocket/src/test/java/smoketest/rsocket/SampleRSocketApplicationTests.java +++ b/spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-rsocket/src/test/java/smoketest/rsocket/SampleRSocketApplicationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2019 the original author or authors. + * Copyright 2012-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,6 +18,7 @@ package smoketest.rsocket; import java.time.Duration; +import io.rsocket.metadata.WellKnownMimeType; import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; import reactor.core.publisher.Mono; @@ -27,8 +28,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.rsocket.context.LocalRSocketServerPort; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.messaging.rsocket.RSocketRequester; -import org.springframework.security.rsocket.metadata.BasicAuthenticationEncoder; +import org.springframework.security.rsocket.metadata.SimpleAuthenticationEncoder; import org.springframework.security.rsocket.metadata.UsernamePasswordMetadata; +import org.springframework.util.MimeTypeUtils; @SpringBootTest(properties = "spring.rsocket.server.port=0") public class SampleRSocketApplicationTests { @@ -49,9 +51,9 @@ public class SampleRSocketApplicationTests { @Test void rSocketEndpoint() { RSocketRequester requester = this.builder - .rsocketStrategies((builder) -> builder.encoder(new BasicAuthenticationEncoder())) + .rsocketStrategies((builder) -> builder.encoder(new SimpleAuthenticationEncoder())) .setupMetadata(new UsernamePasswordMetadata("user", "password"), - UsernamePasswordMetadata.BASIC_AUTHENTICATION_MIME_TYPE) + MimeTypeUtils.parseMimeType(WellKnownMimeType.MESSAGE_RSOCKET_AUTHENTICATION.getString())) .connectTcp("localhost", this.port).block(Duration.ofSeconds(5)); Mono result = requester.route("find.project.spring-boot").retrieveMono(Project.class); StepVerifier.create(result)