How to mock com.adobe.acs.commons.models.injectors.impl.SharedValueMapValueInjector | Community
Skip to main content
New Participant
April 7, 2023
Solved

How to mock com.adobe.acs.commons.models.injectors.impl.SharedValueMapValueInjector

  • April 7, 2023
  • 2 replies
  • 931 views

I have a sling model

@@SharedValueMapValu(type = SharedComponentProperties.ValueTypes.GLOBAL)
protected String fantasticBtnLabel;

and I have a unit test JUNIT5

context.registerInjectActivateService(new SharedValueMapValueInjector());

When @SharedValueMapValue is called from the Sling Model unit tests, it works... but when I am trying to get the property of "fantasticBtnLabel", I am getting null. how can I solve this?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by joerghoh

Please raise this over at the ACS AEM Commons project; as the feature is coming from there, they should provide the solution to this 🙂

2 replies

joerghoh
joerghohAccepted solution
Employee
April 9, 2023

Please raise this over at the ACS AEM Commons project; as the feature is coming from there, they should provide the solution to this 🙂

BrianKasingli
New Participant
April 8, 2023

If @SharedValueMapValue is not supported via mocking, you can at lease provide it with @1497330(stringValues={"something"});