/** * RtReleases can remove a release. * * @throws Exception if any problem inside */ @Test public void canRemoveRelease() throws Exception { final Releases releases = repo.releases(); final Release release = releases.create(RandomStringUtils.randomAlphanumeric(Tv.TEN)); MatcherAssert.assertThat(releases.iterate(), Matchers.hasItem(release)); releases.remove(release.number()); MatcherAssert.assertThat(releases.iterate(), Matchers.not(Matchers.hasItem(release))); }
/** * RtReleases can edit release body. * * @throws Exception if any problem inside. */ @Test public void canEditBody() throws Exception { final Releases releases = repo.releases(); final Release release = releases.create(RandomStringUtils.randomAlphanumeric(Tv.TEN)); final String body = "Description of the release"; new Release.Smart(release).body(body); MatcherAssert.assertThat( new Release.Smart(releases.get(release.number())).body(), Matchers.equalTo(body)); releases.remove(release.number()); }
/** * RtReleases can edit release tag. * * @throws Exception if any problem inside. */ @Test public void canEditTag() throws Exception { final Releases releases = repo.releases(); final Release release = releases.create(RandomStringUtils.randomAlphanumeric(Tv.TEN)); final String tag = RandomStringUtils.randomAlphanumeric(Tv.FIFTEEN); new Release.Smart(release).tag(tag); MatcherAssert.assertThat( new Release.Smart(releases.get(release.number())).tag(), Matchers.equalTo(tag)); releases.remove(release.number()); }
/** * RtReleases can iterate releases. * * @throws Exception if something goes wrong */ @Test public void canFetchAllReleases() throws Exception { final Releases releases = repo.releases(); final Release release = releases.create(RandomStringUtils.randomAlphanumeric(Tv.TEN)); try { MatcherAssert.assertThat( releases.iterate(), Matchers.not(Matchers.emptyIterableOf(Release.class))); } finally { releases.remove(release.number()); } }
/** * RtReleases can fetch a single release. * * @throws Exception if any error inside */ @Test public void canFetchRelease() throws Exception { final Releases releases = repo.releases(); final String tag = "v1.0"; final Release release = releases.create(tag); MatcherAssert.assertThat( releases.get(release.number()).number(), Matchers.equalTo(release.number())); MatcherAssert.assertThat( new Release.Smart(releases.get(release.number())).tag(), Matchers.equalTo(tag)); releases.remove(release.number()); }
/** * RtReleases can create a release. * * @throws Exception if any error inside */ @Test public void canCreateRelease() throws Exception { final Releases releases = repo.releases(); final Release created = releases.create("0.1"); final int number = created.number(); try { final Release obtained = releases.get(number); MatcherAssert.assertThat(created, Matchers.is(obtained)); MatcherAssert.assertThat( new Release.Smart(created).tag(), Matchers.equalTo(new Release.Smart(obtained).tag())); } finally { releases.remove(number); } }