#145 - Migrate unit tests to JUnit 5 and AssertJ.

This commit is contained in:
Mark Paluch
2020-04-30 15:02:35 +02:00
parent 44517c9680
commit 1a1e0cd07d
42 changed files with 480 additions and 456 deletions

View File

@@ -119,10 +119,9 @@ class GitCommands extends TimedCommand {
public void backportChangelogs(@CliOption(key = "", mandatory = true) TrainIteration iteration, //
@CliOption(key = "target") String trains) {
List<Train> targets = trains == null ? Collections.emptyList()
: Stream.of(trains.split(",")).//
map(it -> ReleaseTrains.getTrainByName(it)).//
collect(Collectors.toList());
List<Train> targets = trains == null ? Collections.emptyList() : Stream.of(trains.split(",")).//
map(it -> ReleaseTrains.getTrainByName(it)).//
collect(Collectors.toList());
git.backportChangelogs(iteration, targets);
}

View File

@@ -64,7 +64,7 @@ public class Tickets implements Streamable<Ticket> {
public Ticket getReleaseTicket(ModuleIteration moduleIteration) {
return findReleaseTicket(moduleIteration).orElseThrow(
() -> new IllegalStateException(String.format("Did not find a release ticket for %s!", moduleIteration)));
() -> new IllegalArgumentException(String.format("Did not find a release ticket for %s!", moduleIteration)));
}
public Tickets getIssueTickets(ModuleIteration moduleIteration) {

View File

@@ -530,7 +530,7 @@ class GitHub implements IssueTracker {
Optional<Milestone> milestone = findMilestone(moduleIteration, repositoryName);
return milestone
.orElseThrow(() -> new IllegalStateException(String.format("No milestone for %s found containing %s!", //
.orElseThrow(() -> new IllegalArgumentException(String.format("No milestone for %s found containing %s!", //
moduleIteration.getProject().getFullName(), //
moduleIteration.getShortVersionString())));
}