Avoid duplicate literals (PMD)
This commit is contained in:
parent
b7fb8d9728
commit
d7d9cdf98c
1 changed files with 6 additions and 4 deletions
|
@ -59,19 +59,21 @@ class CheckstyleOperationTest {
|
||||||
@Test
|
@Test
|
||||||
void exclude() {
|
void exclude() {
|
||||||
var op = new CheckstyleOperation().fromProject(new Project()).exclude(FOO, BAR);
|
var op = new CheckstyleOperation().fromProject(new Project()).exclude(FOO, BAR);
|
||||||
assertThat(op.executeConstructProcessCommandList()).contains("-e " + FOO, "-e " + BAR);
|
var e = "-e ";
|
||||||
|
assertThat(op.executeConstructProcessCommandList()).contains(e + FOO, e + BAR);
|
||||||
|
|
||||||
op = new CheckstyleOperation().fromProject(new Project()).exclude(List.of(FOO, BAR));
|
op = new CheckstyleOperation().fromProject(new Project()).exclude(List.of(FOO, BAR));
|
||||||
assertThat(op.executeConstructProcessCommandList()).as("as list").contains("-e " + FOO, "-e " + BAR);
|
assertThat(op.executeConstructProcessCommandList()).as("as list").contains(e + FOO, e + BAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void excludeRegex() {
|
void excludeRegex() {
|
||||||
var op = new CheckstyleOperation().fromProject(new Project()).excludeRegex(FOO, BAR);
|
var op = new CheckstyleOperation().fromProject(new Project()).excludeRegex(FOO, BAR);
|
||||||
assertThat(op.executeConstructProcessCommandList()).contains("-x " + FOO, "-x " + BAR);
|
var x = "-x ";
|
||||||
|
assertThat(op.executeConstructProcessCommandList()).contains(x + FOO, x + BAR);
|
||||||
|
|
||||||
op = new CheckstyleOperation().fromProject(new Project()).excludeRegex(List.of(FOO, BAR));
|
op = new CheckstyleOperation().fromProject(new Project()).excludeRegex(List.of(FOO, BAR));
|
||||||
assertThat(op.executeConstructProcessCommandList()).as("as list").contains("-x " + FOO, "-x " + BAR);
|
assertThat(op.executeConstructProcessCommandList()).as("as list").contains(x + FOO, x + BAR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue