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
23cff6fb
Commit
23cff6fb
authored
May 31, 2019
by
Gary Russell
Committed by
Stephane Nicoll
Jun 03, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
KafkaAutoConfigurationIntegrationTests to JUnit5
See gh-17034
parent
f9f6544d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
7 deletions
+17
-7
KafkaAutoConfigurationIntegrationTests.java
...nfigure/kafka/KafkaAutoConfigurationIntegrationTests.java
+17
-7
No files found.
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfigurationIntegrationTests.java
View file @
23cff6fb
...
...
@@ -21,9 +21,10 @@ import java.util.concurrent.TimeUnit;
import
org.apache.kafka.clients.admin.NewTopic
;
import
org.apache.kafka.clients.producer.Producer
;
import
org.junit.ClassRule
;
import
org.junit.Test
;
import
org.junit.jupiter.api.AfterAll
;
import
org.junit.jupiter.api.AfterEach
;
import
org.junit.jupiter.api.BeforeAll
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.test.util.TestPropertyValues
;
import
org.springframework.context.annotation.AnnotationConfigApplicationContext
;
...
...
@@ -35,7 +36,7 @@ import org.springframework.kafka.config.StreamsBuilderFactoryBean;
import
org.springframework.kafka.core.DefaultKafkaProducerFactory
;
import
org.springframework.kafka.core.KafkaTemplate
;
import
org.springframework.kafka.support.KafkaHeaders
;
import
org.springframework.kafka.test.
rule.EmbeddedKafkaRule
;
import
org.springframework.kafka.test.
EmbeddedKafkaBroker
;
import
org.springframework.messaging.handler.annotation.Header
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
...
...
@@ -52,12 +53,16 @@ public class KafkaAutoConfigurationIntegrationTests {
private
static
final
String
ADMIN_CREATED_TOPIC
=
"adminCreatedTopic"
;
@ClassRule
public
static
final
EmbeddedKafkaRule
embeddedKafka
=
new
EmbeddedKafkaRule
(
1
,
true
,
TEST_TOPIC
);
public
static
final
EmbeddedKafkaBroker
embeddedKafka
=
new
EmbeddedKafkaBroker
(
1
,
true
,
TEST_TOPIC
);
private
AnnotationConfigApplicationContext
context
;
@BeforeAll
public
static
void
setUp
()
{
embeddedKafka
.
afterPropertiesSet
();
}
@AfterEach
public
void
close
()
{
if
(
this
.
context
!=
null
)
{
...
...
@@ -65,6 +70,11 @@ public class KafkaAutoConfigurationIntegrationTests {
}
}
@AfterAll
public
static
void
tearDown
()
{
embeddedKafka
.
destroy
();
}
@SuppressWarnings
({
"unchecked"
,
"rawtypes"
})
@Test
public
void
testEndToEnd
()
throws
Exception
{
...
...
@@ -110,7 +120,7 @@ public class KafkaAutoConfigurationIntegrationTests {
}
private
String
getEmbeddedKafkaBrokersAsString
()
{
return
embeddedKafka
.
get
EmbeddedKafka
().
get
BrokersAsString
();
return
embeddedKafka
.
getBrokersAsString
();
}
@Configuration
(
proxyBeanMethods
=
false
)
...
...
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