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

Henry Kuijpers commented on SLING-11792:
----------------------------------------

We fixed it by using:

{code:java}
.plugin(new AbstractContextPlugin<AemContext>() {
    @Override
    public void afterSetUp(@NotNull final AemContext context) throws Exception {
        KBAemContext.afterSetUp(context);
    }
})
{code}

Which is of course not very handy, as it renders the 
"afterSetUp"/"beforeSetUp"/... practically useless for these cases.

> osgi-mock, sling-mock: Allow mixture of plugins/callbacks
> ---------------------------------------------------------
>
>                 Key: SLING-11792
>                 URL: https://issues.apache.org/jira/browse/SLING-11792
>             Project: Sling
>          Issue Type: Improvement
>          Components: Testing
>            Reporter: Stefan Seifert
>            Assignee: Stefan Seifert
>            Priority: Major
>             Fix For: Testing Sling Mock 3.4.4, Testing OSGi Mock 3.3.6
>
>         Attachments: screenshot-1.png
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> the OsgiContextBuilder and SlingContextBuilder provides methods to add an 
> array of plugins or callbacks to customize the test execution. the current 
> generic annotations allows only a list of plugins using the same subtype of 
> the context:
> {code}
> public final <T extends OsgiContextImpl> SlingContextBuilder plugin(@NotNull 
> ContextPlugin<T> @NotNull ... plugin)
> {code}
> it would be more flexible, to allow mixing plugins with any subtype in a 
> single row:
> {code}
> public final SlingContextBuilder plugin(@NotNull ContextPlugin<? extends 
> OsgiContextImpl> @NotNull ... plugin)
> {code}
> this applies to various methods of the \*ContextBuilder and Plugins 
> implementations.



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

Reply via email to