Skip to content

Commit

Permalink
Restore parameterized test
Browse files Browse the repository at this point in the history
  • Loading branch information
NotMyFault committed May 22, 2023
1 parent d358379 commit 9bc1e7d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 18 deletions.
9 changes: 8 additions & 1 deletion maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<packaging>maven-plugin</packaging>
<properties>
<maven-plugin-tools.version>3.8.1</maven-plugin-tools.version>
<junit.version>5.9.3</junit.version>
</properties>

<prerequisites>
Expand Down Expand Up @@ -66,7 +67,13 @@
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.9.3</version>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-params</artifactId>
<version>${junit.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package io.jenkins.tools.incrementals.maven;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

import java.util.Arrays;
import java.util.Collection;
Expand All @@ -15,23 +16,12 @@ public static Collection<Object[]> data() {
});
}

private String input;

private int size;

private char type;

public DetectIndentTest(String input, int size, char type) {
this.input = input;
this.size = size;
this.type = type;
}

@Test
public void detectIndentSize() {
@ParameterizedTest
@MethodSource("data")
public void detectIndentSize(String input, int size, char type) {
DetectIndent detectIndent = new DetectIndent();
DetectIndent.Indent indent = detectIndent.detect(input);
assertEquals(size, indent.size);
assertEquals(type, indent.type);
assertEquals(size, indent.getSize());
assertEquals(type, indent.getType());
}
}

0 comments on commit 9bc1e7d

Please sign in to comment.