// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/util/TestConstants.java
// public static final String CLASS_NAME = "Test";
// 
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/util/TestConstants.java
// public static final String PACKAGE = "tech.harmonysoft.oss.traute.test";
// 
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/util/TestUtil.java
// @NotNull
// public static String prepareParameterTestSource(@Nullable String importString,
//                                                 @NotNull String testMethod,
//                                                 @NotNull String callArguments)
// {
//     return prepareParameterTestSource(PACKAGE, importString, testMethod, callArguments);
// }
// 
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/util/TestUtil.java
// @NotNull
// public static String prepareReturnTestSource(@NotNull String methodBody) {
//     return prepareReturnTestSource(NotNull.class, methodBody);
// }


import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
import tech.harmonysoft.oss.traute.test.fixture.NN;
import javax.tools.JavaFileObject;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static tech.harmonysoft.oss.traute.test.util.TestConstants.CLASS_NAME;
import static tech.harmonysoft.oss.traute.test.util.TestConstants.PACKAGE;
import static tech.harmonysoft.oss.traute.test.util.TestUtil.prepareParameterTestSource;
import static tech.harmonysoft.oss.traute.test.util.TestUtil.prepareReturnTestSource;
                "    new Test().test(1, 2);\n" +
                "  }\n" +
                "}", PACKAGE, NotNull.class.getName(), CLASS_NAME);

        expectCompilationResult.withText(String.format(
                "added 7 instrumentations to the .*?/%s/%s%s - METHOD_PARAMETER: 4, METHOD_RETURN: 3",
                PACKAGE.replaceAll("\\.", "/"), CLASS_NAME, JavaFileObject.Kind.SOURCE.extension
        ));
        doCompile(testSource);
    }

    @Test
    public void customSetting_annotations() {
        settingsBuilder.withNotNullAnnotations(NN.class.getName());
        expectCompilationResult.withText(String.format("using the following NotNull annotations: \\[%s\\]",
                                                       NN.class.getName()));
        doCompile(prepareReturnTestSource("return 1;"));
    }

    @Test
    public void customSetting_verbose() {
        settingsBuilder.withVerboseMode(true);
        expectCompilationResult.withText("'verbose mode' is on");
        doCompile(prepareReturnTestSource("return 1;"));
    }

    @Test
    public void noReportForNonEnhancedSource() {
        settingsBuilder.withVerboseMode(true);
        expectCompilationResult.withText("added 0 instrumentation", false);
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/util/TestConstants.java
// public static final String CLASS_NAME = "Test";
// 
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/util/TestConstants.java
// public static final String PACKAGE = "tech.harmonysoft.oss.traute.test";
// 
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/util/TestUtil.java
// @NotNull
// public static String prepareParameterTestSource(@Nullable String importString,
//                                                 @NotNull String testMethod,
//                                                 @NotNull String callArguments)
// {
//     return prepareParameterTestSource(PACKAGE, importString, testMethod, callArguments);
// }
// 
// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/util/TestUtil.java
// @NotNull
// public static String prepareReturnTestSource(@NotNull String methodBody) {
//     return prepareReturnTestSource(NotNull.class, methodBody);
// }


// Path: core/test/src/test/java/tech/harmonysoft/oss/traute/test/suite/LoggingTest.java
import org.jetbrains.annotations.NotNull;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.CsvSource;
import tech.harmonysoft.oss.traute.test.fixture.NN;
import javax.tools.JavaFileObject;
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static tech.harmonysoft.oss.traute.test.util.TestConstants.CLASS_NAME;
import static tech.harmonysoft.oss.traute.test.util.TestConstants.PACKAGE;
import static tech.harmonysoft.oss.traute.test.util.TestUtil.prepareParameterTestSource;
import static tech.harmonysoft.oss.traute.test.util.TestUtil.prepareReturnTestSource;

                "    new Test().test(1, 2);\n" +
                "  }\n" +
                "}", PACKAGE, NotNull.class.getName(), CLASS_NAME);

        expectCompilationResult.withText(String.format(
                "added 7 instrumentations to the .*?/%s/%s%s - METHOD_PARAMETER: 4, METHOD_RETURN: 3",
                PACKAGE.replaceAll("\\.", "/"), CLASS_NAME, JavaFileObject.Kind.SOURCE.extension
        ));
        doCompile(testSource);
    }

    @Test
    public void customSetting_annotations() {
        settingsBuilder.withNotNullAnnotations(NN.class.getName());
        expectCompilationResult.withText(String.format("using the following NotNull annotations: \\[%s\\]",
                                                       NN.class.getName()));
        doCompile(prepareReturnTestSource("return 1;"));
    }

    @Test
    public void customSetting_verbose() {
        settingsBuilder.withVerboseMode(true);
        expectCompilationResult.withText("'verbose mode' is on");
        doCompile(prepareReturnTestSource("return 1;"));
    }

    @Test
    public void noReportForNonEnhancedSource() {
        settingsBuilder.withVerboseMode(true);
        expectCompilationResult.withText("added 0 instrumentation", false);
        doCompile(prepareParameterTestSource(null, "public void test() {}", ""));