From cfdb81dad470850deb29d7d1eff23847e6e8b07a Mon Sep 17 00:00:00 2001 From: "Erik C. Thauvin" Date: Fri, 30 Aug 2024 15:08:38 -0700 Subject: [PATCH] Minor cleanups --- README.md | 4 +-- .../rife/bld/extension/PitestOperation.java | 34 ++++++------------- 2 files changed, 12 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 5cb787b..cb220dd 100755 --- a/README.md +++ b/README.md @@ -40,8 +40,8 @@ Don't forget to add the Pitest `test` dependencies to your build file, as they a ```java repositories = List.of(MAVEN_CENTRAL); scope(test) - .include(dependency("org.pitest", "pitest", version(1, 16, 1))) - .include(dependency("org.pitest", "pitest-command-line", version(1, 16, 1))) + .include(dependency("org.pitest", "pitest", version(1, 16, 2))) + .include(dependency("org.pitest", "pitest-command-line", version(1, 16, 2))) .include(dependency("org.pitest", "pitest-junit5-plugin", version(1, 2, 1))) .include(dependency("org.pitest", "pitest-testng-plugin", version(1, 0, 0))); ``` diff --git a/src/main/java/rife/bld/extension/PitestOperation.java b/src/main/java/rife/bld/extension/PitestOperation.java index 3c5b2b3..eb6c5c7 100644 --- a/src/main/java/rife/bld/extension/PitestOperation.java +++ b/src/main/java/rife/bld/extension/PitestOperation.java @@ -106,8 +106,7 @@ public PitestOperation avoidCallsTo(Collection avoidCallsTo) { * @see #avoidCallsTo(Collection) */ public PitestOperation avoidCallsTo(String... avoidCallTo) { - options_.put("--avoidCallsTo", String.join(",", Arrays.stream(avoidCallTo).filter(this::isNotBlank).toList())); - return this; + return avoidCallsTo(List.of(avoidCallTo)); } /** @@ -292,9 +291,7 @@ public PitestOperation detectInlinedCode(boolean isDetectInlinedCode) { * @see #excludedClasses(Collection) */ public PitestOperation excludedClasses(String... excludedClass) { - options_.put("--excludedClasses", - String.join(",", Arrays.stream(excludedClass).filter(this::isNotBlank).toList())); - return this; + return excludedClasses(List.of(excludedClass)); } /** @@ -318,9 +315,7 @@ public PitestOperation excludedClasses(Collection excludedClasses) { * @see #excludedGroups(Collection) */ public PitestOperation excludedGroups(String... excludedGroup) { - options_.put("--excludedGroups", - String.join(",", Arrays.stream(excludedGroup).filter(this::isNotBlank).toList())); - return this; + return excludedGroups(List.of(excludedGroup)); } /** @@ -344,9 +339,7 @@ public PitestOperation excludedGroups(Collection excludedGroups) { * @see #excludedMethods(Collection) */ public PitestOperation excludedMethods(String... excludedMethod) { - options_.put("--excludedMethods", - String.join(",", Arrays.stream(excludedMethod).filter(this::isNotBlank).toList())); - return this; + return excludedMethods(List.of(excludedMethod)); } /** @@ -382,8 +375,7 @@ public PitestOperation excludedRunners(String runners) { * @see #excludedTestClasses(Collection) */ public PitestOperation excludedTestClasses(String... testClasses) { - options_.put("--excludedTestClasses", String.join(",", testClasses)); - return this; + return excludedTestClasses(List.of(testClasses)); } /** @@ -509,8 +501,7 @@ public PitestOperation features(Collection feature) { * @see #features(Collection) */ public PitestOperation features(String... feature) { - options_.put("--features", String.join(",", Arrays.stream(feature).filter(this::isNotBlank).toList())); - return this; + return features(List.of(feature)); } /** @@ -625,9 +616,7 @@ public PitestOperation includeLaunchClasspath(boolean isLaunchClasspath) { * @see #includedGroups(Collection) */ public PitestOperation includedGroups(String... includedGroup) { - options_.put("--includedGroups", - String.join(",", Arrays.stream(includedGroup).filter(this::isNotBlank).toList())); - return this; + return includedGroups(List.of(includedGroup)); } /** @@ -685,8 +674,7 @@ private boolean isNotBlank(String s) { * @see #jvmArgs(Collection) */ public PitestOperation jvmArgs(String... args) { - options_.put("--jvmArgs", String.join(",", Arrays.stream(args).filter(this::isNotBlank).toList())); - return this; + return jvmArgs(List.of(args)); } /** @@ -1238,8 +1226,7 @@ public PitestOperation targetClasses(Collection targetClass) { * @see #targetClasses(String...) */ public PitestOperation targetClasses(String... targetClass) { - options_.put("--targetClasses", String.join(",", Arrays.stream(targetClass).filter(this::isNotBlank).toList())); - return this; + return targetClasses(List.of(targetClass)); } /** @@ -1255,8 +1242,7 @@ public PitestOperation targetClasses(String... targetClass) { * @see #targetTests(Collection) */ public PitestOperation targetTests(String... test) { - options_.put("--targetTests", String.join(",", Arrays.stream(test).filter(this::isNotBlank).toList())); - return this; + return targetTests(List.of(test)); } /**