Skip to content

Commit

Permalink
Minor cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
ethauvin committed Aug 30, 2024
1 parent bf097e6 commit cfdb81d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 26 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
```
34 changes: 10 additions & 24 deletions src/main/java/rife/bld/extension/PitestOperation.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,7 @@ public PitestOperation avoidCallsTo(Collection<String> 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));
}

/**
Expand Down Expand Up @@ -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));
}

/**
Expand All @@ -318,9 +315,7 @@ public PitestOperation excludedClasses(Collection<String> 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));
}

/**
Expand All @@ -344,9 +339,7 @@ public PitestOperation excludedGroups(Collection<String> 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));
}

/**
Expand Down Expand Up @@ -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));
}

/**
Expand Down Expand Up @@ -509,8 +501,7 @@ public PitestOperation features(Collection<String> 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));
}

/**
Expand Down Expand Up @@ -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));
}

/**
Expand Down Expand Up @@ -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));
}

/**
Expand Down Expand Up @@ -1238,8 +1226,7 @@ public PitestOperation targetClasses(Collection<String> 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));
}

/**
Expand All @@ -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));
}

/**
Expand Down

0 comments on commit cfdb81d

Please sign in to comment.