// Path: compiller/src/main/java/com/yheriatovych/reductor/processor/ReductorAnnotationProcessor.java
// @AutoService(Processor.class)
// public class ReductorAnnotationProcessor extends BasicAnnotationProcessor {
//     @Override
//     protected Iterable<? extends ProcessingStep> initSteps() {
//         Env env = new Env(processingEnv.getTypeUtils(),
//                 processingEnv.getElementUtils(),
//                 processingEnv.getMessager(),
//                 processingEnv.getFiler());
// 
//         Map<String, ActionCreatorElement> knownActionCreators = new HashMap<>();
// 
//         return Arrays.asList(
//                 new CombinedStateProcessingStep(env),
//                 new ActionCreatorProcessingStep(env, knownActionCreators),
//                 new AutoReducerProcessingStep(env, knownActionCreators)
//         );
//     }
// 
//     @Override
//     public SourceVersion getSupportedSourceVersion() {
//         return SourceVersion.latestSupported();
//     }
// }


import com.google.testing.compile.JavaFileObjects;
import com.yheriatovych.reductor.processor.ReductorAnnotationProcessor;
import org.junit.Test;
import javax.tools.JavaFileObject;
import static com.google.common.truth.Truth.assertAbout;
import static com.google.testing.compile.JavaSourceSubjectFactory.javaSource;
    public void testGeneratedReducerWithMatchingConstructor() {
        JavaFileObject source = JavaFileObjects.forSourceString("test.FoobarReducer", "// Generated by com.yheriatovych.reductor.processor.ReductorAnnotationProcessor (https://github.com/Yarikx/reductor)\n" +
                "package test;" +
                "\n" +
                "import com.yheriatovych.reductor.Reducer;\n" +
                "import com.yheriatovych.reductor.annotations.AutoReducer;\n" +
                "\n" +
                "@AutoReducer\n" +
                "public abstract class FoobarReducer implements Reducer<String>{\n" +
                "    public FoobarReducer(int foo, String bar) {\n" +
                "        \n" +
                "    }\n" +
                "}");

        JavaFileObject generatedPojo = JavaFileObjects.forSourceString("test.FoobarReducerImpl", "// Generated by com.yheriatovych.reductor.processor.ReductorAnnotationProcessor (https://github.com/Yarikx/reductor)\n" +
                "package test;" +
                "\n" +
                "import com.yheriatovych.reductor.Action;\n" +
                "\n" +
                "class FoobarReducerImpl extends FoobarReducer {\n" +
                "  public FoobarReducerImpl(int foo, String bar) {\n" +
                "    super(foo, bar);\n" +
                "  }\n" +
                "\n" +
                "  @Override\n" +
                "  public String reduce(String state, Action action) {\n" +
                "    switch (action.type) {\n" +
                "      default:\n" +
                "        return state;\n" +
                "    }\n" +
// Path: compiller/src/main/java/com/yheriatovych/reductor/processor/ReductorAnnotationProcessor.java
// @AutoService(Processor.class)
// public class ReductorAnnotationProcessor extends BasicAnnotationProcessor {
//     @Override
//     protected Iterable<? extends ProcessingStep> initSteps() {
//         Env env = new Env(processingEnv.getTypeUtils(),
//                 processingEnv.getElementUtils(),
//                 processingEnv.getMessager(),
//                 processingEnv.getFiler());
// 
//         Map<String, ActionCreatorElement> knownActionCreators = new HashMap<>();
// 
//         return Arrays.asList(
//                 new CombinedStateProcessingStep(env),
//                 new ActionCreatorProcessingStep(env, knownActionCreators),
//                 new AutoReducerProcessingStep(env, knownActionCreators)
//         );
//     }
// 
//     @Override
//     public SourceVersion getSupportedSourceVersion() {
//         return SourceVersion.latestSupported();
//     }
// }


// Path: compiller/src/test/java/com/yheriatovych/reductor/processor/AutoReducerGeneratorTest.java
import com.google.testing.compile.JavaFileObjects;
import com.yheriatovych.reductor.processor.ReductorAnnotationProcessor;
import org.junit.Test;
import javax.tools.JavaFileObject;
import static com.google.common.truth.Truth.assertAbout;
import static com.google.testing.compile.JavaSourceSubjectFactory.javaSource;

    public void testGeneratedReducerWithMatchingConstructor() {
        JavaFileObject source = JavaFileObjects.forSourceString("test.FoobarReducer", "// Generated by com.yheriatovych.reductor.processor.ReductorAnnotationProcessor (https://github.com/Yarikx/reductor)\n" +
                "package test;" +
                "\n" +
                "import com.yheriatovych.reductor.Reducer;\n" +
                "import com.yheriatovych.reductor.annotations.AutoReducer;\n" +
                "\n" +
                "@AutoReducer\n" +
                "public abstract class FoobarReducer implements Reducer<String>{\n" +
                "    public FoobarReducer(int foo, String bar) {\n" +
                "        \n" +
                "    }\n" +
                "}");

        JavaFileObject generatedPojo = JavaFileObjects.forSourceString("test.FoobarReducerImpl", "// Generated by com.yheriatovych.reductor.processor.ReductorAnnotationProcessor (https://github.com/Yarikx/reductor)\n" +
                "package test;" +
                "\n" +
                "import com.yheriatovych.reductor.Action;\n" +
                "\n" +
                "class FoobarReducerImpl extends FoobarReducer {\n" +
                "  public FoobarReducerImpl(int foo, String bar) {\n" +
                "    super(foo, bar);\n" +
                "  }\n" +
                "\n" +
                "  @Override\n" +
                "  public String reduce(String state, Action action) {\n" +
                "    switch (action.type) {\n" +
                "      default:\n" +
                "        return state;\n" +
                "    }\n" +
                "  }\n" +