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
f0693989
Commit
f0693989
authored
Sep 23, 2017
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish
parent
56d820a8
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
100 additions
and
84 deletions
+100
-84
SessionsEndpointAutoConfigurationTests.java
...igure/session/SessionsEndpointAutoConfigurationTests.java
+1
-1
SessionsEndpoint.java
...pringframework/boot/actuate/session/SessionsEndpoint.java
+1
-1
SessionsEndpointTests.java
...framework/boot/actuate/session/SessionsEndpointTests.java
+2
-2
SessionsEndpointWebIntegrationTests.java
.../actuate/session/SessionsEndpointWebIntegrationTests.java
+3
-3
JsonbHttpMessageConvertersConfiguration.java
...nfigure/http/JsonbHttpMessageConvertersConfiguration.java
+2
-2
HttpMessageConvertersAutoConfigurationTests.java
...ure/http/HttpMessageConvertersAutoConfigurationTests.java
+72
-60
JsonTest.java
...pringframework/boot/test/autoconfigure/json/JsonTest.java
+2
-2
ApplicationContextAssert.java
...k/boot/test/context/assertj/ApplicationContextAssert.java
+1
-1
CollectionBinder.java
...mework/boot/context/properties/bind/CollectionBinder.java
+4
-3
MapBinder.java
...ringframework/boot/context/properties/bind/MapBinder.java
+3
-1
DataSourceBuilder.java
...java/org/springframework/boot/jdbc/DataSourceBuilder.java
+2
-2
BinderTests.java
...ngframework/boot/context/properties/bind/BinderTests.java
+4
-2
CollectionBinderTests.java
...k/boot/context/properties/bind/CollectionBinderTests.java
+1
-2
DataSourceBuilderTests.java
...org/springframework/boot/jdbc/DataSourceBuilderTests.java
+2
-2
No files found.
spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/session/SessionsEndpointAutoConfigurationTests.java
View file @
f0693989
...
...
@@ -64,7 +64,7 @@ public class SessionsEndpointAutoConfigurationTests {
static
class
SessionConfiguration
{
@Bean
public
FindByIndexNameSessionRepository
sessionRepository
()
{
public
FindByIndexNameSessionRepository
<?>
sessionRepository
()
{
return
mock
(
FindByIndexNameSessionRepository
.
class
);
}
...
...
spring-boot-actuator/src/main/java/org/springframework/boot/actuate/session/SessionsEndpoint.java
View file @
f0693989
...
...
@@ -78,7 +78,7 @@ public class SessionsEndpoint {
public
SessionsReport
(
Map
<
String
,
?
extends
Session
>
sessions
)
{
this
.
sessions
=
sessions
.
entrySet
().
stream
()
.
map
(
s
->
new
SessionDescriptor
(
s
.
getValue
()))
.
map
(
(
s
)
->
new
SessionDescriptor
(
s
.
getValue
()))
.
collect
(
Collectors
.
toList
());
}
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/session/SessionsEndpointTests.java
View file @
f0693989
...
...
@@ -40,10 +40,10 @@ public class SessionsEndpointTests {
private
static
final
Session
session
=
new
MapSession
();
private
final
FindByIndexNameSessionRepository
repository
=
mock
(
@SuppressWarnings
(
"unchecked"
)
private
final
FindByIndexNameSessionRepository
<
Session
>
repository
=
mock
(
FindByIndexNameSessionRepository
.
class
);
@SuppressWarnings
(
"unchecked"
)
private
final
SessionsEndpoint
endpoint
=
new
SessionsEndpoint
(
this
.
repository
);
@Test
...
...
spring-boot-actuator/src/test/java/org/springframework/boot/actuate/session/SessionsEndpointWebIntegrationTests.java
View file @
f0693989
...
...
@@ -44,7 +44,8 @@ public class SessionsEndpointWebIntegrationTests {
private
static
final
Session
session
=
new
MapSession
();
private
static
final
FindByIndexNameSessionRepository
repository
=
mock
(
@SuppressWarnings
(
"unchecked"
)
private
static
final
FindByIndexNameSessionRepository
<
Session
>
repository
=
mock
(
FindByIndexNameSessionRepository
.
class
);
private
static
WebTestClient
client
;
...
...
@@ -59,7 +60,7 @@ public class SessionsEndpointWebIntegrationTests {
public
void
sessionsForUsernameNoResults
()
throws
Exception
{
given
(
repository
.
findByIndexNameAndIndexValue
(
FindByIndexNameSessionRepository
.
PRINCIPAL_NAME_INDEX_NAME
,
"user"
))
.
willReturn
(
Collections
.
emptyMap
());
.
willReturn
(
Collections
.
emptyMap
());
client
.
get
()
.
uri
((
builder
)
->
builder
.
path
(
"/application/sessions"
)
.
queryParam
(
"username"
,
"user"
).
build
())
...
...
@@ -83,7 +84,6 @@ public class SessionsEndpointWebIntegrationTests {
protected
static
class
TestConfiguration
{
@Bean
@SuppressWarnings
(
"unchecked"
)
public
SessionsEndpoint
sessionsEndpoint
()
{
return
new
SessionsEndpoint
(
repository
);
}
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/http/JsonbHttpMessageConvertersConfiguration.java
View file @
f0693989
...
...
@@ -67,12 +67,12 @@ class JsonbHttpMessageConvertersConfiguration {
}
@ConditionalOnMissingBean
({
MappingJackson2HttpMessageConverter
.
class
,
GsonHttpMessageConverter
.
class
})
@ConditionalOnMissingBean
({
MappingJackson2HttpMessageConverter
.
class
,
GsonHttpMessageConverter
.
class
})
static
class
JacksonAndGsonMissing
{
}
}
}
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/http/HttpMessageConvertersAutoConfigurationTests.java
View file @
f0693989
...
...
@@ -61,15 +61,17 @@ import static org.assertj.core.api.Assertions.assertThat;
public
class
HttpMessageConvertersAutoConfigurationTests
{
private
ApplicationContextRunner
contextRunner
=
new
ApplicationContextRunner
()
.
withConfiguration
(
AutoConfigurations
.
of
(
HttpMessageConvertersAutoConfiguration
.
class
));
.
withConfiguration
(
AutoConfigurations
.
of
(
HttpMessageConvertersAutoConfiguration
.
class
));
@Test
public
void
jacksonNotAvailable
()
{
this
.
contextRunner
.
run
((
context
)
->
{
assertThat
(
context
).
doesNotHaveBean
(
ObjectMapper
.
class
);
assertThat
(
context
).
doesNotHaveBean
(
MappingJackson2HttpMessageConverter
.
class
);
assertThat
(
context
).
doesNotHaveBean
(
MappingJackson2XmlHttpMessageConverter
.
class
);
assertThat
(
context
)
.
doesNotHaveBean
(
MappingJackson2HttpMessageConverter
.
class
);
assertThat
(
context
)
.
doesNotHaveBean
(
MappingJackson2XmlHttpMessageConverter
.
class
);
});
}
...
...
@@ -96,10 +98,11 @@ public class HttpMessageConvertersAutoConfigurationTests {
@Test
public
void
jacksonCustomConverter
()
{
this
.
contextRunner
.
withUserConfiguration
(
JacksonObjectMapperConfig
.
class
,
JacksonConverterConfig
.
class
).
run
(
assertConverter
(
MappingJackson2HttpMessageConverter
.
class
,
"customJacksonMessageConverter"
));
this
.
contextRunner
.
withUserConfiguration
(
JacksonObjectMapperConfig
.
class
,
JacksonConverterConfig
.
class
)
.
run
(
assertConverter
(
MappingJackson2HttpMessageConverter
.
class
,
"customJacksonMessageConverter"
));
}
@Test
...
...
@@ -112,10 +115,10 @@ public class HttpMessageConvertersAutoConfigurationTests {
@Test
public
void
gsonDefaultConverter
()
{
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
GsonAutoConfiguration
.
class
)
)
.
run
(
assertConverter
(
GsonHttpMessageConverter
.
class
,
"gsonHttpMessageConverter"
));
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
GsonAutoConfiguration
.
class
)
)
.
run
(
assertConverter
(
GsonHttpMessageConverter
.
class
,
"gsonHttpMessageConverter"
));
}
@Test
...
...
@@ -128,15 +131,17 @@ public class HttpMessageConvertersAutoConfigurationTests {
@Test
public
void
gsonCanBePreferred
()
{
allOptionsRunner
().
withPropertyValues
(
"spring.http.converters.preferred-json-mapper:gson"
).
run
((
context
)
->
{
assertConverterBeanExists
(
context
,
GsonHttpMessageConverter
.
class
,
"gsonHttpMessageConverter"
);
assertConverterBeanRegisteredWithHttpMessageConverters
(
context
,
GsonHttpMessageConverter
.
class
);
assertThat
(
context
).
doesNotHaveBean
(
JsonbHttpMessageConverter
.
class
);
assertThat
(
context
).
doesNotHaveBean
(
MappingJackson2HttpMessageConverter
.
class
);
});
allOptionsRunner
()
.
withPropertyValues
(
"spring.http.converters.preferred-json-mapper:gson"
)
.
run
((
context
)
->
{
assertConverterBeanExists
(
context
,
GsonHttpMessageConverter
.
class
,
"gsonHttpMessageConverter"
);
assertConverterBeanRegisteredWithHttpMessageConverters
(
context
,
GsonHttpMessageConverter
.
class
);
assertThat
(
context
).
doesNotHaveBean
(
JsonbHttpMessageConverter
.
class
);
assertThat
(
context
)
.
doesNotHaveBean
(
MappingJackson2HttpMessageConverter
.
class
);
});
}
@Test
...
...
@@ -149,10 +154,10 @@ public class HttpMessageConvertersAutoConfigurationTests {
@Test
public
void
jsonbDefaultConverter
()
{
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
JsonbAutoConfiguration
.
class
)
)
.
run
(
assertConverter
(
JsonbHttpMessageConverter
.
class
,
"jsonbHttpMessageConverter"
));
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
JsonbAutoConfiguration
.
class
)
)
.
run
(
assertConverter
(
JsonbHttpMessageConverter
.
class
,
"jsonbHttpMessageConverter"
));
}
@Test
...
...
@@ -165,15 +170,17 @@ public class HttpMessageConvertersAutoConfigurationTests {
@Test
public
void
jsonbCanBePreferred
()
{
allOptionsRunner
().
withPropertyValues
(
"spring.http.converters.preferred-json-mapper:jsonb"
).
run
((
context
)
->
{
assertConverterBeanExists
(
context
,
JsonbHttpMessageConverter
.
class
,
"jsonbHttpMessageConverter"
);
assertConverterBeanRegisteredWithHttpMessageConverters
(
context
,
JsonbHttpMessageConverter
.
class
);
assertThat
(
context
).
doesNotHaveBean
(
GsonHttpMessageConverter
.
class
);
assertThat
(
context
).
doesNotHaveBean
(
MappingJackson2HttpMessageConverter
.
class
);
});
allOptionsRunner
()
.
withPropertyValues
(
"spring.http.converters.preferred-json-mapper:jsonb"
)
.
run
((
context
)
->
{
assertConverterBeanExists
(
context
,
JsonbHttpMessageConverter
.
class
,
"jsonbHttpMessageConverter"
);
assertConverterBeanRegisteredWithHttpMessageConverters
(
context
,
JsonbHttpMessageConverter
.
class
);
assertThat
(
context
).
doesNotHaveBean
(
GsonHttpMessageConverter
.
class
);
assertThat
(
context
)
.
doesNotHaveBean
(
MappingJackson2HttpMessageConverter
.
class
);
});
}
@Test
...
...
@@ -193,22 +200,26 @@ public class HttpMessageConvertersAutoConfigurationTests {
public
void
typeConstrainedConverterDoesNotPreventAutoConfigurationOfJacksonConverter
()
{
this
.
contextRunner
.
withUserConfiguration
(
JacksonObjectMapperBuilderConfig
.
class
,
TypeConstrainedConverterConfiguration
.
class
).
run
((
context
)
->
{
BeanDefinition
beanDefinition
=
((
GenericApplicationContext
)
context
.
getSourceApplicationContext
())
.
getBeanDefinition
(
"mappingJackson2HttpMessageConverter"
);
assertThat
(
beanDefinition
.
getFactoryBeanName
()).
isEqualTo
(
MappingJackson2HttpMessageConverterConfiguration
.
class
.
getName
());
});
BeanDefinition
beanDefinition
=
((
GenericApplicationContext
)
context
.
getSourceApplicationContext
()).
getBeanDefinition
(
"mappingJackson2HttpMessageConverter"
);
assertThat
(
beanDefinition
.
getFactoryBeanName
()).
isEqualTo
(
MappingJackson2HttpMessageConverterConfiguration
.
class
.
getName
());
});
}
@Test
public
void
typeConstrainedConverterFromSpringDataDoesNotPreventAutoConfigurationOfJacksonConverter
()
{
this
.
contextRunner
.
withUserConfiguration
(
JacksonObjectMapperBuilderConfig
.
class
,
RepositoryRestMvcConfiguration
.
class
).
run
((
context
)
->
{
BeanDefinition
beanDefinition
=
((
GenericApplicationContext
)
context
.
getSourceApplicationContext
())
.
getBeanDefinition
(
"mappingJackson2HttpMessageConverter"
);
assertThat
(
beanDefinition
.
getFactoryBeanName
()).
isEqualTo
(
MappingJackson2HttpMessageConverterConfiguration
.
class
.
getName
());
});
BeanDefinition
beanDefinition
=
((
GenericApplicationContext
)
context
.
getSourceApplicationContext
()).
getBeanDefinition
(
"mappingJackson2HttpMessageConverter"
);
assertThat
(
beanDefinition
.
getFactoryBeanName
()).
isEqualTo
(
MappingJackson2HttpMessageConverterConfiguration
.
class
.
getName
());
});
}
@Test
...
...
@@ -225,13 +236,13 @@ public class HttpMessageConvertersAutoConfigurationTests {
@Test
public
void
gsonIsPreferredIfJacksonIsNotAvailable
()
{
allOptionsRunner
()
.
withClassLoader
(
new
HidePackagesClassLoader
(
ObjectMapper
.
class
.
getPackage
().
getName
()))
.
run
((
context
)
->
{
assertConverterBeanExists
(
context
,
GsonHttpMessageConverter
.
class
,
"gsonHttpMessageConverter"
);
assertThat
(
context
).
doesNotHaveBean
(
JsonbHttpMessageConverter
.
class
);
});
allOptionsRunner
()
.
withClassLoader
(
new
HidePackagesClassLoader
(
ObjectMapper
.
class
.
getPackage
().
getName
()))
.
run
((
context
)
->
{
assertConverterBeanExists
(
context
,
GsonHttpMessageConverter
.
class
,
"gsonHttpMessageConverter"
);
assertThat
(
context
).
doesNotHaveBean
(
JsonbHttpMessageConverter
.
class
);
});
}
@Test
...
...
@@ -245,17 +256,17 @@ public class HttpMessageConvertersAutoConfigurationTests {
}
private
ApplicationContextRunner
allOptionsRunner
()
{
return
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
GsonAutoConfiguration
.
class
,
Jack
sonAutoConfiguration
.
class
,
JsonbAutoConfiguration
.
class
));
return
this
.
contextRunner
.
withConfiguration
(
AutoConfigurations
.
of
(
G
sonAutoConfiguration
.
class
,
JacksonAutoConfiguration
.
class
,
JsonbAutoConfiguration
.
class
));
}
private
ContextConsumer
<
AssertableApplicationContext
>
assertConverter
(
Class
<?
extends
HttpMessageConverter
>
converterType
,
String
beanName
)
{
return
context
->
{
Class
<?
extends
HttpMessageConverter
<?>
>
converterType
,
String
beanName
)
{
return
(
context
)
->
{
assertConverterBeanExists
(
context
,
converterType
,
beanName
);
assertConverterBeanRegisteredWithHttpMessageConverters
(
context
,
converterType
);
assertConverterBeanRegisteredWithHttpMessageConverters
(
context
,
converterType
);
};
}
...
...
@@ -266,8 +277,9 @@ public class HttpMessageConvertersAutoConfigurationTests {
}
private
void
assertConverterBeanRegisteredWithHttpMessageConverters
(
AssertableApplicationContext
context
,
Class
<?
extends
HttpMessageConverter
>
type
)
{
HttpMessageConverter
converter
=
context
.
getBean
(
type
);
AssertableApplicationContext
context
,
Class
<?
extends
HttpMessageConverter
<?>>
type
)
{
HttpMessageConverter
<?>
converter
=
context
.
getBean
(
type
);
HttpMessageConverters
converters
=
context
.
getBean
(
HttpMessageConverters
.
class
);
assertThat
(
converters
.
getConverters
()).
contains
(
converter
);
}
...
...
spring-boot-test-autoconfigure/src/main/java/org/springframework/boot/test/autoconfigure/json/JsonTest.java
View file @
f0693989
...
...
@@ -47,8 +47,8 @@ import org.springframework.test.context.BootstrapWith;
* <p>
* By default, tests annotated with {@code JsonTest} will also initialize
* {@link JacksonTester}, {@link JsonbTester} and {@link GsonTester} fields. More
* fine-grained control can be provided via the
{@link AutoConfigureJsonTesters @AutoConfigureJsonTesters}
* annotation.
* fine-grained control can be provided via the
*
{@link AutoConfigureJsonTesters @AutoConfigureJsonTesters}
annotation.
*
* @author Phillip Webb
* @see AutoConfigureJson
...
...
spring-boot-test/src/main/java/org/springframework/boot/test/context/assertj/ApplicationContextAssert.java
View file @
f0693989
...
...
@@ -370,7 +370,7 @@ public class ApplicationContextAssert<C extends ApplicationContext>
private
ContextFailedToStart
<
C
>
contextFailedToStartWhenExpecting
(
String
expectationFormat
,
Object
...
arguments
)
{
return
new
ContextFailedToStart
<
C
>(
getApplicationContext
(),
this
.
startupFailure
,
return
new
ContextFailedToStart
<>(
getApplicationContext
(),
this
.
startupFailure
,
expectationFormat
,
arguments
);
}
...
...
spring-boot/src/main/java/org/springframework/boot/context/properties/bind/CollectionBinder.java
View file @
f0693989
...
...
@@ -39,12 +39,13 @@ class CollectionBinder extends IndexedElementsBinder<Collection<Object>> {
protected
Object
bind
(
ConfigurationPropertyName
name
,
Bindable
<?>
target
,
AggregateElementBinder
elementBinder
,
Class
<?>
type
)
{
Class
<?>
collectionType
=
(
type
!=
null
?
type
:
ResolvableType
.
forClassWithGenerics
(
List
.
class
,
Object
.
class
).
resolve
());
:
ResolvableType
.
forClassWithGenerics
(
List
.
class
,
Object
.
class
)
.
resolve
());
IndexedCollectionSupplier
collection
=
new
IndexedCollectionSupplier
(
()
->
CollectionFactory
.
createCollection
(
collectionType
,
0
));
ResolvableType
elementType
=
target
.
getType
().
asCollection
().
getGeneric
();
bindIndexed
(
name
,
target
,
elementBinder
,
collection
,
ResolvableType
.
forClass
(
collectionType
),
elementType
);
bindIndexed
(
name
,
target
,
elementBinder
,
collection
,
ResolvableType
.
forClass
(
collectionType
),
elementType
);
if
(
collection
.
wasSupplied
())
{
return
collection
.
get
();
}
...
...
spring-boot/src/main/java/org/springframework/boot/context/properties/bind/MapBinder.java
View file @
f0693989
...
...
@@ -49,7 +49,9 @@ class MapBinder extends AggregateBinder<Map<Object, Object>> {
protected
Object
bind
(
ConfigurationPropertyName
name
,
Bindable
<?>
target
,
AggregateElementBinder
elementBinder
,
Class
<?>
type
)
{
Class
<?>
mapType
=
(
type
!=
null
?
type
:
ResolvableType
.
forClassWithGenerics
(
Map
.
class
,
Object
.
class
,
Object
.
class
).
resolve
());
:
ResolvableType
.
forClassWithGenerics
(
Map
.
class
,
Object
.
class
,
Object
.
class
)
.
resolve
());
Map
<
Object
,
Object
>
map
=
CollectionFactory
.
createMap
(
mapType
,
0
);
Bindable
<?>
resolvedTarget
=
resolveTarget
(
target
);
for
(
ConfigurationPropertySource
source
:
getContext
().
getSources
())
{
...
...
spring-boot/src/main/java/org/springframework/boot/jdbc/DataSourceBuilder.java
View file @
f0693989
...
...
@@ -58,11 +58,11 @@ public final class DataSourceBuilder<T extends DataSource> {
private
Map
<
String
,
String
>
properties
=
new
HashMap
<>();
public
static
DataSourceBuilder
<?>
create
()
{
return
new
DataSourceBuilder
<
DataSource
>(
null
);
return
new
DataSourceBuilder
<>(
null
);
}
public
static
DataSourceBuilder
<?>
create
(
ClassLoader
classLoader
)
{
return
new
DataSourceBuilder
<
DataSource
>(
classLoader
);
return
new
DataSourceBuilder
<>(
classLoader
);
}
private
DataSourceBuilder
(
ClassLoader
classLoader
)
{
...
...
spring-boot/src/test/java/org/springframework/boot/context/properties/bind/BinderTests.java
View file @
f0693989
...
...
@@ -199,13 +199,15 @@ public class BinderTests {
@Test
public
void
bindWhenHasMalformedDateShouldThrowException
()
throws
Exception
{
this
.
thrown
.
expectCause
(
instanceOf
(
ConversionFailedException
.
class
));
this
.
sources
.
add
(
new
MockConfigurationPropertySource
(
"foo"
,
"2014-04-01T01:30:00.000-05:00"
));
this
.
sources
.
add
(
new
MockConfigurationPropertySource
(
"foo"
,
"2014-04-01T01:30:00.000-05:00"
));
this
.
binder
.
bind
(
"foo"
,
Bindable
.
of
(
LocalDate
.
class
));
}
@Test
public
void
bindWhenHasAnnotationsShouldChangeConvertedValue
()
throws
Exception
{
this
.
sources
.
add
(
new
MockConfigurationPropertySource
(
"foo"
,
"2014-04-01T01:30:00.000-05:00"
));
this
.
sources
.
add
(
new
MockConfigurationPropertySource
(
"foo"
,
"2014-04-01T01:30:00.000-05:00"
));
DateTimeFormat
annotation
=
AnnotationUtils
.
synthesizeAnnotation
(
Collections
.
singletonMap
(
"iso"
,
DateTimeFormat
.
ISO
.
DATE_TIME
),
DateTimeFormat
.
class
,
null
);
...
...
spring-boot/src/test/java/org/springframework/boot/context/properties/bind/CollectionBinderTests.java
View file @
f0693989
...
...
@@ -322,8 +322,7 @@ public class CollectionBinderTests {
MockConfigurationPropertySource
source
=
new
MockConfigurationPropertySource
();
source
.
put
(
"foo.items"
,
"a,b,c,c"
);
this
.
sources
.
add
(
source
);
ExampleCustomBean
result
=
this
.
binder
.
bind
(
"foo"
,
ExampleCustomBean
.
class
).
get
();
ExampleCustomBean
result
=
this
.
binder
.
bind
(
"foo"
,
ExampleCustomBean
.
class
).
get
();
assertThat
(
result
.
getItems
()).
hasSize
(
4
);
assertThat
(
result
.
getItems
()).
containsExactly
(
"a"
,
"b"
,
"c"
,
"c"
);
}
...
...
spring-boot/src/test/java/org/springframework/boot/jdbc/DataSourceBuilderTests.java
View file @
f0693989
...
...
@@ -73,8 +73,8 @@ public class DataSourceBuilderTests {
@Test
public
void
specificTypeOfDataSource
()
{
HikariDataSource
hikariDataSource
=
DataSourceBuilder
.
create
()
.
type
(
HikariDataSource
.
class
)
.
build
();
HikariDataSource
hikariDataSource
=
DataSourceBuilder
.
create
()
.
type
(
HikariDataSource
.
class
).
build
();
assertThat
(
hikariDataSource
).
isInstanceOf
(
HikariDataSource
.
class
);
}
...
...
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