5555 */
5656class PulsarPropertiesTests {
5757
58- private PulsarProperties bindPropeties (Map <String , String > map ) {
58+ private PulsarProperties bindProperties (Map <String , String > map ) {
5959 return new Binder (new MapConfigurationPropertySource (map )).bind ("spring.pulsar" , PulsarProperties .class ).get ();
6060 }
6161
@@ -69,7 +69,7 @@ void bind() {
6969 map .put ("spring.pulsar.client.operation-timeout" , "1s" );
7070 map .put ("spring.pulsar.client.lookup-timeout" , "2s" );
7171 map .put ("spring.pulsar.client.connection-timeout" , "12s" );
72- PulsarProperties .Client properties = bindPropeties (map ).getClient ();
72+ PulsarProperties .Client properties = bindProperties (map ).getClient ();
7373 assertThat (properties .getServiceUrl ()).isEqualTo ("my-service-url" );
7474 assertThat (properties .getOperationTimeout ()).isEqualTo (Duration .ofMillis (1000 ));
7575 assertThat (properties .getLookupTimeout ()).isEqualTo (Duration .ofMillis (2000 ));
@@ -81,7 +81,7 @@ void bindAuthentication() {
8181 Map <String , String > map = new HashMap <>();
8282 map .put ("spring.pulsar.client.authentication.plugin-class-name" , "com.example.MyAuth" );
8383 map .put ("spring.pulsar.client.authentication.param.token" , "1234" );
84- PulsarProperties .Client properties = bindPropeties (map ).getClient ();
84+ PulsarProperties .Client properties = bindProperties (map ).getClient ();
8585 assertThat (properties .getAuthentication ().getPluginClassName ()).isEqualTo ("com.example.MyAuth" );
8686 assertThat (properties .getAuthentication ().getParam ()).containsEntry ("token" , "1234" );
8787 }
@@ -101,7 +101,7 @@ void bindFailover() {
101101 map .put ("spring.pulsar.client.failover.backup-clusters[1].authentication.plugin-class-name" ,
102102 "com.example.MyAuth2" );
103103 map .put ("spring.pulsar.client.failover.backup-clusters[1].authentication.param.token" , "5678" );
104- PulsarProperties .Client properties = bindPropeties (map ).getClient ();
104+ PulsarProperties .Client properties = bindProperties (map ).getClient ();
105105 Failover failoverProperties = properties .getFailover ();
106106 List <BackupCluster > backupClusters = properties .getFailover ().getBackupClusters ();
107107 assertThat (properties .getServiceUrl ()).isEqualTo ("my-service-url" );
@@ -132,7 +132,7 @@ void bind() {
132132 map .put ("spring.pulsar.admin.connection-timeout" , "12s" );
133133 map .put ("spring.pulsar.admin.read-timeout" , "13s" );
134134 map .put ("spring.pulsar.admin.request-timeout" , "14s" );
135- PulsarProperties .Admin properties = bindPropeties (map ).getAdmin ();
135+ PulsarProperties .Admin properties = bindProperties (map ).getAdmin ();
136136 assertThat (properties .getServiceUrl ()).isEqualTo ("my-service-url" );
137137 assertThat (properties .getConnectionTimeout ()).isEqualTo (Duration .ofSeconds (12 ));
138138 assertThat (properties .getReadTimeout ()).isEqualTo (Duration .ofSeconds (13 ));
@@ -144,7 +144,7 @@ void bindAuthentication() {
144144 Map <String , String > map = new HashMap <>();
145145 map .put ("spring.pulsar.admin.authentication.plugin-class-name" , this .authPluginClassName );
146146 map .put ("spring.pulsar.admin.authentication.param.token" , this .authToken );
147- PulsarProperties .Admin properties = bindPropeties (map ).getAdmin ();
147+ PulsarProperties .Admin properties = bindProperties (map ).getAdmin ();
148148 assertThat (properties .getAuthentication ().getPluginClassName ()).isEqualTo (this .authPluginClassName );
149149 assertThat (properties .getAuthentication ().getParam ()).containsEntry ("token" , this .authToken );
150150 }
@@ -166,7 +166,7 @@ void bindWhenTypeMappingsWithTopicsOnly() {
166166 map .put ("spring.pulsar.defaults.type-mappings[0].topic-name" , "foo-topic" );
167167 map .put ("spring.pulsar.defaults.type-mappings[1].message-type" , String .class .getName ());
168168 map .put ("spring.pulsar.defaults.type-mappings[1].topic-name" , "string-topic" );
169- PulsarProperties .Defaults properties = bindPropeties (map ).getDefaults ();
169+ PulsarProperties .Defaults properties = bindProperties (map ).getDefaults ();
170170 TypeMapping expectedTopic1 = new TypeMapping (TestMessage .class , "foo-topic" , null );
171171 TypeMapping expectedTopic2 = new TypeMapping (String .class , "string-topic" , null );
172172 assertThat (properties .getTypeMappings ()).containsExactly (expectedTopic1 , expectedTopic2 );
@@ -177,7 +177,7 @@ void bindWhenTypeMappingsWithSchemaOnly() {
177177 Map <String , String > map = new HashMap <>();
178178 map .put ("spring.pulsar.defaults.type-mappings[0].message-type" , TestMessage .class .getName ());
179179 map .put ("spring.pulsar.defaults.type-mappings[0].schema-info.schema-type" , "JSON" );
180- PulsarProperties .Defaults properties = bindPropeties (map ).getDefaults ();
180+ PulsarProperties .Defaults properties = bindProperties (map ).getDefaults ();
181181 TypeMapping expected = new TypeMapping (TestMessage .class , null , new SchemaInfo (SchemaType .JSON , null ));
182182 assertThat (properties .getTypeMappings ()).containsExactly (expected );
183183 }
@@ -188,7 +188,7 @@ void bindWhenTypeMappingsWithTopicAndSchema() {
188188 map .put ("spring.pulsar.defaults.type-mappings[0].message-type" , TestMessage .class .getName ());
189189 map .put ("spring.pulsar.defaults.type-mappings[0].topic-name" , "foo-topic" );
190190 map .put ("spring.pulsar.defaults.type-mappings[0].schema-info.schema-type" , "JSON" );
191- PulsarProperties .Defaults properties = bindPropeties (map ).getDefaults ();
191+ PulsarProperties .Defaults properties = bindProperties (map ).getDefaults ();
192192 TypeMapping expected = new TypeMapping (TestMessage .class , "foo-topic" ,
193193 new SchemaInfo (SchemaType .JSON , null ));
194194 assertThat (properties .getTypeMappings ()).containsExactly (expected );
@@ -200,7 +200,7 @@ void bindWhenTypeMappingsWithKeyValueSchema() {
200200 map .put ("spring.pulsar.defaults.type-mappings[0].message-type" , TestMessage .class .getName ());
201201 map .put ("spring.pulsar.defaults.type-mappings[0].schema-info.schema-type" , "KEY_VALUE" );
202202 map .put ("spring.pulsar.defaults.type-mappings[0].schema-info.message-key-type" , String .class .getName ());
203- PulsarProperties .Defaults properties = bindPropeties (map ).getDefaults ();
203+ PulsarProperties .Defaults properties = bindProperties (map ).getDefaults ();
204204 TypeMapping expected = new TypeMapping (TestMessage .class , null ,
205205 new SchemaInfo (SchemaType .KEY_VALUE , String .class ));
206206 assertThat (properties .getTypeMappings ()).containsExactly (expected );
@@ -211,7 +211,7 @@ void bindWhenNoSchemaThrowsException() {
211211 Map <String , String > map = new HashMap <>();
212212 map .put ("spring.pulsar.defaults.type-mappings[0].message-type" , TestMessage .class .getName ());
213213 map .put ("spring.pulsar.defaults.type-mappings[0].schema-info.message-key-type" , String .class .getName ());
214- assertThatExceptionOfType (BindException .class ).isThrownBy (() -> bindPropeties (map ))
214+ assertThatExceptionOfType (BindException .class ).isThrownBy (() -> bindProperties (map ))
215215 .havingRootCause ()
216216 .withMessageContaining ("schemaType must not be null" );
217217 }
@@ -221,7 +221,7 @@ void bindWhenSchemaTypeNoneThrowsException() {
221221 Map <String , String > map = new HashMap <>();
222222 map .put ("spring.pulsar.defaults.type-mappings[0].message-type" , TestMessage .class .getName ());
223223 map .put ("spring.pulsar.defaults.type-mappings[0].schema-info.schema-type" , "NONE" );
224- assertThatExceptionOfType (BindException .class ).isThrownBy (() -> bindPropeties (map ))
224+ assertThatExceptionOfType (BindException .class ).isThrownBy (() -> bindProperties (map ))
225225 .havingRootCause ()
226226 .withMessageContaining ("schemaType 'NONE' not supported" );
227227 }
@@ -232,7 +232,7 @@ void bindWhenMessageKeyTypeSetOnNonKeyValueSchemaThrowsException() {
232232 map .put ("spring.pulsar.defaults.type-mappings[0].message-type" , TestMessage .class .getName ());
233233 map .put ("spring.pulsar.defaults.type-mappings[0].schema-info.schema-type" , "JSON" );
234234 map .put ("spring.pulsar.defaults.type-mappings[0].schema-info.message-key-type" , String .class .getName ());
235- assertThatExceptionOfType (BindException .class ).isThrownBy (() -> bindPropeties (map ))
235+ assertThatExceptionOfType (BindException .class ).isThrownBy (() -> bindProperties (map ))
236236 .havingRootCause ()
237237 .withMessageContaining ("messageKeyType can only be set when schemaType is KEY_VALUE" );
238238 }
@@ -259,7 +259,7 @@ void bind() {
259259 props .put ("spring.pulsar.function.fail-fast" , "false" );
260260 props .put ("spring.pulsar.function.propagate-failures" , "false" );
261261 props .put ("spring.pulsar.function.propagate-stop-failures" , "true" );
262- PulsarProperties .Function properties = bindPropeties (props ).getFunction ();
262+ PulsarProperties .Function properties = bindProperties (props ).getFunction ();
263263 assertThat (properties .isFailFast ()).isFalse ();
264264 assertThat (properties .isPropagateFailures ()).isFalse ();
265265 assertThat (properties .isPropagateStopFailures ()).isTrue ();
@@ -285,7 +285,7 @@ void bind() {
285285 map .put ("spring.pulsar.producer.cache.expire-after-access" , "2s" );
286286 map .put ("spring.pulsar.producer.cache.maximum-size" , "3" );
287287 map .put ("spring.pulsar.producer.cache.initial-capacity" , "5" );
288- PulsarProperties .Producer properties = bindPropeties (map ).getProducer ();
288+ PulsarProperties .Producer properties = bindProperties (map ).getProducer ();
289289 assertThat (properties .getName ()).isEqualTo ("my-producer" );
290290 assertThat (properties .getTopicName ()).isEqualTo ("my-topic" );
291291 assertThat (properties .getSendTimeout ()).isEqualTo (Duration .ofSeconds (2 ));
@@ -323,7 +323,7 @@ void bind() {
323323 map .put ("spring.pulsar.consumer.dead-letter-policy.dead-letter-topic" , "my-dlt-topic" );
324324 map .put ("spring.pulsar.consumer.dead-letter-policy.initial-subscription-name" , "my-initial-subscription" );
325325 map .put ("spring.pulsar.consumer.retry-enable" , "true" );
326- PulsarProperties .Consumer properties = bindPropeties (map ).getConsumer ();
326+ PulsarProperties .Consumer properties = bindProperties (map ).getConsumer ();
327327 assertThat (properties .getName ()).isEqualTo ("my-consumer" );
328328 assertThat (properties .getSubscription ()).satisfies ((subscription ) -> {
329329 assertThat (subscription .getName ()).isEqualTo ("my-subscription" );
@@ -355,7 +355,7 @@ void bind() {
355355 Map <String , String > map = new HashMap <>();
356356 map .put ("spring.pulsar.listener.schema-type" , "avro" );
357357 map .put ("spring.pulsar.listener.observation-enabled" , "true" );
358- PulsarProperties .Listener properties = bindPropeties (map ).getListener ();
358+ PulsarProperties .Listener properties = bindProperties (map ).getListener ();
359359 assertThat (properties .getSchemaType ()).isEqualTo (SchemaType .AVRO );
360360 assertThat (properties .isObservationEnabled ()).isTrue ();
361361 }
@@ -373,7 +373,7 @@ void bind() {
373373 map .put ("spring.pulsar.reader.subscription-name" , "my-subscription" );
374374 map .put ("spring.pulsar.reader.subscription-role-prefix" , "sub-role" );
375375 map .put ("spring.pulsar.reader.read-compacted" , "true" );
376- PulsarProperties .Reader properties = bindPropeties (map ).getReader ();
376+ PulsarProperties .Reader properties = bindProperties (map ).getReader ();
377377 assertThat (properties .getName ()).isEqualTo ("my-reader" );
378378 assertThat (properties .getTopics ()).containsExactly ("my-topic" );
379379 assertThat (properties .getSubscriptionName ()).isEqualTo ("my-subscription" );
@@ -390,7 +390,7 @@ class TemplateProperties {
390390 void bind () {
391391 Map <String , String > map = new HashMap <>();
392392 map .put ("spring.pulsar.template.observations-enabled" , "true" );
393- PulsarProperties .Template properties = bindPropeties (map ).getTemplate ();
393+ PulsarProperties .Template properties = bindProperties (map ).getTemplate ();
394394 assertThat (properties .isObservationsEnabled ()).isTrue ();
395395 }
396396
@@ -403,7 +403,7 @@ class TransactionProperties {
403403 void bind () {
404404 Map <String , String > map = new HashMap <>();
405405 map .put ("spring.pulsar.transaction.enabled" , "true" );
406- PulsarProperties .Transaction properties = bindPropeties (map ).getTransaction ();
406+ PulsarProperties .Transaction properties = bindProperties (map ).getTransaction ();
407407 assertThat (properties .isEnabled ()).isTrue ();
408408 }
409409
0 commit comments