[ 
https://issues.apache.org/jira/browse/SLING-13097?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18056420#comment-18056420
 ] 

Bart Thierens edited comment on SLING-13097 at 2/4/26 10:26 AM:
----------------------------------------------------------------

Is this behaviour because there is an assumption the bind methods take care of 
the state of the references?
EDIT: that seems to be how it works now.  When I add a (too) simple solution 
(=always inject first, then call potential bind methods) it breaks an existing 
test case where the bind does the injection.

Any ideas appreciated.


was (Author: JIRAUSER287307):
Is this behaviour because there is an assumption the bind methods take care of 
the state of the references?

> Mock OSGi does inject reference when bind methods are present
> -------------------------------------------------------------
>
>                 Key: SLING-13097
>                 URL: https://issues.apache.org/jira/browse/SLING-13097
>             Project: Sling
>          Issue Type: Bug
>          Components: Testing
>    Affects Versions: Testing OSGi Mock 3.5.2
>            Reporter: Bart Thierens
>            Priority: Major
>
> When using a (collection of) reference(s) in a component, OSGi Mock will 
> automatically inject when calling SlingContext/AemContext's 
> registerService/registerInjectActivate.
> When adding bind/unbind/update method to that reference, the mock context 
> will trigger perfectly the bind-methods, but the field itself is never 
> updated. It stays forever null.
> This is different from how OSGi does it.  There I can see the bind methods 
> being triggered + the field being updated automatically.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to