Skip to content

Commit

Permalink
Switch to @qualifier annotation to help Spring select the right messa…
Browse files Browse the repository at this point in the history
…geSource bean
  • Loading branch information
jamesfredley committed Sep 10, 2024
1 parent f220719 commit 688e232
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import groovy.text.Template
import groovy.transform.CompileStatic
import org.grails.datastore.mapping.keyvalue.mapping.config.KeyValueMappingContext
import org.grails.datastore.mapping.model.MappingContext
import org.grails.spring.context.support.PluginAwareResourceBundleMessageSource
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.beans.factory.annotation.Qualifier
import org.springframework.context.MessageSource
import org.springframework.http.HttpStatus

Expand All @@ -33,11 +33,7 @@ trait JsonViewTest {
MessageSource messageSource

@Autowired(required = false)
void setMessageSource(PluginAwareResourceBundleMessageSource messageSource) {
this.messageSource = messageSource
}

void setMessageSource(MessageSource messageSource) {
void setMessageSource(@Qualifier("pluginAwareResourceBundleMessageSource") MessageSource messageSource) {
this.messageSource = messageSource
}

Expand Down

0 comments on commit 688e232

Please sign in to comment.