Skip to content

Commit 05ee48c

Browse files
committed
@embeddedkafka javadoc polishing
- place holders are not resolved when Spring is not being used
1 parent fa723bc commit 05ee48c

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

spring-kafka-test/src/main/java/org/springframework/kafka/test/EmbeddedKafkaBroker.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -610,7 +610,7 @@ public void shutdown() throws IOException {
610610
int n = 0;
611611
while (n++ < 100) {
612612
try {
613-
ZkFourLetterWords.sendStat("127.0.0.1", port, 3000);
613+
ZkFourLetterWords.sendStat("127.0.0.1", this.port, 3000);
614614
Thread.sleep(100);
615615
}
616616
catch (@SuppressWarnings("unused") Exception e) {

spring-kafka-test/src/main/java/org/springframework/kafka/test/context/EmbeddedKafka.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,19 +108,23 @@
108108
int partitions() default 2;
109109

110110
/**
111-
* Topics that should be created Topics may contain property placeholders, e.g.
111+
* Topics that should be created Topics may contain property place holders, e.g.
112112
* {@code topics = "${kafka.topic.one:topicOne}"} The topics will be created with
113113
* {@link #partitions()} partitions; to provision other topics with other partition
114114
* counts call the {@code addTopics(NewTopic... topics)} method on the autowired
115115
* broker.
116+
* Place holders will only be resolved when there is a Spring test application
117+
* context present (such as when using {@code @SpringJunitConfig or @SpringRunner}.
116118
* @return the topics to create
117119
*/
118120
String[] topics() default { };
119121

120122
/**
121123
* Properties in form {@literal key=value} that should be added to the broker config
122124
* before runs. When used in a Spring test context, properties may contain property
123-
* placeholders, e.g. {@code delete.topic.enable=${topic.delete:true}}.
125+
* place holders, e.g. {@code delete.topic.enable=${topic.delete:true}}.
126+
* Place holders will only be resolved when there is a Spring test application
127+
* context present (such as when using {@code @SpringJunitConfig or @SpringRunner}.
124128
* @return the properties to add
125129
* @see #brokerPropertiesLocation()
126130
* @see org.springframework.kafka.test.EmbeddedKafkaBroker#brokerProperties(java.util.Map)
@@ -131,9 +135,11 @@
131135
* Spring {@code Resource} url specifying the location of properties that should be
132136
* added to the broker config. When used in a Spring test context, the
133137
* {@code brokerPropertiesLocation} url and the properties themselves may contain
134-
* placeholders that are resolved during initialization. Properties specified by
138+
* place holders that are resolved during initialization. Properties specified by
135139
* {@link #brokerProperties()} will override properties found in
136140
* {@code brokerPropertiesLocation}.
141+
* Place holders will only be resolved when there is a Spring test application
142+
* context present (such as when using {@code @SpringJunitConfig or @SpringRunner}.
137143
* @return a {@code Resource} url specifying the location of properties to add
138144
* @see #brokerProperties()
139145
* @see org.springframework.kafka.test.EmbeddedKafkaBroker#brokerProperties(java.util.Map)

0 commit comments

Comments
 (0)