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
aa0360e1
Commit
aa0360e1
authored
Feb 09, 2020
by
dreis2211
Committed by
Stephane Nicoll
Feb 10, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some deprecation warnings
See gh-20108
parent
ddcf5966
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 @
aa0360e1
...
...
@@ -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
)).
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 @
aa0360e1
/*
* 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");
* 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
;
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/elasticsearch/rest/RestClientAutoConfigurationTests.java
View file @
aa0360e1
/*
* 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");
* you may not use this file except in compliance with the License.
...
...
@@ -145,9 +145,9 @@ class RestClientAutoConfigurationTests {
Map
<
String
,
String
>
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
();
});
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java
View file @
aa0360e1
...
...
@@ -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
();
});
}
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/web/servlet/mockmvc/HateoasController.java
View file @
aa0360e1
/*
* 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");
* 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
<
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"
)
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/netty/NettyReactiveWebServerFactoryTests.java
View file @
aa0360e1
/*
* 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");
* 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
));
}
}
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-elasticsearch/src/main/java/smoketest/data/elasticsearch/Customer.java
View file @
aa0360e1
/*
* 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");
* 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
...
...
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-data-solr/src/main/java/smoketest/data/solr/Product.java
View file @
aa0360e1
/*
* 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");
* 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
...
...
spring-boot-tests/spring-boot-smoke-tests/spring-boot-smoke-test-rsocket/src/test/java/smoketest/rsocket/SampleRSocketApplicationTests.java
View file @
aa0360e1
/*
* 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");
* 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.
Basic
AuthenticationEncoder
;
import
org.springframework.security.rsocket.metadata.
Simple
AuthenticationEncoder
;
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
Basic
AuthenticationEncoder
()))
.
rsocketStrategies
((
builder
)
->
builder
.
encoder
(
new
Simple
AuthenticationEncoder
()))
.
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
<
Project
>
result
=
requester
.
route
(
"find.project.spring-boot"
).
retrieveMono
(
Project
.
class
);
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