You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Stefan Seifert (Jira)" <ji...@apache.org> on 2021/07/07 19:50:00 UTC

[jira] [Commented] (SLING-10068) CAConfig Mock Plugin: NPE when using `@Nested` tests

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

Stefan Seifert commented on SLING-10068:
----------------------------------------

the root cause was probably https://wcm-io.atlassian.net/browse/WTES-62 - or is this really a problem specific to this mock plugin?

> CAConfig Mock Plugin: NPE when using `@Nested` tests
> ----------------------------------------------------
>
>                 Key: SLING-10068
>                 URL: https://issues.apache.org/jira/browse/SLING-10068
>             Project: Sling
>          Issue Type: Bug
>          Components: Testing
>    Affects Versions: Context-Aware Configuration Mock Plugin 1.3.2
>            Reporter: Kyle Giovannetti
>            Priority: Minor
>
> When using the caconfig mocking plugin as per the example here: 
>  [https://github.com/apache/sling-org-apache-sling-testing-caconfig-mock-plugin/blob/master/src/test/java/org/apache/sling/testing/mock/caconfig/ContextPluginsTest.java]
>  
> If the tests are located inside an inner class annotated with the `@Nested` annotation, then a NPE occurs:
>  
> {code:java}
> java.lang.NullPointerExceptionjava.lang.NullPointerException 
>     at org.apache.sling.testing.mock.caconfig.MockContextAwareConfig.writeConfiguration(MockContextAwareConfig.java:101) 
>     at org.apache.sling.testing.mock.caconfig.MockContextAwareConfig.writeConfiguration(MockContextAwareConfig.java:125) 
>     at org.apache.sling.testing.mock.caconfig.MockContextAwareConfig.writeConfiguration(MockContextAwareConfig.java:113)
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)