Search in sources :

Example 1 with ClientBuilder

use of org.codice.ddf.cxf.client.ClientBuilder in project ddf by codice.

the class SolrRestTest method setUp.

@Before
public void setUp() {
    EncryptionService encryptionService = mock(EncryptionService.class);
    when(encryptionService.decrypt(anyString())).thenReturn("test");
    ClientBuilderFactory clientBuilderFactory = mock(ClientBuilderFactory.class);
    SecureCxfClientFactory secureCxfClientFactory = mock(SecureCxfClientFactory.class);
    ClientBuilder clientBuilder = new ClientBuilderImpl(mock(OAuthSecurity.class), mock(SamlSecurity.class), mock(SecurityLogger.class), mock(SecurityManager.class)) {

        @Override
        public SecureCxfClientFactory build() {
            return secureCxfClientFactory;
        }
    };
    when(clientBuilderFactory.getClientBuilder()).thenReturn(clientBuilder);
    solrRest = new SolrRest(clientBuilderFactory, encryptionService);
}
Also used : ClientBuilderImpl(org.codice.ddf.cxf.client.impl.ClientBuilderImpl) SecurityManager(ddf.security.service.SecurityManager) SecureCxfClientFactory(org.codice.ddf.cxf.client.SecureCxfClientFactory) EncryptionService(ddf.security.encryption.EncryptionService) OAuthSecurity(org.codice.ddf.cxf.oauth.OAuthSecurity) ClientBuilderFactory(org.codice.ddf.cxf.client.ClientBuilderFactory) SamlSecurity(org.codice.ddf.security.jaxrs.SamlSecurity) ClientBuilder(org.codice.ddf.cxf.client.ClientBuilder) SecurityLogger(ddf.security.audit.SecurityLogger) Before(org.junit.Before)

Aggregations

SecurityLogger (ddf.security.audit.SecurityLogger)1 EncryptionService (ddf.security.encryption.EncryptionService)1 SecurityManager (ddf.security.service.SecurityManager)1 ClientBuilder (org.codice.ddf.cxf.client.ClientBuilder)1 ClientBuilderFactory (org.codice.ddf.cxf.client.ClientBuilderFactory)1 SecureCxfClientFactory (org.codice.ddf.cxf.client.SecureCxfClientFactory)1 ClientBuilderImpl (org.codice.ddf.cxf.client.impl.ClientBuilderImpl)1 OAuthSecurity (org.codice.ddf.cxf.oauth.OAuthSecurity)1 SamlSecurity (org.codice.ddf.security.jaxrs.SamlSecurity)1 Before (org.junit.Before)1