parent
ddcf5966bb
commit
aa0360e1ba
|
@ -267,7 +267,7 @@ class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationTests {
|
||||||
assertThat(cacheManager.getCacheNames()).isEmpty();
|
assertThat(cacheManager.getCacheNames()).isEmpty();
|
||||||
RedisCacheConfiguration redisCacheConfiguration = getDefaultRedisCacheConfiguration(cacheManager);
|
RedisCacheConfiguration redisCacheConfiguration = getDefaultRedisCacheConfiguration(cacheManager);
|
||||||
assertThat(redisCacheConfiguration.getTtl()).isEqualTo(java.time.Duration.ofSeconds(30));
|
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
|
@Bean
|
||||||
org.springframework.data.redis.cache.RedisCacheConfiguration customRedisCacheConfiguration() {
|
org.springframework.data.redis.cache.RedisCacheConfiguration customRedisCacheConfiguration() {
|
||||||
return org.springframework.data.redis.cache.RedisCacheConfiguration.defaultCacheConfig()
|
return org.springframework.data.redis.cache.RedisCacheConfiguration.defaultCacheConfig()
|
||||||
.entryTtl(java.time.Duration.ofSeconds(30)).prefixKeysWith("bar");
|
.entryTtl(java.time.Duration.ofSeconds(30)).prefixCacheNameWith("bar");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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.annotation.Id;
|
||||||
import org.springframework.data.elasticsearch.annotations.Document;
|
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 {
|
public class City implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
@ -145,9 +145,9 @@ class RestClientAutoConfigurationTests {
|
||||||
Map<String, String> source = new HashMap<>();
|
Map<String, String> source = new HashMap<>();
|
||||||
source.put("a", "alpha");
|
source.put("a", "alpha");
|
||||||
source.put("b", "bravo");
|
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);
|
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();
|
assertThat(client.get(getRequest, RequestOptions.DEFAULT).isExists()).isTrue();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -230,11 +230,12 @@ class JacksonAutoConfigurationTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void enableGeneratorFeature() {
|
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) -> {
|
.run((context) -> {
|
||||||
ObjectMapper mapper = context.getBean(ObjectMapper.class);
|
ObjectMapper mapper = context.getBean(ObjectMapper.class);
|
||||||
assertThat(JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS.enabledByDefault()).isFalse();
|
JsonGenerator.Feature feature = JsonGenerator.Feature.STRICT_DUPLICATE_DETECTION;
|
||||||
assertThat(mapper.getFactory().isEnabled(JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS)).isTrue();
|
assertThat(feature.enabledByDefault()).isFalse();
|
||||||
|
assertThat(mapper.getFactory().isEnabled(feature)).isTrue();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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.EntityModel;
|
||||||
import org.springframework.hateoas.Link;
|
import org.springframework.hateoas.Link;
|
||||||
|
import org.springframework.hateoas.LinkRelation;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@ -36,7 +37,7 @@ class HateoasController {
|
||||||
|
|
||||||
@RequestMapping("/resource")
|
@RequestMapping("/resource")
|
||||||
EntityModel<Map<String, String>> resource() {
|
EntityModel<Map<String, String>> 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")
|
@RequestMapping("/plain")
|
||||||
|
|
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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();
|
ReactorClientHttpConnector connector = buildTrustAllSslConnector();
|
||||||
WebClient client = WebClient.builder().baseUrl("https://localhost:" + this.webServer.getPort())
|
WebClient client = WebClient.builder().baseUrl("https://localhost:" + this.webServer.getPort())
|
||||||
.clientConnector(connector).build();
|
.clientConnector(connector).build();
|
||||||
return client.post().uri("/test").contentType(MediaType.TEXT_PLAIN)
|
return client.post().uri("/test").contentType(MediaType.TEXT_PLAIN).body(BodyInserters.fromValue("Hello World"))
|
||||||
.body(BodyInserters.fromObject("Hello World")).exchange()
|
.exchange().flatMap((response) -> response.bodyToMono(String.class));
|
||||||
.flatMap((response) -> response.bodyToMono(String.class));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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.annotation.Id;
|
||||||
import org.springframework.data.elasticsearch.annotations.Document;
|
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 {
|
public class Customer {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
|
|
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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.geo.Point;
|
||||||
import org.springframework.data.solr.core.mapping.SolrDocument;
|
import org.springframework.data.solr.core.mapping.SolrDocument;
|
||||||
|
|
||||||
@SolrDocument(solrCoreName = "collection1")
|
@SolrDocument(collection = "collection1")
|
||||||
public class Product {
|
public class Product {
|
||||||
|
|
||||||
@Id
|
@Id
|
||||||
|
|
|
@ -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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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 java.time.Duration;
|
||||||
|
|
||||||
|
import io.rsocket.metadata.WellKnownMimeType;
|
||||||
import org.assertj.core.api.Assertions;
|
import org.assertj.core.api.Assertions;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import reactor.core.publisher.Mono;
|
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.rsocket.context.LocalRSocketServerPort;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.messaging.rsocket.RSocketRequester;
|
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.security.rsocket.metadata.UsernamePasswordMetadata;
|
||||||
|
import org.springframework.util.MimeTypeUtils;
|
||||||
|
|
||||||
@SpringBootTest(properties = "spring.rsocket.server.port=0")
|
@SpringBootTest(properties = "spring.rsocket.server.port=0")
|
||||||
public class SampleRSocketApplicationTests {
|
public class SampleRSocketApplicationTests {
|
||||||
|
@ -49,9 +51,9 @@ public class SampleRSocketApplicationTests {
|
||||||
@Test
|
@Test
|
||||||
void rSocketEndpoint() {
|
void rSocketEndpoint() {
|
||||||
RSocketRequester requester = this.builder
|
RSocketRequester requester = this.builder
|
||||||
.rsocketStrategies((builder) -> builder.encoder(new BasicAuthenticationEncoder()))
|
.rsocketStrategies((builder) -> builder.encoder(new SimpleAuthenticationEncoder()))
|
||||||
.setupMetadata(new UsernamePasswordMetadata("user", "password"),
|
.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));
|
.connectTcp("localhost", this.port).block(Duration.ofSeconds(5));
|
||||||
Mono<Project> result = requester.route("find.project.spring-boot").retrieveMono(Project.class);
|
Mono<Project> result = requester.route("find.project.spring-boot").retrieveMono(Project.class);
|
||||||
StepVerifier.create(result)
|
StepVerifier.create(result)
|
||||||
|
|
Loading…
Reference in New Issue