Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
b18db5ee
Commit
b18db5ee
authored
Feb 10, 2020
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #20108 from dreis2211
* pr/20108: Fix some deprecation warnings Closes gh-20108
parents
ddcf5966
aa0360e1
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
27 additions
and
24 deletions
+27
-24
CacheAutoConfigurationTests.java
...boot/autoconfigure/cache/CacheAutoConfigurationTests.java
+2
-2
City.java
...work/boot/autoconfigure/data/elasticsearch/city/City.java
+2
-2
RestClientAutoConfigurationTests.java
.../elasticsearch/rest/RestClientAutoConfigurationTests.java
+3
-3
JacksonAutoConfigurationTests.java
.../autoconfigure/jackson/JacksonAutoConfigurationTests.java
+4
-3
HateoasController.java
.../autoconfigure/web/servlet/mockmvc/HateoasController.java
+3
-2
NettyReactiveWebServerFactoryTests.java
...eb/embedded/netty/NettyReactiveWebServerFactoryTests.java
+3
-4
Customer.java
.../src/main/java/smoketest/data/elasticsearch/Customer.java
+2
-2
Product.java
...-data-solr/src/main/java/smoketest/data/solr/Product.java
+2
-2
SampleRSocketApplicationTests.java
...java/smoketest/rsocket/SampleRSocketApplicationTests.java
+6
-4
No files found.
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/cache/CacheAutoConfigurationTests.java
View file @
b18db5ee
...
@@ -267,7 +267,7 @@ class CacheAutoConfigurationTests extends AbstractCacheAutoConfigurationTests {
...
@@ -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 {
...
@@ -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
)).
prefix
Keys
With
(
"bar"
);
.
entryTtl
(
java
.
time
.
Duration
.
ofSeconds
(
30
)).
prefix
CacheName
With
(
"bar"
);
}
}
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/data/elasticsearch/city/City.java
View file @
b18db5ee
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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;
...
@@ -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
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientAutoConfigurationTests.java
View file @
b18db5ee
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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 {
...
@@ -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
();
});
});
}
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java
View file @
b18db5ee
...
@@ -230,11 +230,12 @@ class JacksonAutoConfigurationTests {
...
@@ -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
();
});
});
}
}
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/HateoasController.java
View file @
b18db5ee
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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;
...
@@ -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 {
...
@@ -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"
)
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactoryTests.java
View file @
b18db5ee
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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
...
@@ -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
));
}
}
}
}
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/src/main/java/smoketest/data/elasticsearch/Customer.java
View file @
b18db5ee
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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;
...
@@ -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
...
...
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-solr/src/main/java/smoketest/data/solr/Product.java
View file @
b18db5ee
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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;
...
@@ -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
...
...
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-rsocket/src/test/java/smoketest/rsocket/SampleRSocketApplicationTests.java
View file @
b18db5ee
/*
/*
* Copyright 2012-20
19
the original author or authors.
* Copyright 2012-20
20
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;
...
@@ -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;
...
@@ -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.
Basic
AuthenticationEncoder
;
import
org.springframework.security.rsocket.metadata.
Simple
AuthenticationEncoder
;
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 {
...
@@ -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
Basic
AuthenticationEncoder
()))
.
rsocketStrategies
((
builder
)
->
builder
.
encoder
(
new
Simple
AuthenticationEncoder
()))
.
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment