Search in sources :

Example 6 with SiteConfig

use of org.commonjava.util.jhttpc.model.SiteConfig in project indy by Commonjava.

the class IndySiteConfigLookupTest method checkServerCertPemIsConfigured.

@Test
public void checkServerCertPemIsConfigured() throws IndyDataException {
    RemoteRepository remote = new RemoteRepository(MAVEN_PKG_KEY, "test", "http://test.com/repo");
    remote.setServerCertPem("AAAAFFFFFSDADFADSFASDFASDFASDFASDFASDFsa");
    remote.setServerTrustPolicy("self-signed");
    MemoryStoreDataManager storeData = new MemoryStoreDataManager(true);
    storeData.storeArtifactStore(remote, new ChangeSummary(ChangeSummary.SYSTEM_USER, "This is a test"), false, false, new EventMetadata());
    IndySiteConfigLookup lookup = new IndySiteConfigLookup(storeData);
    SiteConfig siteConfig = lookup.lookup("remote:test");
    assertThat(siteConfig.getServerCertPem(), equalTo(remote.getServerCertPem()));
}
Also used : MemoryStoreDataManager(org.commonjava.indy.mem.data.MemoryStoreDataManager) RemoteRepository(org.commonjava.indy.model.core.RemoteRepository) SiteConfig(org.commonjava.util.jhttpc.model.SiteConfig) ChangeSummary(org.commonjava.indy.audit.ChangeSummary) EventMetadata(org.commonjava.maven.galley.event.EventMetadata) Test(org.junit.Test)

Example 7 with SiteConfig

use of org.commonjava.util.jhttpc.model.SiteConfig in project indy by Commonjava.

the class AbstractIndyFunctionalTest method createIndyClient.

protected Indy createIndyClient() throws IndyClientException {
    SiteConfig config = new SiteConfigBuilder("indy", fixture.getUrl()).withRequestTimeoutSeconds(60).build();
    Collection<IndyClientModule> modules = getAdditionalClientModules();
    return new Indy(config, new MemoryPasswordManager(), new IndyObjectMapper(getAdditionalMapperModules()), modules.toArray(new IndyClientModule[modules.size()]));
}
Also used : IndyObjectMapper(org.commonjava.indy.model.core.io.IndyObjectMapper) SiteConfigBuilder(org.commonjava.util.jhttpc.model.SiteConfigBuilder) Indy(org.commonjava.indy.client.core.Indy) SiteConfig(org.commonjava.util.jhttpc.model.SiteConfig) MemoryPasswordManager(org.commonjava.util.jhttpc.auth.MemoryPasswordManager) IndyClientModule(org.commonjava.indy.client.core.IndyClientModule)

Aggregations

SiteConfig (org.commonjava.util.jhttpc.model.SiteConfig)7 SiteConfigBuilder (org.commonjava.util.jhttpc.model.SiteConfigBuilder)4 Test (org.junit.Test)3 Indy (org.commonjava.indy.client.core.Indy)2 IndyClientModule (org.commonjava.indy.client.core.IndyClientModule)2 IndyObjectMapper (org.commonjava.indy.model.core.io.IndyObjectMapper)2 MemoryPasswordManager (org.commonjava.util.jhttpc.auth.MemoryPasswordManager)2 File (java.io.File)1 FileOutputStream (java.io.FileOutputStream)1 HashMap (java.util.HashMap)1 ChangeSummary (org.commonjava.indy.audit.ChangeSummary)1 AbstractIndyFunctionalTest (org.commonjava.indy.ftest.core.AbstractIndyFunctionalTest)1 MemoryStoreDataManager (org.commonjava.indy.mem.data.MemoryStoreDataManager)1 RemoteRepository (org.commonjava.indy.model.core.RemoteRepository)1 IndyHttpConfig (org.commonjava.indy.subsys.http.conf.IndyHttpConfig)1 TransferLocationException (org.commonjava.maven.galley.TransferLocationException)1 EventMetadata (org.commonjava.maven.galley.event.EventMetadata)1 JHttpCException (org.commonjava.util.jhttpc.JHttpCException)1 Ignore (org.junit.Ignore)1