Not throwing exception when milestone not found

fixes #14
This commit is contained in:
Marcin Grzejszczak
2017-03-17 09:23:58 +01:00
parent 194579280a
commit b162a5746c
2 changed files with 7 additions and 4 deletions

View File

@@ -60,7 +60,7 @@ class MilestoneCloser {
}
}
if (!matchingMilestone) {
throw new IllegalStateException("No matching milestone was found");
log.warn("No matching milestone was found");
}
}

View File

@@ -5,7 +5,9 @@ import java.net.URISyntaxException;
import javax.json.Json;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
import org.springframework.boot.test.rule.OutputCapture;
import org.springframework.cloud.release.internal.ReleaserProperties;
import org.springframework.cloud.release.internal.pom.ProjectVersion;
@@ -13,6 +15,7 @@ import com.jcabi.github.Milestone;
import com.jcabi.github.Repo;
import com.jcabi.github.mock.MkGithub;
import static org.assertj.core.api.BDDAssertions.then;
import static org.assertj.core.api.BDDAssertions.thenThrownBy;
/**
@@ -22,6 +25,7 @@ public class MilestoneCloserTests {
MkGithub github;
Repo repo;
@Rule public OutputCapture capture = new OutputCapture();
@Before
public void setup() throws URISyntaxException, IOException {
@@ -64,9 +68,8 @@ public class MilestoneCloserTests {
};
repo.milestones().create("v0.2.0.BUILD-SNAPSHOT");
thenThrownBy(() -> closer.closeMilestone(sleuthProject()))
.isInstanceOf(IllegalStateException.class)
.hasMessageContaining("No matching milestone was found");
closer.closeMilestone(sleuthProject());
then(this.capture.toString()).contains("No matching milestone was found");
}
@Test