cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

there is no LocaleProvider for (detached)

Former Member
0 Likes
1,086

Hi Guys, I am creating a test for one of our method and the method has product.getName() i am setting up the values in my test with locale

final Locale locale = new Locale("en"); productModel.setName("DE-base", locale);

but while running the test i am getting the below error.

I am getting an error like "There is no LocaleProvider for (Detached) servicelayer model"

Any help will be appreciated here.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Likes

Thanks for the reply raghavendra, i have fixed it by just mocking and making a doReturn

raghavendra_desu
Product and Topic Expert
Product and Topic Expert
0 Likes

Hi Suresh,

You dont need to create a English Locale object, try to use Locale.ENGLISH for setting english name for the product, which should work. Please take a look at OOTB test classes (Eg: LocalizationAwareValidationServiceTest) for more details.

Regards,

Raghavendra.