use of org.commonjava.indy.hostedbyarc.client.IndyHostedByArchiveClientModule in project indy by Commonjava.
the class HostedByArcConflictTest method testUploadZipAndCreate.
@Test
public void testUploadZipAndCreate() throws Exception {
final String hostedRepoName = "test";
HostedRepository hosted = client.stores().create(new HostedRepository(MavenPackageTypeDescriptor.MAVEN_PKG_KEY, hostedRepoName), "create first", HostedRepository.class);
waitForEventPropagation();
assertThat(client.stores().exists(hosted.getKey()), equalTo(true));
IndyHostedByArchiveClientModule module = client.module(IndyHostedByArchiveClientModule.class);
try {
module.createRepo(getZipFile(), hostedRepoName);
} catch (IndyClientException e) {
logger.info(e.getMessage());
assertThat(e.getStatusCode(), equalTo(ApplicationStatus.CONFLICT.code()));
}
}
use of org.commonjava.indy.hostedbyarc.client.IndyHostedByArchiveClientModule in project indy by Commonjava.
the class HostedByArcWithIgnoreRootUploadTest method testUploadZipAndCreate.
@Test
public void testUploadZipAndCreate() throws Exception {
IndyHostedByArchiveClientModule module = client.module(IndyHostedByArchiveClientModule.class);
final String hostedRepoName = "hosted-zip-ignore";
HostedRepository repo = module.createRepo(getZipFile(), hostedRepoName, "maven-repository");
assertThat(repo, notNullValue());
assertThat(repo.getName(), equalTo(hostedRepoName));
boolean exists = client.content().exists(repo.getKey(), "org/foo/bar/1.0/foo-bar-1.0.pom");
assertTrue(exists);
}
use of org.commonjava.indy.hostedbyarc.client.IndyHostedByArchiveClientModule in project indy by Commonjava.
the class HostedByArcDisableTest method testUploadZipAndCreate.
@Test
public void testUploadZipAndCreate() throws Exception {
IndyHostedByArchiveClientModule module = client.module(IndyHostedByArchiveClientModule.class);
final String hostedRepoName = "hosted-zip-ignore";
try {
module.createRepo(getZipFile(), hostedRepoName, "maven-repository");
} catch (IndyClientException e) {
logger.info(e.getMessage());
assertThat(e.getStatusCode(), equalTo(ApplicationStatus.METHOD_NOT_ALLOWED.code()));
}
}
use of org.commonjava.indy.hostedbyarc.client.IndyHostedByArchiveClientModule in project indy by Commonjava.
the class HostedByArcWithoutIgnoreRootUploadTest method testUploadZipAndCreate.
@Test
public void testUploadZipAndCreate() throws Exception {
IndyHostedByArchiveClientModule module = client.module(IndyHostedByArchiveClientModule.class);
final String hostedRepoName = "hosted-zip-no-ignore";
HostedRepository repo = module.createRepo(getZipFile(), hostedRepoName);
assertThat(repo, notNullValue());
assertThat(repo.getName(), equalTo(hostedRepoName));
boolean exists = client.content().exists(repo.getKey(), "org/foo/bar/1.0/foo-bar-1.0.pom");
assertTrue(exists);
}
Aggregations