From a9097b47f603658eefdcc398754a0cf644133e05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Selami=20Alt=C4=B1n?= Date: Thu, 18 Mar 2021 10:59:15 +0300 Subject: [PATCH 1/3] ExchageType localization issues fixed on case changing --- .../connection/ConnectionConfigurationImpl.groovy | 9 +++++++++ .../com/budjb/rabbitmq/queuebuilder/ExchangeType.groovy | 3 ++- .../budjb/rabbitmq/queuebuilder/QueueBuilderImpl.groovy | 2 +- .../test/queuebuilder/ExchangePropertiesSpec.groovy | 8 ++++---- 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/connection/ConnectionConfigurationImpl.groovy b/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/connection/ConnectionConfigurationImpl.groovy index 85f35a63..bd3e0948 100644 --- a/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/connection/ConnectionConfigurationImpl.groovy +++ b/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/connection/ConnectionConfigurationImpl.groovy @@ -184,4 +184,13 @@ class ConnectionConfigurationImpl implements ConnectionConfiguration { } this.name = name } + + @Override + void setIsDefault(boolean val) { + this.isDefault = val + } + + boolean getIsDefault() { + return this.isDefault + } } diff --git a/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/queuebuilder/ExchangeType.groovy b/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/queuebuilder/ExchangeType.groovy index 3ab53069..1056a4c3 100644 --- a/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/queuebuilder/ExchangeType.groovy +++ b/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/queuebuilder/ExchangeType.groovy @@ -57,11 +57,12 @@ enum ExchangeType { return null } try { - return valueOf(val.toUpperCase()) + return valueOf(val.toUpperCase(Locale.US)) } catch (IllegalArgumentException e) { log.trace("no MatchType with name '${val}' found", e) return null } } + } diff --git a/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/queuebuilder/QueueBuilderImpl.groovy b/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/queuebuilder/QueueBuilderImpl.groovy index 0c54495d..82215ed2 100644 --- a/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/queuebuilder/QueueBuilderImpl.groovy +++ b/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/queuebuilder/QueueBuilderImpl.groovy @@ -172,7 +172,7 @@ class QueueBuilderImpl implements QueueBuilder, ConfigPropertyResolver { try { channel.exchangeDeclare( properties.name, - properties.type.toString().toLowerCase(), + properties.type.toString().toLowerCase(Locale.US), properties.durable, properties.autoDelete, properties.arguments diff --git a/rabbitmq-native/src/test/groovy/com/budjb/rabbitmq/test/queuebuilder/ExchangePropertiesSpec.groovy b/rabbitmq-native/src/test/groovy/com/budjb/rabbitmq/test/queuebuilder/ExchangePropertiesSpec.groovy index 3f043418..18f5a413 100644 --- a/rabbitmq-native/src/test/groovy/com/budjb/rabbitmq/test/queuebuilder/ExchangePropertiesSpec.groovy +++ b/rabbitmq-native/src/test/groovy/com/budjb/rabbitmq/test/queuebuilder/ExchangePropertiesSpec.groovy @@ -33,7 +33,7 @@ class ExchangePropertiesSpec extends Specification { ], autoDelete: true, durable: true, - type: ExchangeType.DIRECT.toString(), + type: ExchangeType.DIRECT.toString(Locale.US), connection: 'connection', ] @@ -62,7 +62,7 @@ class ExchangePropertiesSpec extends Specification { ], autoDelete: true, durable: true, - type: ExchangeType.DIRECT.toString(), + type: ExchangeType.DIRECT.toString(Locale.US), connection: 'connection', exchangeBindings: [ [ @@ -98,7 +98,7 @@ class ExchangePropertiesSpec extends Specification { ], autoDelete: true, durable: true, - type: ExchangeType.DIRECT.toString(), + type: ExchangeType.DIRECT.toString(Locale.US), connection: 'connection', ] @@ -133,7 +133,7 @@ class ExchangePropertiesSpec extends Specification { thrown InvalidConfigurationException when: - exchangeProperties = new ExchangeProperties([type: ExchangeType.DIRECT.toString()]) + exchangeProperties = new ExchangeProperties([type: ExchangeType.DIRECT.toString(Locale.US)]) exchangeProperties.validate() then: From 179ae75684442e7d10ff33922da40ab76cbf4603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Selami=20Alt=C4=B1n?= Date: Tue, 11 May 2021 09:27:07 +0300 Subject: [PATCH 2/3] . --- .../connection/ConnectionConfigurationImpl.groovy | 8 -------- 1 file changed, 8 deletions(-) diff --git a/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/connection/ConnectionConfigurationImpl.groovy b/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/connection/ConnectionConfigurationImpl.groovy index bd3e0948..c558cc71 100644 --- a/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/connection/ConnectionConfigurationImpl.groovy +++ b/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/connection/ConnectionConfigurationImpl.groovy @@ -185,12 +185,4 @@ class ConnectionConfigurationImpl implements ConnectionConfiguration { this.name = name } - @Override - void setIsDefault(boolean val) { - this.isDefault = val - } - - boolean getIsDefault() { - return this.isDefault - } } From 3985c26f80c8c27f4b83619222fbcc1d4cc2a830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Selami=20Alt=C4=B1n?= Date: Tue, 11 May 2021 09:41:05 +0300 Subject: [PATCH 3/3] . --- .../budjb/rabbitmq/connection/ConnectionConfigurationImpl.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/connection/ConnectionConfigurationImpl.groovy b/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/connection/ConnectionConfigurationImpl.groovy index c558cc71..85f35a63 100644 --- a/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/connection/ConnectionConfigurationImpl.groovy +++ b/rabbitmq-native/src/main/groovy/com/budjb/rabbitmq/connection/ConnectionConfigurationImpl.groovy @@ -184,5 +184,4 @@ class ConnectionConfigurationImpl implements ConnectionConfiguration { } this.name = name } - }