Search in sources :

Example 1 with IndyRepoChangelogClientModule

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());
}
Also used : IndyRepoChangelogClientModule(org.commonjava.indy.changelog.client.IndyRepoChangelogClientModule) ChangeEvent(org.commonjava.auditquery.history.ChangeEvent) IndyClientException(org.commonjava.indy.client.core.IndyClientException) StoreKey(org.commonjava.indy.model.core.StoreKey) HostedRepository(org.commonjava.indy.model.core.HostedRepository) AbstractIndyFunctionalTest(org.commonjava.indy.ftest.core.AbstractIndyFunctionalTest) Test(org.junit.Test)

Aggregations

ChangeEvent (org.commonjava.auditquery.history.ChangeEvent)1 IndyRepoChangelogClientModule (org.commonjava.indy.changelog.client.IndyRepoChangelogClientModule)1 IndyClientException (org.commonjava.indy.client.core.IndyClientException)1 AbstractIndyFunctionalTest (org.commonjava.indy.ftest.core.AbstractIndyFunctionalTest)1 HostedRepository (org.commonjava.indy.model.core.HostedRepository)1 StoreKey (org.commonjava.indy.model.core.StoreKey)1 Test (org.junit.Test)1