Package org.jclouds.rest.internal.BaseRestApiTest

Examples of org.jclouds.rest.internal.BaseRestApiTest.MockModule


    */
   @BeforeClass
   protected void createFilter() throws IOException {

      Injector injector = ContextBuilder.newBuilder(new ChefApiMetadata()).credentials(USER_ID, PRIVATE_KEY)
            .modules(ImmutableSet.<Module> of(new MockModule(), new NullLoggingModule())).buildInjector();

      HttpUtils utils = injector.getInstance(HttpUtils.class);

      Supplier<PrivateKey> privateKey = injector.getInstance(Key.get(new TypeLiteral<Supplier<PrivateKey>>() {
      }));
View Full Code Here


   @BeforeClass
   public void setup() {
      Injector injector = ContextBuilder.newBuilder(new ChefApiMetadata())
            .credentials(SignedHeaderAuthTest.USER_ID, SignedHeaderAuthTest.PRIVATE_KEY)
            .modules(ImmutableSet.<Module> of(new MockModule(), new NullLoggingModule())).buildInjector();

      chefService = injector.getInstance(BaseChefService.class);
   }
View Full Code Here

@Test(groups = "unit", testName = "RequestAuthorizeSignatureWithSessionCredentialsTest")
public class RequestAuthorizeSignatureWithSessionCredentialsTest {
   public static Injector injector(Credentials creds) {
      return ContextBuilder.newBuilder("s3")
            .credentialsSupplier(Suppliers.<Credentials> ofInstance(creds))
            .modules(ImmutableList.<Module> of(new MockModule(), new NullLoggingModule(), new TestS3RestClientModule())).buildInjector();
   }
View Full Code Here

   @BeforeClass
   public void setup() {
      Injector injector = ContextBuilder.newBuilder(new ChefApiMetadata())
            .credentials(SignedHeaderAuthTest.USER_ID, SignedHeaderAuthTest.PRIVATE_KEY)
            .modules(ImmutableSet.<Module> of(new MockModule(), new NullLoggingModule())).buildInjector();

      chefService = injector.getInstance(BaseChefService.class);
   }
View Full Code Here

                        .forClientMappedToAsyncClient(IntegrationTestClient.class, IntegrationTestAsyncClient.class)
                        .toBuilder().build())
            .endpoint("https://${jclouds.identity}.blob.core.windows.net")
            .credentials(ACCOUNT, "credential")
            .modules(
                  ImmutableSet.<Module> of(new MockModule(), new NullLoggingModule(),
                        new AzureStorageRestClientModule<IntegrationTestClient, IntegrationTestAsyncClient>(
                              typeToken(IntegrationTestClient.class), typeToken(IntegrationTestAsyncClient.class))))
            .buildInjector();
      filter = injector.getInstance(SharedKeyLiteAuthentication.class);
   }
View Full Code Here

               new BindProviderMetadataContextAndCredentials(md, ofInstance(new Credentials("user", "pass"))),
               new BindRestContextWithWildcardExtendsExplicitAndRawType(RestApiMetadata.class.cast(md
                                 .getApiMetadata())),
                                
               // stuff needed for RestContextImpl
               new MockModule(),
               new AbstractModule() {
                 
                  @Override
                  protected void configure() {
                     bind(Utils.class).toInstance(createMock(Utils.class));
View Full Code Here

      return Guice.createInjector(new BindNameToContext("test"), new BindProviderMetadataContextAndCredentials(md,
            ofInstance(new Credentials("user", "pass"))), new BindApiContextWithWildcardExtendsExplicitAndRawType(
            HttpApiMetadata.class.cast(md.getApiMetadata())),

            // stuff needed for ApiContextImpl
            new MockModule(), new AbstractModule() {

               @Override
               protected void configure() {
                  bind(Utils.class).toInstance(createMock(Utils.class));
                  bind(IntegrationTestClient.class).toInstance(createMock(IntegrationTestClient.class));
View Full Code Here

@Test(groups = "unit", testName = "RequestAuthorizeSignatureWithSessionCredentialsTest")
public class RequestAuthorizeSignatureWithSessionCredentialsTest {
   public static Injector injector(Credentials creds) {
      return ContextBuilder.newBuilder("s3")
            .credentialsSupplier(Suppliers.<Credentials> ofInstance(creds))
            .modules(ImmutableList.<Module> of(new MockModule(), new NullLoggingModule(), new TestS3RestClientModule())).buildInjector();
   }
View Full Code Here

   protected void createFilter() {
      Injector injector = ContextBuilder
            .newBuilder("atmos")
            .credentials(UID, KEY)
            .modules(
                  ImmutableSet.<Module> of(new MockModule(), new TestAtmosRestClientModule(), new NullLoggingModule()))
            .buildInjector();

      filter = injector.getInstance(SignRequest.class);

   }
View Full Code Here

   Injector createInjector() {
      return ContextBuilder
            .newBuilder(new AtmosApiMetadata())
            .credentials("uid", "key")
            .modules(
                  ImmutableSet.<Module> of(new MockModule(),new NullLoggingModule()))
            .buildInjector();
   }
View Full Code Here

TOP

Related Classes of org.jclouds.rest.internal.BaseRestApiTest.MockModule

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.