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
56af3534
Commit
56af3534
authored
Mar 31, 2020
by
Andy Wilkinson
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '2.2.x'
Closes gh-20740
parents
ed6e5421
e35bf8f4
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
47 additions
and
95 deletions
+47
-95
DataNeo4jTestIntegrationTests.java
...toconfigure/data/neo4j/DataNeo4jTestIntegrationTests.java
+7
-15
DataNeo4jTestPropertiesIntegrationTests.java
...e/data/neo4j/DataNeo4jTestPropertiesIntegrationTests.java
+7
-15
DataNeo4jTestWithIncludeFilterIntegrationTests.java
...neo4j/DataNeo4jTestWithIncludeFilterIntegrationTests.java
+7
-15
DataRedisTestIntegrationTests.java
...toconfigure/data/redis/DataRedisTestIntegrationTests.java
+10
-18
DataRedisTestPropertiesIntegrationTests.java
...e/data/redis/DataRedisTestPropertiesIntegrationTests.java
+8
-16
DataRedisTestWithIncludeFilterIntegrationTests.java
...redis/DataRedisTestWithIncludeFilterIntegrationTests.java
+8
-16
No files found.
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestIntegrationTests.java
View file @
56af3534
...
@@ -26,11 +26,9 @@ import org.testcontainers.junit.jupiter.Testcontainers;
...
@@ -26,11 +26,9 @@ import org.testcontainers.junit.jupiter.Testcontainers;
import
org.springframework.beans.factory.NoSuchBeanDefinitionException
;
import
org.springframework.beans.factory.NoSuchBeanDefinitionException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.util.TestPropertyValues
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextInitializer
;
import
org.springframework.test.context.DynamicPropertyRegistry
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.test.context.DynamicPropertySource
;
import
org.springframework.test.context.ContextConfiguration
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThatExceptionOfType
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThatExceptionOfType
;
...
@@ -42,7 +40,6 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
...
@@ -42,7 +40,6 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
* @author Stephane Nicoll
* @author Stephane Nicoll
* @author Michael Simons
* @author Michael Simons
*/
*/
@ContextConfiguration
(
initializers
=
DataNeo4jTestIntegrationTests
.
Initializer
.
class
)
@DataNeo4jTest
@DataNeo4jTest
@Testcontainers
(
disabledWithoutDocker
=
true
)
@Testcontainers
(
disabledWithoutDocker
=
true
)
class
DataNeo4jTestIntegrationTests
{
class
DataNeo4jTestIntegrationTests
{
...
@@ -60,6 +57,11 @@ class DataNeo4jTestIntegrationTests {
...
@@ -60,6 +57,11 @@ class DataNeo4jTestIntegrationTests {
@Autowired
@Autowired
private
ApplicationContext
applicationContext
;
private
ApplicationContext
applicationContext
;
@DynamicPropertySource
static
void
neo4jProperties
(
DynamicPropertyRegistry
registry
)
{
registry
.
add
(
"spring.data.neo4j.uri"
,
neo4j:
:
getBoltUrl
);
}
@Test
@Test
void
testRepository
()
{
void
testRepository
()
{
ExampleGraph
exampleGraph
=
new
ExampleGraph
();
ExampleGraph
exampleGraph
=
new
ExampleGraph
();
...
@@ -76,14 +78,4 @@ class DataNeo4jTestIntegrationTests {
...
@@ -76,14 +78,4 @@ class DataNeo4jTestIntegrationTests {
.
isThrownBy
(()
->
this
.
applicationContext
.
getBean
(
ExampleService
.
class
));
.
isThrownBy
(()
->
this
.
applicationContext
.
getBean
(
ExampleService
.
class
));
}
}
static
class
Initializer
implements
ApplicationContextInitializer
<
ConfigurableApplicationContext
>
{
@Override
public
void
initialize
(
ConfigurableApplicationContext
configurableApplicationContext
)
{
TestPropertyValues
.
of
(
"spring.data.neo4j.uri="
+
neo4j
.
getBoltUrl
())
.
applyTo
(
configurableApplicationContext
.
getEnvironment
());
}
}
}
}
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestPropertiesIntegrationTests.java
View file @
56af3534
...
@@ -24,11 +24,9 @@ import org.testcontainers.junit.jupiter.Container;
...
@@ -24,11 +24,9 @@ import org.testcontainers.junit.jupiter.Container;
import
org.testcontainers.junit.jupiter.Testcontainers
;
import
org.testcontainers.junit.jupiter.Testcontainers
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.util.TestPropertyValues
;
import
org.springframework.context.ApplicationContextInitializer
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.env.Environment
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.DynamicPropertyRegistry
;
import
org.springframework.test.context.DynamicPropertySource
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
@@ -39,7 +37,6 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -39,7 +37,6 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Artsiom Yudovin
* @author Artsiom Yudovin
*/
*/
@Testcontainers
(
disabledWithoutDocker
=
true
)
@Testcontainers
(
disabledWithoutDocker
=
true
)
@ContextConfiguration
(
initializers
=
DataNeo4jTestPropertiesIntegrationTests
.
Initializer
.
class
)
@DataNeo4jTest
(
properties
=
"spring.profiles.active=test"
)
@DataNeo4jTest
(
properties
=
"spring.profiles.active=test"
)
class
DataNeo4jTestPropertiesIntegrationTests
{
class
DataNeo4jTestPropertiesIntegrationTests
{
...
@@ -50,19 +47,14 @@ class DataNeo4jTestPropertiesIntegrationTests {
...
@@ -50,19 +47,14 @@ class DataNeo4jTestPropertiesIntegrationTests {
@Autowired
@Autowired
private
Environment
environment
;
private
Environment
environment
;
@DynamicPropertySource
static
void
neo4jProperties
(
DynamicPropertyRegistry
registry
)
{
registry
.
add
(
"spring.data.neo4j.uri"
,
neo4j:
:
getBoltUrl
);
}
@Test
@Test
void
environmentWithNewProfile
()
{
void
environmentWithNewProfile
()
{
assertThat
(
this
.
environment
.
getActiveProfiles
()).
containsExactly
(
"test"
);
assertThat
(
this
.
environment
.
getActiveProfiles
()).
containsExactly
(
"test"
);
}
}
static
class
Initializer
implements
ApplicationContextInitializer
<
ConfigurableApplicationContext
>
{
@Override
public
void
initialize
(
ConfigurableApplicationContext
configurableApplicationContext
)
{
TestPropertyValues
.
of
(
"spring.data.neo4j.uri="
+
neo4j
.
getBoltUrl
())
.
applyTo
(
configurableApplicationContext
.
getEnvironment
());
}
}
}
}
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/neo4j/DataNeo4jTestWithIncludeFilterIntegrationTests.java
View file @
56af3534
...
@@ -24,12 +24,10 @@ import org.testcontainers.junit.jupiter.Container;
...
@@ -24,12 +24,10 @@ import org.testcontainers.junit.jupiter.Container;
import
org.testcontainers.junit.jupiter.Testcontainers
;
import
org.testcontainers.junit.jupiter.Testcontainers
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.util.TestPropertyValues
;
import
org.springframework.context.ApplicationContextInitializer
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.ComponentScan.Filter
;
import
org.springframework.context.annotation.ComponentScan.Filter
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.DynamicPropertyRegistry
;
import
org.springframework.test.context.DynamicPropertySource
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
@@ -40,7 +38,6 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -40,7 +38,6 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Michael Simons
* @author Michael Simons
*/
*/
@Testcontainers
(
disabledWithoutDocker
=
true
)
@Testcontainers
(
disabledWithoutDocker
=
true
)
@ContextConfiguration
(
initializers
=
DataNeo4jTestWithIncludeFilterIntegrationTests
.
Initializer
.
class
)
@DataNeo4jTest
(
includeFilters
=
@Filter
(
Service
.
class
))
@DataNeo4jTest
(
includeFilters
=
@Filter
(
Service
.
class
))
class
DataNeo4jTestWithIncludeFilterIntegrationTests
{
class
DataNeo4jTestWithIncludeFilterIntegrationTests
{
...
@@ -51,19 +48,14 @@ class DataNeo4jTestWithIncludeFilterIntegrationTests {
...
@@ -51,19 +48,14 @@ class DataNeo4jTestWithIncludeFilterIntegrationTests {
@Autowired
@Autowired
private
ExampleService
service
;
private
ExampleService
service
;
@DynamicPropertySource
static
void
neo4jProperties
(
DynamicPropertyRegistry
registry
)
{
registry
.
add
(
"spring.data.neo4j.uri"
,
neo4j:
:
getBoltUrl
);
}
@Test
@Test
void
testService
()
{
void
testService
()
{
assertThat
(
this
.
service
.
hasNode
(
ExampleGraph
.
class
)).
isFalse
();
assertThat
(
this
.
service
.
hasNode
(
ExampleGraph
.
class
)).
isFalse
();
}
}
static
class
Initializer
implements
ApplicationContextInitializer
<
ConfigurableApplicationContext
>
{
@Override
public
void
initialize
(
ConfigurableApplicationContext
configurableApplicationContext
)
{
TestPropertyValues
.
of
(
"spring.data.neo4j.uri="
+
neo4j
.
getBoltUrl
())
.
applyTo
(
configurableApplicationContext
.
getEnvironment
());
}
}
}
}
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestIntegrationTests.java
View file @
56af3534
/*
/*
* 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.
...
@@ -25,14 +25,12 @@ import org.testcontainers.junit.jupiter.Testcontainers;
...
@@ -25,14 +25,12 @@ import org.testcontainers.junit.jupiter.Testcontainers;
import
org.springframework.beans.factory.NoSuchBeanDefinitionException
;
import
org.springframework.beans.factory.NoSuchBeanDefinitionException
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.util.TestPropertyValues
;
import
org.springframework.boot.testsupport.testcontainers.RedisContainer
;
import
org.springframework.boot.testsupport.testcontainers.RedisContainer
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContext
;
import
org.springframework.context.ApplicationContextInitializer
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.data.redis.connection.RedisConnection
;
import
org.springframework.data.redis.connection.RedisConnection
;
import
org.springframework.data.redis.core.RedisOperations
;
import
org.springframework.data.redis.core.RedisOperations
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.DynamicPropertyRegistry
;
import
org.springframework.test.context.DynamicPropertySource
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThatExceptionOfType
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThatExceptionOfType
;
...
@@ -43,12 +41,13 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
...
@@ -43,12 +41,13 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
* @author Jayaram Pradhan
* @author Jayaram Pradhan
*/
*/
@Testcontainers
(
disabledWithoutDocker
=
true
)
@Testcontainers
(
disabledWithoutDocker
=
true
)
@ContextConfiguration
(
initializers
=
DataRedisTestIntegrationTests
.
Initializer
.
class
)
@DataRedisTest
@DataRedisTest
class
DataRedisTestIntegrationTests
{
class
DataRedisTestIntegrationTests
{
private
static
final
Charset
CHARSET
=
StandardCharsets
.
UTF_8
;
@Container
@Container
public
static
RedisContainer
redis
=
new
RedisContainer
();
static
RedisContainer
redis
=
new
RedisContainer
();
@Autowired
@Autowired
private
RedisOperations
<
Object
,
Object
>
operations
;
private
RedisOperations
<
Object
,
Object
>
operations
;
...
@@ -59,7 +58,10 @@ class DataRedisTestIntegrationTests {
...
@@ -59,7 +58,10 @@ class DataRedisTestIntegrationTests {
@Autowired
@Autowired
private
ApplicationContext
applicationContext
;
private
ApplicationContext
applicationContext
;
private
static
final
Charset
CHARSET
=
StandardCharsets
.
UTF_8
;
@DynamicPropertySource
static
void
redisProperties
(
DynamicPropertyRegistry
registry
)
{
registry
.
add
(
"spring.redis.port"
,
redis:
:
getFirstMappedPort
);
}
@Test
@Test
void
testRepository
()
{
void
testRepository
()
{
...
@@ -79,14 +81,4 @@ class DataRedisTestIntegrationTests {
...
@@ -79,14 +81,4 @@ class DataRedisTestIntegrationTests {
.
isThrownBy
(()
->
this
.
applicationContext
.
getBean
(
ExampleService
.
class
));
.
isThrownBy
(()
->
this
.
applicationContext
.
getBean
(
ExampleService
.
class
));
}
}
static
class
Initializer
implements
ApplicationContextInitializer
<
ConfigurableApplicationContext
>
{
@Override
public
void
initialize
(
ConfigurableApplicationContext
configurableApplicationContext
)
{
TestPropertyValues
.
of
(
"spring.redis.port="
+
redis
.
getFirstMappedPort
())
.
applyTo
(
configurableApplicationContext
.
getEnvironment
());
}
}
}
}
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestPropertiesIntegrationTests.java
View file @
56af3534
/*
/*
* 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,12 +21,10 @@ import org.testcontainers.junit.jupiter.Container;
...
@@ -21,12 +21,10 @@ import org.testcontainers.junit.jupiter.Container;
import
org.testcontainers.junit.jupiter.Testcontainers
;
import
org.testcontainers.junit.jupiter.Testcontainers
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.util.TestPropertyValues
;
import
org.springframework.boot.testsupport.testcontainers.RedisContainer
;
import
org.springframework.boot.testsupport.testcontainers.RedisContainer
;
import
org.springframework.context.ApplicationContextInitializer
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.core.env.Environment
;
import
org.springframework.core.env.Environment
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.DynamicPropertyRegistry
;
import
org.springframework.test.context.DynamicPropertySource
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
@@ -37,7 +35,6 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -37,7 +35,6 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Artsiom Yudovin
* @author Artsiom Yudovin
*/
*/
@Testcontainers
(
disabledWithoutDocker
=
true
)
@Testcontainers
(
disabledWithoutDocker
=
true
)
@ContextConfiguration
(
initializers
=
DataRedisTestPropertiesIntegrationTests
.
Initializer
.
class
)
@DataRedisTest
(
properties
=
"spring.profiles.active=test"
)
@DataRedisTest
(
properties
=
"spring.profiles.active=test"
)
class
DataRedisTestPropertiesIntegrationTests
{
class
DataRedisTestPropertiesIntegrationTests
{
...
@@ -47,19 +44,14 @@ class DataRedisTestPropertiesIntegrationTests {
...
@@ -47,19 +44,14 @@ class DataRedisTestPropertiesIntegrationTests {
@Autowired
@Autowired
private
Environment
environment
;
private
Environment
environment
;
@DynamicPropertySource
static
void
redisProperties
(
DynamicPropertyRegistry
registry
)
{
registry
.
add
(
"spring.redis.port"
,
redis:
:
getFirstMappedPort
);
}
@Test
@Test
void
environmentWithNewProfile
()
{
void
environmentWithNewProfile
()
{
assertThat
(
this
.
environment
.
getActiveProfiles
()).
containsExactly
(
"test"
);
assertThat
(
this
.
environment
.
getActiveProfiles
()).
containsExactly
(
"test"
);
}
}
static
class
Initializer
implements
ApplicationContextInitializer
<
ConfigurableApplicationContext
>
{
@Override
public
void
initialize
(
ConfigurableApplicationContext
configurableApplicationContext
)
{
TestPropertyValues
.
of
(
"spring.redis.port="
+
redis
.
getFirstMappedPort
())
.
applyTo
(
configurableApplicationContext
.
getEnvironment
());
}
}
}
}
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/data/redis/DataRedisTestWithIncludeFilterIntegrationTests.java
View file @
56af3534
/*
/*
* 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,13 +21,11 @@ import org.testcontainers.junit.jupiter.Container;
...
@@ -21,13 +21,11 @@ import org.testcontainers.junit.jupiter.Container;
import
org.testcontainers.junit.jupiter.Testcontainers
;
import
org.testcontainers.junit.jupiter.Testcontainers
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.boot.test.util.TestPropertyValues
;
import
org.springframework.boot.testsupport.testcontainers.RedisContainer
;
import
org.springframework.boot.testsupport.testcontainers.RedisContainer
;
import
org.springframework.context.ApplicationContextInitializer
;
import
org.springframework.context.ConfigurableApplicationContext
;
import
org.springframework.context.annotation.ComponentScan.Filter
;
import
org.springframework.context.annotation.ComponentScan.Filter
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.test.context.ContextConfiguration
;
import
org.springframework.test.context.DynamicPropertyRegistry
;
import
org.springframework.test.context.DynamicPropertySource
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
@@ -37,7 +35,6 @@ import static org.assertj.core.api.Assertions.assertThat;
...
@@ -37,7 +35,6 @@ import static org.assertj.core.api.Assertions.assertThat;
* @author Jayaram Pradhan
* @author Jayaram Pradhan
*/
*/
@Testcontainers
(
disabledWithoutDocker
=
true
)
@Testcontainers
(
disabledWithoutDocker
=
true
)
@ContextConfiguration
(
initializers
=
DataRedisTestWithIncludeFilterIntegrationTests
.
Initializer
.
class
)
@DataRedisTest
(
includeFilters
=
@Filter
(
Service
.
class
))
@DataRedisTest
(
includeFilters
=
@Filter
(
Service
.
class
))
class
DataRedisTestWithIncludeFilterIntegrationTests
{
class
DataRedisTestWithIncludeFilterIntegrationTests
{
...
@@ -50,6 +47,11 @@ class DataRedisTestWithIncludeFilterIntegrationTests {
...
@@ -50,6 +47,11 @@ class DataRedisTestWithIncludeFilterIntegrationTests {
@Autowired
@Autowired
private
ExampleService
service
;
private
ExampleService
service
;
@DynamicPropertySource
static
void
redisProperties
(
DynamicPropertyRegistry
registry
)
{
registry
.
add
(
"spring.redis.port"
,
redis:
:
getFirstMappedPort
);
}
@Test
@Test
void
testService
()
{
void
testService
()
{
PersonHash
personHash
=
new
PersonHash
();
PersonHash
personHash
=
new
PersonHash
();
...
@@ -59,14 +61,4 @@ class DataRedisTestWithIncludeFilterIntegrationTests {
...
@@ -59,14 +61,4 @@ class DataRedisTestWithIncludeFilterIntegrationTests {
assertThat
(
this
.
service
.
hasRecord
(
savedEntity
)).
isTrue
();
assertThat
(
this
.
service
.
hasRecord
(
savedEntity
)).
isTrue
();
}
}
static
class
Initializer
implements
ApplicationContextInitializer
<
ConfigurableApplicationContext
>
{
@Override
public
void
initialize
(
ConfigurableApplicationContext
configurableApplicationContext
)
{
TestPropertyValues
.
of
(
"spring.redis.port="
+
redis
.
getFirstMappedPort
())
.
applyTo
(
configurableApplicationContext
.
getEnvironment
());
}
}
}
}
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