use of org.commonjava.indy.changelog.client.IndyRepoChangelogClientModule in project indy by Commonjava.
the class RepoChangelogStoreDisableTest method test.
@Test
public void test() throws Exception {
HostedRepository repo = new HostedRepository(MAVEN_PKG_KEY, newName());
final StoreKey hostedKey = repo.getKey();
repo = client.stores().create(repo, name.getMethodName(), HostedRepository.class);
repo.setAllowReleases(!repo.isAllowReleases());
client.stores().update(repo, name.getMethodName());
repo.setReadonly(true);
client.stores().update(repo, name.getMethodName());
IndyRepoChangelogClientModule repoChangelogClientModule = client.module(IndyRepoChangelogClientModule.class);
List<ChangeEvent> logs = null;
try {
logs = repoChangelogClientModule.getByStoreKey(repo.getKey());
} catch (IndyClientException e) {
assertThat(e.getStatusCode(), equalTo(404));
}
assertNotNull(logs);
assertTrue(logs.isEmpty());
try {
repoChangelogClientModule.getAll();
} catch (IndyClientException e) {
assertThat(e.getStatusCode(), equalTo(404));
}
assertNotNull(logs);
assertTrue(logs.isEmpty());
}
Aggregations