package org.pitest.cucumber;


import org.pitest.junit.CompoundTestUnitFinder;
import org.pitest.junit.JUnitCompatibleConfiguration;
import org.pitest.testapi.TestGroupConfig;
import org.pitest.testapi.TestUnitFinder;

import java.util.List;

import static java.util.Arrays.asList;

public class CucumberJUnitCompatibleConfiguration extends JUnitCompatibleConfiguration {

    public CucumberJUnitCompatibleConfiguration(TestGroupConfig config) {
        super(config);
    }

    @Override
    public TestUnitFinder testUnitFinder() {
        List<TestUnitFinder> finders
                = asList(new CucumberTestUnitFinder(), super.testUnitFinder());
        return new CompoundTestUnitFinder(finders);
    }
}

@@ -210,16 +210,44 @@
 tFinder;
+%0Aimport org.pitest.util.Log;
 %0A%0Aimport
@@ -553,24 +553,176 @@
 tFinder() %7B%0A
+        final TestUnitFinder finder;%0A        if (isCucumberUsed()) %7B%0A            Log.getLogger().info(%22Cucumber detected, scenarios will be used%22);%0A    
         List
@@ -746,16 +746,20 @@
 finders%0A
+    
         
@@ -842,14 +842,20 @@
     
-return
+    finder =
  new
@@ -888,16 +888,437 @@
 nders);%0A
+        %7D else %7B%0A            Log.getLogger().info(%22Cucumber not used in this project%22);%0A            finder = super.testUnitFinder();%0A        %7D%0A        return finder;%0A    %7D%0A%0A    private boolean isCucumberUsed() %7B%0A        boolean result = false;%0A        try %7B%0A            Class.forName(%22cucumber.api.junit.Cucumber%22);%0A            result = true;%0A        %7D catch (ClassNotFoundException e) %7B%0A        %7D%0A        return result;%0A
     %7D%0A%7D%0A

Fix bug when cucumber not used