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
3cdb5a69
Commit
3cdb5a69
authored
Apr 11, 2020
by
Stephane Nicoll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Polish "Align Kafka's missingTopicsFatal default value"
See gh-20917
parent
a12eace2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
26 deletions
+42
-26
KafkaProperties.java
...ngframework/boot/autoconfigure/kafka/KafkaProperties.java
+1
-2
KafkaAutoConfigurationTests.java
...boot/autoconfigure/kafka/KafkaAutoConfigurationTests.java
+0
-24
KafkaPropertiesTests.java
...mework/boot/autoconfigure/kafka/KafkaPropertiesTests.java
+41
-0
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java
View file @
3cdb5a69
/*
* 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.
...
...
@@ -53,7 +53,6 @@ import org.springframework.util.unit.DataSize;
* @author Stephane Nicoll
* @author Artem Bilan
* @author Nakul Mishra
* @author Dhiren Mathur
* @since 1.5.0
*/
@ConfigurationProperties
(
prefix
=
"spring.kafka"
)
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaAutoConfigurationTests.java
View file @
3cdb5a69
...
...
@@ -38,7 +38,6 @@ import org.apache.kafka.streams.StreamsConfig;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.autoconfigure.AutoConfigurations
;
import
org.springframework.boot.autoconfigure.kafka.KafkaProperties.Listener
;
import
org.springframework.boot.test.context.runner.ApplicationContextRunner
;
import
org.springframework.context.annotation.Bean
;
import
org.springframework.context.annotation.Configuration
;
...
...
@@ -86,7 +85,6 @@ import static org.mockito.Mockito.verify;
* @author Stephane Nicoll
* @author Eddú Meléndez
* @author Nakul Mishra
* @author Dhiren Mathur
*/
class
KafkaAutoConfigurationTests
{
...
...
@@ -404,17 +402,6 @@ class KafkaAutoConfigurationTests {
});
}
@Test
void
listenerPropertiesMatchDefaults
()
{
this
.
contextRunner
.
run
((
context
)
->
{
Listener
listenerProperties
=
new
KafkaProperties
().
getListener
();
AbstractKafkaListenerContainerFactory
<?,
?,
?>
kafkaListenerContainerFactory
=
(
AbstractKafkaListenerContainerFactory
<?,
?,
?>)
context
.
getBean
(
KafkaListenerContainerFactory
.
class
);
ContainerProperties
containerProperties
=
kafkaListenerContainerFactory
.
getContainerProperties
();
assertThat
(
containerProperties
.
isMissingTopicsFatal
()).
isEqualTo
(
listenerProperties
.
isMissingTopicsFatal
());
});
}
@Test
void
testKafkaTemplateRecordMessageConverters
()
{
this
.
contextRunner
.
withUserConfiguration
(
MessageConverterConfiguration
.
class
)
...
...
@@ -581,17 +568,6 @@ class KafkaAutoConfigurationTests {
});
}
@Test
void
testConcurrentKafkaListenerContainerFactoryMatchesDefaults
()
{
Listener
listenerProperties
=
new
KafkaProperties
().
getListener
();
this
.
contextRunner
.
withUserConfiguration
(
ConsumerFactoryConfiguration
.
class
).
run
((
context
)
->
{
ConcurrentKafkaListenerContainerFactory
<?,
?>
kafkaListenerContainerFactory
=
context
.
getBean
(
ConcurrentKafkaListenerContainerFactory
.
class
);
assertThat
(
kafkaListenerContainerFactory
.
getContainerProperties
().
isMissingTopicsFatal
())
.
isEqualTo
(
listenerProperties
.
isMissingTopicsFatal
());
});
}
@Configuration
(
proxyBeanMethods
=
false
)
static
class
MessageConverterConfiguration
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/kafka/KafkaPropertiesTests.java
0 → 100644
View file @
3cdb5a69
/*
* Copyright 2012-2020 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.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
springframework
.
boot
.
autoconfigure
.
kafka
;
import
org.apache.kafka.clients.producer.KafkaProducer
;
import
org.junit.jupiter.api.Test
;
import
org.springframework.boot.autoconfigure.kafka.KafkaProperties.Listener
;
import
org.springframework.kafka.listener.ContainerProperties
;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
* Tests for {@link KafkaProducer}.
*
* @author Stephane Nicoll
*/
class
KafkaPropertiesTests
{
@Test
void
listenerDefaultValuesAreConsistent
()
{
ContainerProperties
container
=
new
ContainerProperties
(
"test"
);
Listener
listenerProperties
=
new
KafkaProperties
().
getListener
();
assertThat
(
listenerProperties
.
isMissingTopicsFatal
()).
isEqualTo
(
container
.
isMissingTopicsFatal
());
}
}
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