Skip to content

Commit

Permalink
Revert to junit 4
Browse files Browse the repository at this point in the history
  • Loading branch information
ybroeker committed May 27, 2020
1 parent 63c16d8 commit 6c806e1
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 22 deletions.
11 changes: 2 additions & 9 deletions server/implementation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,8 @@

<!-- Testing -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.6.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<version>5.6.2</version>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,36 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;

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

public class CharTransformerTest {

@ParameterizedTest
@CsvSource({
"ab,a",
"a,a"
})
void shouldUseFirstCharFromString(String graphQlString, Character expected) {
final Character actual = new CharTransformer().in(graphQlString);
@Test
public void shouldUseFirstCharFromString() {
final Character actual = new CharTransformer().in("ab");

assertThat(actual).isEqualTo('a');
}

assertThat(actual).isEqualTo(expected);
@Test
public void shouldUseFirstCharFromSingleLetterString() {
final Character actual = new CharTransformer().in("a");

assertThat(actual).isEqualTo('a');
}

@Test
void shouldThrowIfStringIsEmpty() {
public void shouldThrowIfStringIsEmpty() {
assertThatThrownBy(() -> new CharTransformer().in(""))
.isInstanceOf(Exception.class);

}

@Test
void shouldFormatCharAsString() {
public void shouldFormatCharAsString() {
final String actual = new CharTransformer().out('a');

assertThat(actual).isEqualTo("a");
}

}

0 comments on commit 6c806e1

Please sign in to comment.