@@ -0,0 +1,2908 @@
+package org.camunda.bpm.extension.process_test_coverage.rules;%0A%0Aimport org.camunda.bpm.engine.test.Deployment;%0Aimport org.camunda.bpm.extension.process_test_coverage.junit.rules.AggregatedCoverageTestRunState;%0Aimport org.camunda.bpm.extension.process_test_coverage.junit.rules.AggregatedCoverageTestRunStateFactory;%0Aimport org.camunda.bpm.extension.process_test_coverage.junit.rules.TestCoverageProcessEngineRule;%0Aimport org.camunda.bpm.extension.process_test_coverage.junit.rules.TestCoverageProcessEngineRuleBuilder;%0Aimport org.camunda.bpm.extension.process_test_coverage.util.CoverageReportUtil;%0Aimport org.junit.AfterClass;%0Aimport org.junit.ClassRule;%0Aimport org.junit.Rule;%0Aimport org.junit.Test;%0Aimport org.junit.experimental.runners.Enclosed;%0Aimport org.junit.runner.RunWith;%0A%0Aimport java.util.HashMap;%0Aimport java.util.Map;%0A%0A@RunWith(Enclosed.class)%0Apublic class TestMethodDetectionTest %7B%0A%0A    private static AggregatedCoverageTestRunState coverageRunState = new AggregatedCoverageTestRunState();%0A    private static final String AGGREGATED_REPORT_PATH = CoverageReportUtil.TARGET_DIR_ROOT + %22/aggregated_report_test_method_detect/coverage%22;%0A%0A    @Deployment(resources = CoverageTestProcessConstants.BPMN_PATH)%0A    public static class DeploymentAnnotatedTestClass %7B%0A        @Rule%0A        @ClassRule%0A        public static TestCoverageProcessEngineRule rule = TestCoverageProcessEngineRuleBuilder%0A            .create()%0A            .setCoverageTestRunStateFactory(new AggregatedCoverageTestRunStateFactory(coverageRunState))%0A            .build();%0A%0A        @Test%0A        public void testPathA() %7B%0A            Map%3CString, Object%3E variables = new HashMap%3CString, Object%3E();%0A            variables.put(%22path%22, %22A%22);%0A            rule.getRuntimeService().startProcessInstanceByKey(CoverageTestProcessConstants.PROCESS_DEFINITION_KEY, variables);%0A        %7D%0A%0A        @AfterClass%0A        public static void reportCoverage() %7B%0A            coverageRunState.getAggregatedCoverage().getCoveragePercentage();%0A        %7D%0A%0A    %7D%0A%0A    public static class DeploymentAnnotatedTestMethod %7B%0A%0A        @Rule%0A        @ClassRule%0A        public static TestCoverageProcessEngineRule rule = TestCoverageProcessEngineRuleBuilder%0A            .create()%0A            .setCoverageTestRunStateFactory(new AggregatedCoverageTestRunStateFactory(coverageRunState))%0A            .build();%0A%0A        @Deployment(resources = CoverageTestProcessConstants.BPMN_PATH)%0A        @Test%0A        public void testPathB() %7B%0A            Map%3CString, Object%3E variables = new HashMap%3CString, Object%3E();%0A            variables.put(%22path%22, %22B%22);%0A            rule.getRuntimeService().startProcessInstanceByKey(CoverageTestProcessConstants.PROCESS_DEFINITION_KEY, variables);%0A        %7D%0A%0A    %7D%0A%0A    @AfterClass%0A    public static void reportCoverage() %7B%0A%0A        CoverageReportUtil.createReport(coverageRunState.getAggregatedCoverage(), AGGREGATED_REPORT_PATH);%0A    %7D%0A%0A%7D%0A

add test retrieving the deployment from class and method