@@ -0,0 +1,1985 @@
+/*%0A * #%25L%0A * wcm.io%0A * %25%25%0A * Copyright (C) 2018 wcm.io%0A * %25%25%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A * #L%25%0A */%0Apackage io.wcm.testing.mock.aem.junit5;%0A%0Aimport static org.junit.jupiter.api.Assertions.assertEquals;%0Aimport static org.junit.jupiter.api.Assertions.assertTrue;%0A%0Aimport org.apache.sling.api.resource.Resource;%0Aimport org.apache.sling.testing.resourceresolver.MockResourceResolver;%0Aimport org.junit.jupiter.api.BeforeEach;%0Aimport org.junit.jupiter.api.Disabled;%0Aimport org.junit.jupiter.api.Tag;%0Aimport org.junit.jupiter.api.Test;%0Aimport org.junit.jupiter.api.extension.ExtendWith;%0A%0A/**%0A * Test with %7B@link AemContext%7D which uses by default %7B@link ResourceResolverMockAemContext%7D.%0A */%0A@ExtendWith(AemContextExtension.class)%0A@Tag(%22junit5%22)%0A@Disabled // TODO: this does not work - constructor injection has no relation to test method - also lifecyle=PER_METHOD - why?%0Aclass AemContextMemberVariableTest %7B%0A%0A  final AemContext context;%0A%0A  AemContextMemberVariableTest(AemContext context) %7B%0A    this.context = context;%0A  %7D%0A%0A  @BeforeEach%0A  void setUp() %7B%0A    assertTrue(context instanceof ResourceResolverMockAemContext);%0A    assertTrue(context.resourceResolver() instanceof MockResourceResolver);%0A%0A    context.create().resource(%22/content/test%22,%0A        %22prop1%22, %22value1%22);%0A  %7D%0A%0A  @Test%0A  void testResource() %7B%0A    Resource resource = context.resourceResolver().getResource(%22/content/test%22);%0A    assertEquals(%22value1%22, resource.getValueMap().get(%22prop1%22));%0A  %7D%0A%0A%7D%0A

add AemContextMemberVariableTest - does not work