From 44e55db53249fef669b25feffa9c70ab823020aa Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Sun, 23 Jun 2024 11:02:53 -0700 Subject: [PATCH] Minor code cleanups --- .../rife/bld/extension/PitestOperation.java | 159 +++++++++--------- .../bld/extension/PitestOperationTest.java | 144 ++++++++-------- 2 files changed, 156 insertions(+), 147 deletions(-) diff --git a/src/main/java/rife/bld/extension/PitestOperation.java b/src/main/java/rife/bld/extension/PitestOperation.java index 8175f17..5564cc7 100644 --- a/src/main/java/rife/bld/extension/PitestOperation.java +++ b/src/main/java/rife/bld/extension/PitestOperation.java @@ -45,7 +45,7 @@ public class PitestOperation extends AbstractProcessOperation { /** * The PIT options. */ - protected final Map options = new ConcurrentHashMap<>(); + private final Map options_ = new ConcurrentHashMap<>(); private BaseProject project_; /** @@ -56,7 +56,7 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation argLine(String line) { if (isNotBlank(line)) { - options.put("--argLine", line); + options_.put("--argLine", line); } return this; } @@ -81,7 +81,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #avoidCallsTo(String...) */ public PitestOperation avoidCallsTo(Collection avoidCallsTo) { - options.put("--avoidCallsTo", String.join(",", avoidCallsTo.stream().filter(this::isNotBlank).toList())); + options_.put("--avoidCallsTo", String.join(",", avoidCallsTo.stream().filter(this::isNotBlank).toList())); return this; } @@ -105,7 +105,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #avoidCallsTo(Collection) */ public PitestOperation avoidCallsTo(String... avoidCallTo) { - options.put("--avoidCallsTo", String.join(",", Arrays.stream(avoidCallTo).filter(this::isNotBlank).toList())); + options_.put("--avoidCallsTo", String.join(",", Arrays.stream(avoidCallTo).filter(this::isNotBlank).toList())); return this; } @@ -130,7 +130,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #classPath(Collection) */ public PitestOperation classPath(String... path) { - options.put("--classPath", String.join(",", Arrays.stream(path).filter(this::isNotBlank).toList())); + options_.put("--classPath", String.join(",", Arrays.stream(path).filter(this::isNotBlank).toList())); return this; } @@ -142,7 +142,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #classPath(String...) */ public PitestOperation classPath(Collection path) { - options.put("--classPath", String.join(",", path.stream().filter(this::isNotBlank).toList())); + options_.put("--classPath", String.join(",", path.stream().filter(this::isNotBlank).toList())); return this; } @@ -154,7 +154,7 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation classPathFile(String file) { if (isNotBlank(file)) { - options.put("--classPathFile", file); + options_.put("--classPathFile", file); } return this; } @@ -168,7 +168,7 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation coverageThreshold(int threshold) { if (threshold >= 0 && threshold <= 100) { - options.put("--coverageThreshold", String.valueOf(threshold)); + options_.put("--coverageThreshold", String.valueOf(threshold)); } return this; } @@ -207,9 +207,9 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation detectInlinedCode(boolean isDetectInlinedCode) { if (isDetectInlinedCode) { - options.put("--detectInlinedCode", TRUE); + options_.put("--detectInlinedCode", TRUE); } else { - options.put("--detectInlinedCode", FALSE); + options_.put("--detectInlinedCode", FALSE); } return this; } @@ -222,7 +222,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #excludedClasses(Collection) */ public PitestOperation excludedClasses(String... excludedClass) { - options.put("--excludedClasses", + options_.put("--excludedClasses", String.join(",", Arrays.stream(excludedClass).filter(this::isNotBlank).toList())); return this; } @@ -235,7 +235,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #excludedClasses(String...) */ public PitestOperation excludedClasses(Collection excludedClasses) { - options.put("--excludedClasses", String.join(",", excludedClasses.stream().filter(this::isNotBlank).toList())); + options_.put("--excludedClasses", String.join(",", excludedClasses.stream().filter(this::isNotBlank).toList())); return this; } @@ -248,7 +248,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #excludedGroups(Collection) */ public PitestOperation excludedGroups(String... excludedGroup) { - options.put("--excludedGroups", + options_.put("--excludedGroups", String.join(",", Arrays.stream(excludedGroup).filter(this::isNotBlank).toList())); return this; } @@ -262,7 +262,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #excludedGroups(String...) */ public PitestOperation excludedGroups(Collection excludedGroups) { - options.put("--excludedGroups", String.join(",", excludedGroups.stream().filter(this::isNotBlank).toList())); + options_.put("--excludedGroups", String.join(",", excludedGroups.stream().filter(this::isNotBlank).toList())); return this; } @@ -274,7 +274,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #excludedMethods(Collection) */ public PitestOperation excludedMethods(String... excludedMethod) { - options.put("--excludedMethods", + options_.put("--excludedMethods", String.join(",", Arrays.stream(excludedMethod).filter(this::isNotBlank).toList())); return this; } @@ -287,7 +287,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #excludedMethods(String...) */ public PitestOperation excludedMethods(Collection excludedMethods) { - options.put("--excludedMethods", + options_.put("--excludedMethods", String.join(",", excludedMethods.stream().filter(this::isNotBlank).toList())); return this; } @@ -299,7 +299,7 @@ public class PitestOperation extends AbstractProcessOperation { * @return this operation instance */ public PitestOperation excludedRunners(String runners) { - options.put("--excludedRunners", runners); + options_.put("--excludedRunners", runners); return this; } @@ -312,7 +312,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #excludedTestClasses(Collection) */ public PitestOperation excludedTestClasses(String... testClasses) { - options.put("--excludedTestClasses", String.join(",", testClasses)); + options_.put("--excludedTestClasses", String.join(",", testClasses)); return this; } @@ -325,7 +325,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #excludedTestClasses(String...) */ public PitestOperation excludedTestClasses(Collection testClasses) { - options.put("--excludedTestClasses", + options_.put("--excludedTestClasses", String.join(",", testClasses.stream().filter(this::isNotBlank).toList())); return this; } @@ -338,8 +338,8 @@ public class PitestOperation extends AbstractProcessOperation { protected List executeConstructProcessCommandList() { if (project_ == null) { throw new IllegalArgumentException("A project must be specified."); - } else if (!options.containsKey(SOURCE_DIRS)) { - options.put(SOURCE_DIRS, project_.srcDirectory().getPath()); + } else if (!options_.containsKey(SOURCE_DIRS)) { + options_.put(SOURCE_DIRS, project_.srcDirectory().getPath()); } final List args = new ArrayList<>(); @@ -351,7 +351,7 @@ public class PitestOperation extends AbstractProcessOperation { project_.buildTestDirectory())); args.add("org.pitest.mutationtest.commandline.MutationCoverageReport"); - options.forEach((k, v) -> { + options_.forEach((k, v) -> { args.add(k); if (!v.isEmpty()) { args.add(v); @@ -383,9 +383,9 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation exportLineCoverage(boolean jsExport) { if (jsExport) { - options.put("--exportLineCoverage", TRUE); + options_.put("--exportLineCoverage", TRUE); } else { - options.put("--exportLineCoverage", FALSE); + options_.put("--exportLineCoverage", FALSE); } return this; } @@ -400,9 +400,9 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation failWhenNoMutations(boolean isFail) { if (isFail) { - options.put("--failWhenNoMutations", TRUE); + options_.put("--failWhenNoMutations", TRUE); } else { - options.put("--failWhenNoMutations", FALSE); + options_.put("--failWhenNoMutations", FALSE); } return this; } @@ -415,7 +415,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #features(String...) */ public PitestOperation features(Collection feature) { - options.put("--features", String.join(",", feature.stream().filter(this::isNotBlank).toList())); + options_.put("--features", String.join(",", feature.stream().filter(this::isNotBlank).toList())); return this; } @@ -427,7 +427,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #features(Collection) */ public PitestOperation features(String... feature) { - options.put("--features", String.join(",", Arrays.stream(feature).filter(this::isNotBlank).toList())); + options_.put("--features", String.join(",", Arrays.stream(feature).filter(this::isNotBlank).toList())); return this; } @@ -439,9 +439,9 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation fullMutationMatrix(boolean isFullMutationMatrix) { if (isFullMutationMatrix) { - options.put("--fullMutationMatrix", TRUE); + options_.put("--fullMutationMatrix", TRUE); } else { - options.put("--fullMutationMatrix", FALSE); + options_.put("--fullMutationMatrix", FALSE); } return this; } @@ -454,7 +454,7 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation historyInputLocation(String path) { if (isNotBlank(path)) { - options.put("--historyInputLocation", path); + options_.put("--historyInputLocation", path); } return this; } @@ -468,7 +468,7 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation historyOutputLocation(String path) { if (isNotBlank(path)) { - options.put("--historyOutputLocation", path); + options_.put("--historyOutputLocation", path); } return this; } @@ -485,9 +485,9 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation includeLaunchClasspath(boolean isLaunchClasspath) { if (isLaunchClasspath) { - options.put("--includeLaunchClasspath", TRUE); + options_.put("--includeLaunchClasspath", TRUE); } else { - options.put("--includeLaunchClasspath", FALSE); + options_.put("--includeLaunchClasspath", FALSE); } return this; } @@ -501,7 +501,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #includedGroups(Collection) */ public PitestOperation includedGroups(String... includedGroup) { - options.put("--includedGroups", + options_.put("--includedGroups", String.join(",", Arrays.stream(includedGroup).filter(this::isNotBlank).toList())); return this; } @@ -515,7 +515,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #includedGroups(String...) */ public PitestOperation includedGroups(Collection includedGroups) { - options.put("--includedGroups", String.join(",", includedGroups.stream().filter(this::isNotBlank).toList())); + options_.put("--includedGroups", String.join(",", includedGroups.stream().filter(this::isNotBlank).toList())); return this; } @@ -526,7 +526,7 @@ public class PitestOperation extends AbstractProcessOperation { * @return this operation instance */ public PitestOperation includedTestMethods(String testMethod) { - options.put("--includedTestMethods", testMethod); + options_.put("--includedTestMethods", testMethod); return this; } @@ -540,7 +540,7 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation inputEncoding(String encoding) { if (isNotBlank(encoding)) { - options.put("--inputEncoding", encoding); + options_.put("--inputEncoding", encoding); } return this; } @@ -561,7 +561,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #jvmArgs(Collection) */ public PitestOperation jvmArgs(String... args) { - options.put("--jvmArgs", String.join(",", Arrays.stream(args).filter(this::isNotBlank).toList())); + options_.put("--jvmArgs", String.join(",", Arrays.stream(args).filter(this::isNotBlank).toList())); return this; } @@ -574,7 +574,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #jvmArgs(String...) */ public PitestOperation jvmArgs(Collection args) { - options.put("--jvmArgs", String.join(",", args.stream().filter(this::isNotBlank).toList())); + options_.put("--jvmArgs", String.join(",", args.stream().filter(this::isNotBlank).toList())); return this; } @@ -587,7 +587,7 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation jvmPath(String path) { if (isNotBlank(path)) { - options.put("--jvmPath", path); + options_.put("--jvmPath", path); } return this; } @@ -599,7 +599,7 @@ public class PitestOperation extends AbstractProcessOperation { * @return this operation instance */ public PitestOperation maxMutationsPerClass(int maxMutationsPerClass) { - options.put("--maxMutationsPerClass", String.valueOf(maxMutationsPerClass)); + options_.put("--maxMutationsPerClass", String.valueOf(maxMutationsPerClass)); return this; } @@ -610,7 +610,7 @@ public class PitestOperation extends AbstractProcessOperation { * @return this operation instance */ public PitestOperation maxSurviving(int maxSurviving) { - options.put("--maxSurviving", String.valueOf(maxSurviving)); + options_.put("--maxSurviving", String.valueOf(maxSurviving)); return this; } @@ -629,7 +629,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #mutableCodePaths(Collection) */ public PitestOperation mutableCodePaths(String... path) { - options.put("--mutableCodePaths", String.join(",", Arrays.stream(path).filter(this::isNotBlank).toList())); + options_.put("--mutableCodePaths", String.join(",", Arrays.stream(path).filter(this::isNotBlank).toList())); return this; } @@ -648,7 +648,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #mutableCodePaths(String...) */ public PitestOperation mutableCodePaths(Collection paths) { - options.put("--mutableCodePaths", String.join(",", paths.stream().filter(this::isNotBlank).toList())); + options_.put("--mutableCodePaths", String.join(",", paths.stream().filter(this::isNotBlank).toList())); return this; } @@ -661,7 +661,7 @@ public class PitestOperation extends AbstractProcessOperation { * @return this operation instance */ public PitestOperation mutationEngine(String engine) { - options.put("--mutationEngine", engine); + options_.put("--mutationEngine", engine); return this; } @@ -677,7 +677,7 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation mutationThreshold(int threshold) { if (threshold >= 0 && threshold <= 100) { - options.put("--mutationThreshold", String.valueOf(threshold)); + options_.put("--mutationThreshold", String.valueOf(threshold)); } return this; } @@ -689,7 +689,7 @@ public class PitestOperation extends AbstractProcessOperation { * @return this operation instance */ public PitestOperation mutationUnitSize(int size) { - options.put("--mutationUnitSize", String.valueOf(size)); + options_.put("--mutationUnitSize", String.valueOf(size)); return this; } @@ -701,7 +701,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #mutators(Collection) */ public PitestOperation mutators(String... mutator) { - options.put("--mutators", String.join(",", Arrays.stream(mutator).filter(this::isNotBlank).toList())); + options_.put("--mutators", String.join(",", Arrays.stream(mutator).filter(this::isNotBlank).toList())); return this; } @@ -713,10 +713,19 @@ public class PitestOperation extends AbstractProcessOperation { * @see #mutators(String...) */ public PitestOperation mutators(Collection mutators) { - options.put("--mutators", String.join(",", mutators.stream().filter(this::isNotBlank).toList())); + options_.put("--mutators", String.join(",", mutators.stream().filter(this::isNotBlank).toList())); return this; } + /** + * Returns the PIT options. + * + * @return the map of options + */ + public Map options() { + return options_; + } + /** * Output encoding. *

@@ -727,7 +736,7 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation outputEncoding(String encoding) { if (isNotBlank(encoding)) { - options.put("--outputEncoding", encoding); + options_.put("--outputEncoding", encoding); } return this; } @@ -743,7 +752,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #outputFormats(Collection) */ public PitestOperation outputFormats(String... outputFormat) { - options.put("--outputFormats", + options_.put("--outputFormats", String.join(",", Arrays.stream(outputFormat).filter(this::isNotBlank).toList())); return this; } @@ -759,7 +768,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #outputFormats(String...) */ public PitestOperation outputFormats(Collection outputFormats) { - options.put("--outputFormats", String.join(",", outputFormats.stream().filter(this::isNotBlank).toList())); + options_.put("--outputFormats", String.join(",", outputFormats.stream().filter(this::isNotBlank).toList())); return this; } @@ -771,7 +780,7 @@ public class PitestOperation extends AbstractProcessOperation { * @return this operation instance */ public PitestOperation pluginConfiguration(String key, String value) { - options.put("--pluginConfiguration", key + '=' + value); + options_.put("--pluginConfiguration", key + '=' + value); return this; } @@ -782,7 +791,7 @@ public class PitestOperation extends AbstractProcessOperation { * @return this operations instance */ public PitestOperation projectBase(String file) { - options.put("--projectBase", file); + options_.put("--projectBase", file); return this; } @@ -794,7 +803,7 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation reportDir(String dir) { if (isNotBlank(dir)) { - options.put("--reportDir", dir); + options_.put("--reportDir", dir); } return this; } @@ -809,9 +818,9 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation skipFailingTests(boolean isSkipFail) { if (isSkipFail) { - options.put("--skipFailingTests", TRUE); + options_.put("--skipFailingTests", TRUE); } else { - options.put("--skipFailingTests", FALSE); + options_.put("--skipFailingTests", FALSE); } return this; } @@ -824,7 +833,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #sourceDirs(Collection) */ public PitestOperation sourceDirs(String... dir) { - options.put(SOURCE_DIRS, String.join(",", Arrays.stream(dir).filter(this::isNotBlank).toList())); + options_.put(SOURCE_DIRS, String.join(",", Arrays.stream(dir).filter(this::isNotBlank).toList())); return this; } @@ -836,7 +845,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #sourceDirs(String...) */ public PitestOperation sourceDirs(Collection dirs) { - options.put(SOURCE_DIRS, String.join(",", dirs.stream().filter(this::isNotBlank).toList())); + options_.put(SOURCE_DIRS, String.join(",", dirs.stream().filter(this::isNotBlank).toList())); return this; } @@ -854,7 +863,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #targetClasses(Collection) */ public PitestOperation targetClasses(Collection targetClass) { - options.put("--targetClasses", String.join(",", targetClass.stream().filter(this::isNotBlank).toList())); + options_.put("--targetClasses", String.join(",", targetClass.stream().filter(this::isNotBlank).toList())); return this; } @@ -872,7 +881,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #targetClasses(String...) */ public PitestOperation targetClasses(String... targetClass) { - options.put("--targetClasses", String.join(",", Arrays.stream(targetClass).filter(this::isNotBlank).toList())); + options_.put("--targetClasses", String.join(",", Arrays.stream(targetClass).filter(this::isNotBlank).toList())); return this; } @@ -889,7 +898,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #targetTests(Collection) */ public PitestOperation targetTests(String... test) { - options.put("--targetTests", String.join(",", Arrays.stream(test).filter(this::isNotBlank).toList())); + options_.put("--targetTests", String.join(",", Arrays.stream(test).filter(this::isNotBlank).toList())); return this; } @@ -906,7 +915,7 @@ public class PitestOperation extends AbstractProcessOperation { * @see #targetTests(String...) */ public PitestOperation targetTests(Collection tests) { - options.put("--targetTests", String.join(",", tests.stream().filter(this::isNotBlank).toList())); + options_.put("--targetTests", String.join(",", tests.stream().filter(this::isNotBlank).toList())); return this; } @@ -917,7 +926,7 @@ public class PitestOperation extends AbstractProcessOperation { * @return this operation instance */ public PitestOperation testStrengthThreshold(int threshold) { - options.put("--testStrengthThreshold", String.valueOf(threshold)); + options_.put("--testStrengthThreshold", String.valueOf(threshold)); return this; } @@ -928,7 +937,7 @@ public class PitestOperation extends AbstractProcessOperation { * @return this operation instance */ public PitestOperation threads(int threads) { - options.put("--threads", String.valueOf(threads)); + options_.put("--threads", String.valueOf(threads)); return this; } @@ -942,7 +951,7 @@ public class PitestOperation extends AbstractProcessOperation { * @return this operation instance */ public PitestOperation timeoutConst(int factor) { - options.put("--timeoutConst", String.valueOf(factor)); + options_.put("--timeoutConst", String.valueOf(factor)); return this; } @@ -955,7 +964,7 @@ public class PitestOperation extends AbstractProcessOperation { * @return this operation instance */ public PitestOperation timeoutFactor(double factor) { - options.put("--timeoutFactor", String.valueOf(factor)); + options_.put("--timeoutFactor", String.valueOf(factor)); return this; } @@ -970,9 +979,9 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation timestampedReports(boolean isTimestamped) { if (isTimestamped) { - options.put("--timestampedReports", TRUE); + options_.put("--timestampedReports", TRUE); } else { - options.put("--timestampedReports", FALSE); + options_.put("--timestampedReports", FALSE); } return this; } @@ -987,9 +996,9 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation useClasspathJar(boolean isUseClasspathJar) { if (isUseClasspathJar) { - options.put("--useClasspathJar", TRUE); + options_.put("--useClasspathJar", TRUE); } else { - options.put("--useClasspathJar", FALSE); + options_.put("--useClasspathJar", FALSE); } return this; } @@ -1004,9 +1013,9 @@ public class PitestOperation extends AbstractProcessOperation { */ public PitestOperation verbose(boolean isVerbose) { if (isVerbose) { - options.put("--verbose", TRUE); + options_.put("--verbose", TRUE); } else { - options.put("--verbose", FALSE); + options_.put("--verbose", FALSE); } return this; } @@ -1020,7 +1029,7 @@ public class PitestOperation extends AbstractProcessOperation { * @return this operation instance */ public PitestOperation verbosity(String verbosity) { - options.put("--verbosity", verbosity); + options_.put("--verbosity", verbosity); return this; } } diff --git a/src/test/java/rife/bld/extension/PitestOperationTest.java b/src/test/java/rife/bld/extension/PitestOperationTest.java index 39dee6e..57623b2 100644 --- a/src/test/java/rife/bld/extension/PitestOperationTest.java +++ b/src/test/java/rife/bld/extension/PitestOperationTest.java @@ -42,7 +42,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .argLine(FOO); - assertThat(op.options.get("--argLine")).isEqualTo(FOO); + assertThat(op.options().get("--argLine")).isEqualTo(FOO); } @Test @@ -50,12 +50,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .avoidCallsTo(FOO, BAR); - assertThat(op.options.get("--avoidCallsTo")).isEqualTo(FOOBAR); + assertThat(op.options().get("--avoidCallsTo")).isEqualTo(FOOBAR); op = new PitestOperation() .fromProject(new Project()) .avoidCallsTo(List.of(FOO, BAR)); - assertThat(op.options.get("--avoidCallsTo")).as(AS_LIST).isEqualTo(FOOBAR); + assertThat(op.options().get("--avoidCallsTo")).as(AS_LIST).isEqualTo(FOOBAR); } @Test @@ -134,12 +134,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .classPath(FOO, BAR); - assertThat(op.options.get("--classPath")).isEqualTo(FOOBAR); + assertThat(op.options().get("--classPath")).isEqualTo(FOOBAR); op = new PitestOperation() .fromProject(new Project()) .classPath(List.of(FOO, BAR)); - assertThat(op.options.get("--classPath")).as(AS_LIST).isEqualTo(FOOBAR); + assertThat(op.options().get("--classPath")).as(AS_LIST).isEqualTo(FOOBAR); } @Test @@ -147,7 +147,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .classPathFile(FOO); - assertThat(op.options.get("--classPathFile")).isEqualTo(FOO); + assertThat(op.options().get("--classPathFile")).isEqualTo(FOO); } @Test @@ -155,12 +155,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .coverageThreshold(3); - assertThat(op.options.get("--coverageThreshold")).isEqualTo("3"); + assertThat(op.options().get("--coverageThreshold")).isEqualTo("3"); op = new PitestOperation() .fromProject(new BaseProject()) .coverageThreshold(101); - assertThat(op.options.get("--coverageThreshold")).isNull(); + assertThat(op.options().get("--coverageThreshold")).isNull(); } @Test @@ -168,12 +168,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .detectInlinedCode(true); - assertThat(op.options.get("--detectInlinedCode")).isEqualTo(TRUE); + assertThat(op.options().get("--detectInlinedCode")).isEqualTo(TRUE); op = new PitestOperation() .fromProject(new Project()) .detectInlinedCode(false); - assertThat(op.options.get("--detectInlinedCode")).isEqualTo(FALSE); + assertThat(op.options().get("--detectInlinedCode")).isEqualTo(FALSE); } @Test @@ -181,12 +181,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .excludedClasses(FOO, BAR); - assertThat(op.options.get("--excludedClasses")).isEqualTo(FOOBAR); + assertThat(op.options().get("--excludedClasses")).isEqualTo(FOOBAR); op = new PitestOperation() .fromProject(new Project()) .excludedClasses(Set.of(FOO, BAR)); - assertThat(op.options.get("--excludedClasses")).as("as set").contains(FOO).contains(BAR).contains(","); + assertThat(op.options().get("--excludedClasses")).as("as set").contains(FOO).contains(BAR).contains(","); } @Test @@ -194,12 +194,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .excludedGroups(FOO, BAR); - assertThat(op.options.get("--excludedGroups")).isEqualTo(FOOBAR); + assertThat(op.options().get("--excludedGroups")).isEqualTo(FOOBAR); op = new PitestOperation() .fromProject(new Project()) .excludedGroups(List.of(FOO, BAR)); - assertThat(op.options.get("--excludedGroups")).as(AS_LIST).isEqualTo(FOOBAR); + assertThat(op.options().get("--excludedGroups")).as(AS_LIST).isEqualTo(FOOBAR); } @Test @@ -207,12 +207,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .excludedMethods(FOO, BAR); - assertThat(op.options.get("--excludedMethods")).isEqualTo(FOOBAR); + assertThat(op.options().get("--excludedMethods")).isEqualTo(FOOBAR); op = new PitestOperation() .fromProject(new Project()) .excludedMethods(List.of(FOO, BAR)); - assertThat(op.options.get("--excludedMethods")).as(AS_LIST).isEqualTo(FOOBAR); + assertThat(op.options().get("--excludedMethods")).as(AS_LIST).isEqualTo(FOOBAR); } @Test @@ -220,7 +220,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .excludedRunners(FOO); - assertThat(op.options.get("--excludedRunners")).isEqualTo(FOO); + assertThat(op.options().get("--excludedRunners")).isEqualTo(FOO); } @Test @@ -228,12 +228,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .excludedTestClasses(FOO, BAR); - assertThat(op.options.get("--excludedTestClasses")).isEqualTo(FOOBAR); + assertThat(op.options().get("--excludedTestClasses")).isEqualTo(FOOBAR); op = new PitestOperation() .fromProject(new Project()) .excludedTestClasses(List.of(FOO, BAR)); - assertThat(op.options.get("--excludedTestClasses")).as("as list").isEqualTo(FOOBAR); + assertThat(op.options().get("--excludedTestClasses")).as("as list").isEqualTo(FOOBAR); } @Test @@ -292,12 +292,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .exportLineCoverage(true); - assertThat(op.options.get("--exportLineCoverage")).isEqualTo(TRUE); + assertThat(op.options().get("--exportLineCoverage")).isEqualTo(TRUE); op = new PitestOperation() .fromProject(new Project()) .exportLineCoverage(false); - assertThat(op.options.get("--exportLineCoverage")).isEqualTo(FALSE); + assertThat(op.options().get("--exportLineCoverage")).isEqualTo(FALSE); } @Test @@ -305,12 +305,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .failWhenNoMutations(true); - assertThat(op.options.get("--failWhenNoMutations")).isEqualTo(TRUE); + assertThat(op.options().get("--failWhenNoMutations")).isEqualTo(TRUE); op = new PitestOperation() .fromProject(new Project()) .failWhenNoMutations(false); - assertThat(op.options.get("--failWhenNoMutations")).isEqualTo(FALSE); + assertThat(op.options().get("--failWhenNoMutations")).isEqualTo(FALSE); } @Test @@ -318,12 +318,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .features(FOO, BAR); - assertThat(op.options.get("--features")).isEqualTo(FOOBAR); + assertThat(op.options().get("--features")).isEqualTo(FOOBAR); op = new PitestOperation() .fromProject(new Project()) .features(List.of(FOO, BAR)); - assertThat(op.options.get("--features")).as(AS_LIST).isEqualTo(FOOBAR); + assertThat(op.options().get("--features")).as(AS_LIST).isEqualTo(FOOBAR); } @Test @@ -331,7 +331,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .fullMutationMatrix(true); - assertThat(op.options.get("--fullMutationMatrix")).isEqualTo(TRUE); + assertThat(op.options().get("--fullMutationMatrix")).isEqualTo(TRUE); } @Test @@ -339,7 +339,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .historyInputLocation(FOO); - assertThat(op.options.get("--historyInputLocation")).isEqualTo(FOO); + assertThat(op.options().get("--historyInputLocation")).isEqualTo(FOO); } @Test @@ -347,7 +347,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .historyOutputLocation(FOO); - assertThat(op.options.get("--historyOutputLocation")).isEqualTo(FOO); + assertThat(op.options().get("--historyOutputLocation")).isEqualTo(FOO); } @Test @@ -355,12 +355,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .includeLaunchClasspath(true); - assertThat(op.options.get("--includeLaunchClasspath")).isEqualTo(TRUE); + assertThat(op.options().get("--includeLaunchClasspath")).isEqualTo(TRUE); op = new PitestOperation() .fromProject(new Project()) .includeLaunchClasspath(false); - assertThat(op.options.get("--includeLaunchClasspath")).isEqualTo(FALSE); + assertThat(op.options().get("--includeLaunchClasspath")).isEqualTo(FALSE); } @Test @@ -368,12 +368,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .includedGroups(FOO, BAR); - assertThat(op.options.get("--includedGroups")).isEqualTo(FOOBAR); + assertThat(op.options().get("--includedGroups")).isEqualTo(FOOBAR); op = new PitestOperation() .fromProject(new Project()) .includedGroups(List.of(FOO, BAR)); - assertThat(op.options.get("--includedGroups")).as(AS_LIST).isEqualTo(FOOBAR); + assertThat(op.options().get("--includedGroups")).as(AS_LIST).isEqualTo(FOOBAR); } @Test @@ -381,7 +381,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new Project()) .includedTestMethods(FOO); - assertThat(op.options.get("--includedTestMethods")).isEqualTo(FOO); + assertThat(op.options().get("--includedTestMethods")).isEqualTo(FOO); } @Test @@ -389,7 +389,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .inputEncoding(FOO); - assertThat(op.options.get("--inputEncoding")).isEqualTo(FOO); + assertThat(op.options().get("--inputEncoding")).isEqualTo(FOO); } @Test @@ -397,12 +397,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .jvmArgs(FOO, BAR); - assertThat(op.options.get("--jvmArgs")).isEqualTo(FOOBAR); + assertThat(op.options().get("--jvmArgs")).isEqualTo(FOOBAR); op = new PitestOperation() .fromProject(new Project()) .jvmArgs(List.of(FOO, BAR)); - assertThat(op.options.get("--jvmArgs")).as(AS_LIST).isEqualTo(FOOBAR); + assertThat(op.options().get("--jvmArgs")).as(AS_LIST).isEqualTo(FOOBAR); } @Test @@ -410,7 +410,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .jvmPath(FOO); - assertThat(op.options.get("--jvmPath")).isEqualTo(FOO); + assertThat(op.options().get("--jvmPath")).isEqualTo(FOO); } @Test @@ -418,7 +418,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .maxMutationsPerClass(12); - assertThat(op.options.get("--maxMutationsPerClass")).isEqualTo("12"); + assertThat(op.options().get("--maxMutationsPerClass")).isEqualTo("12"); } @Test @@ -426,7 +426,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new Project()) .maxSurviving(1); - assertThat(op.options.get("--maxSurviving")).isEqualTo("1"); + assertThat(op.options().get("--maxSurviving")).isEqualTo("1"); } @Test @@ -434,12 +434,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .mutableCodePaths(FOO, BAR); - assertThat(op.options.get("--mutableCodePaths")).isEqualTo(FOOBAR); + assertThat(op.options().get("--mutableCodePaths")).isEqualTo(FOOBAR); op = new PitestOperation() .fromProject(new Project()) .mutableCodePaths(List.of(FOO, BAR)); - assertThat(op.options.get("--mutableCodePaths")).as(AS_LIST).isEqualTo(FOOBAR); + assertThat(op.options().get("--mutableCodePaths")).as(AS_LIST).isEqualTo(FOOBAR); } @Test @@ -447,7 +447,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new Project()) .mutationEngine(FOO); - assertThat(op.options.get("--mutationEngine")).isEqualTo(FOO); + assertThat(op.options().get("--mutationEngine")).isEqualTo(FOO); } @Test @@ -455,12 +455,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .mutationThreshold(3); - assertThat(op.options.get("--mutationThreshold")).isEqualTo("3"); + assertThat(op.options().get("--mutationThreshold")).isEqualTo("3"); op = new PitestOperation() .fromProject(new BaseProject()) .mutationThreshold(101); - assertThat(op.options.get("--mutationThreshold")).isNull(); + assertThat(op.options().get("--mutationThreshold")).isNull(); } @Test @@ -468,7 +468,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new Project()) .mutationUnitSize(2); - assertThat(op.options.get("--mutationUnitSize")).isEqualTo("2"); + assertThat(op.options().get("--mutationUnitSize")).isEqualTo("2"); } @Test @@ -476,12 +476,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .mutators(FOO, BAR); - assertThat(op.options.get("--mutators")).isEqualTo(FOOBAR); + assertThat(op.options().get("--mutators")).isEqualTo(FOOBAR); op = new PitestOperation() .fromProject(new Project()) .mutators(List.of(FOO, BAR)); - assertThat(op.options.get("--mutators")).as(AS_LIST).isEqualTo(FOOBAR); + assertThat(op.options().get("--mutators")).as(AS_LIST).isEqualTo(FOOBAR); } @Test @@ -489,7 +489,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .outputEncoding(FOO); - assertThat(op.options.get("--outputEncoding")).isEqualTo(FOO); + assertThat(op.options().get("--outputEncoding")).isEqualTo(FOO); } @Test @@ -497,12 +497,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .outputFormats(FOO, BAR); - assertThat(op.options.get("--outputFormats")).isEqualTo(FOOBAR); + assertThat(op.options().get("--outputFormats")).isEqualTo(FOOBAR); op = new PitestOperation() .fromProject(new Project()) .outputFormats(List.of(FOO, BAR)); - assertThat(op.options.get("--outputFormats")).as(AS_LIST).isEqualTo(FOOBAR); + assertThat(op.options().get("--outputFormats")).as(AS_LIST).isEqualTo(FOOBAR); } @Test @@ -510,7 +510,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new Project()) .pluginConfiguration(FOO, BAR); - assertThat(op.options.get("--pluginConfiguration")).isEqualTo(FOO + "=" + BAR); + assertThat(op.options().get("--pluginConfiguration")).isEqualTo(FOO + "=" + BAR); } @Test @@ -518,7 +518,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new Project()) .projectBase(FOO); - assertThat(op.options.get("--projectBase")).isEqualTo(FOO); + assertThat(op.options().get("--projectBase")).isEqualTo(FOO); } @Test @@ -526,7 +526,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .reportDir(FOO); - assertThat(op.options.get("--reportDir")).isEqualTo(FOO); + assertThat(op.options().get("--reportDir")).isEqualTo(FOO); } @Test @@ -534,12 +534,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .skipFailingTests(true); - assertThat(op.options.get("--skipFailingTests")).isEqualTo(TRUE); + assertThat(op.options().get("--skipFailingTests")).isEqualTo(TRUE); op = new PitestOperation() .fromProject(new Project()) .skipFailingTests(false); - assertThat(op.options.get("--skipFailingTests")).isEqualTo(FALSE); + assertThat(op.options().get("--skipFailingTests")).isEqualTo(FALSE); } @Test @@ -547,12 +547,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .sourceDirs(FOO, BAR); - assertThat(op.options.get(SOURCE_DIRS)).isEqualTo(FOOBAR); + assertThat(op.options().get(SOURCE_DIRS)).isEqualTo(FOOBAR); op = new PitestOperation() .fromProject(new Project()) .sourceDirs(List.of(FOO, BAR)); - assertThat(op.options.get(SOURCE_DIRS)).as(AS_LIST).isEqualTo(FOOBAR); + assertThat(op.options().get(SOURCE_DIRS)).as(AS_LIST).isEqualTo(FOOBAR); } @Test @@ -560,12 +560,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .targetClasses(FOO, BAR); - assertThat(op.options.get("--targetClasses")).isEqualTo(FOOBAR); + assertThat(op.options().get("--targetClasses")).isEqualTo(FOOBAR); op = new PitestOperation() .fromProject(new Project()) .targetClasses(List.of(FOO, BAR)); - assertThat(op.options.get("--targetClasses")).as(AS_LIST).isEqualTo(FOOBAR); + assertThat(op.options().get("--targetClasses")).as(AS_LIST).isEqualTo(FOOBAR); } @Test @@ -573,12 +573,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .targetTests(FOO, BAR); - assertThat(op.options.get("--targetTests")).isEqualTo(FOOBAR); + assertThat(op.options().get("--targetTests")).isEqualTo(FOOBAR); op = new PitestOperation() .fromProject(new Project()) .targetTests(List.of(FOO, BAR)); - assertThat(op.options.get("--targetTests")).as(AS_LIST).isEqualTo(FOOBAR); + assertThat(op.options().get("--targetTests")).as(AS_LIST).isEqualTo(FOOBAR); } @Test @@ -586,7 +586,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new Project()) .testStrengthThreshold(6); - assertThat(op.options.get("--testStrengthThreshold")).isEqualTo("6"); + assertThat(op.options().get("--testStrengthThreshold")).isEqualTo("6"); } @Test @@ -594,7 +594,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .threads(3); - assertThat(op.options.get("--threads")).isEqualTo("3"); + assertThat(op.options().get("--threads")).isEqualTo("3"); } @Test @@ -602,7 +602,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .timeoutConst(300); - assertThat(op.options.get("--timeoutConst")).isEqualTo("300"); + assertThat(op.options().get("--timeoutConst")).isEqualTo("300"); } @Test @@ -610,7 +610,7 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .timeoutFactor(5.25); - assertThat(op.options.get("--timeoutFactor")).isEqualTo("5.25"); + assertThat(op.options().get("--timeoutFactor")).isEqualTo("5.25"); } @Test @@ -618,12 +618,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .timestampedReports(true); - assertThat(op.options.get("--timestampedReports")).isEqualTo(TRUE); + assertThat(op.options().get("--timestampedReports")).isEqualTo(TRUE); op = new PitestOperation() .fromProject(new Project()) .timestampedReports(false); - assertThat(op.options.get("--timestampedReports")).isEqualTo(FALSE); + assertThat(op.options().get("--timestampedReports")).isEqualTo(FALSE); } @Test @@ -631,12 +631,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .useClasspathJar(true); - assertThat(op.options.get("--useClasspathJar")).isEqualTo(TRUE); + assertThat(op.options().get("--useClasspathJar")).isEqualTo(TRUE); op = new PitestOperation() .fromProject(new Project()) .useClasspathJar(false); - assertThat(op.options.get("--useClasspathJar")).isEqualTo(FALSE); + assertThat(op.options().get("--useClasspathJar")).isEqualTo(FALSE); } @Test @@ -644,12 +644,12 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new BaseProject()) .verbose(true); - assertThat(op.options.get("--verbose")).isEqualTo(TRUE); + assertThat(op.options().get("--verbose")).isEqualTo(TRUE); op = new PitestOperation() .fromProject(new Project()) .verbose(false); - assertThat(op.options.get("--verbose")).isEqualTo(FALSE); + assertThat(op.options().get("--verbose")).isEqualTo(FALSE); } @Test @@ -657,6 +657,6 @@ class PitestOperationTest { var op = new PitestOperation() .fromProject(new Project()) .verbosity(FOO); - assertThat(op.options.get("--verbosity")).isEqualTo(FOO); + assertThat(op.options().get("--verbosity")).isEqualTo(FOO); } }