Skip to content
This repository has been archived by the owner on Jul 2, 2023. It is now read-only.

ExchageType localization issues fixed on case changing #156

Open
wants to merge 3 commits into
base: grails-4.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class ExchangePropertiesSpec extends Specification {
],
autoDelete: true,
durable: true,
type: ExchangeType.DIRECT.toString(),
type: ExchangeType.DIRECT.toString(Locale.US),
connection: 'connection',
]

Expand Down Expand Up @@ -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: [
[
Expand Down Expand Up @@ -98,7 +98,7 @@ class ExchangePropertiesSpec extends Specification {
],
autoDelete: true,
durable: true,
type: ExchangeType.DIRECT.toString(),
type: ExchangeType.DIRECT.toString(Locale.US),
connection: 'connection',
]

Expand Down Expand Up @@ -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:
Expand Down