Package org.jclouds.rest.internal.BaseRestApiTest

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


      return ContextBuilder
            .newBuilder(
                  AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(IntegrationTestClient.class,
                        IntegrationTestAsyncClient.class, "http://localhost"))
            .credentialsSupplier(Suppliers.<Credentials> ofInstance(creds)).apiVersion("apiVersion")
            .modules(ImmutableList.<Module> of(new MockModule(), new NullLoggingModule(), new AbstractModule() {
               @Override
               protected void configure() {
                  bind(RequestSigner.class).to(FormSigner.class);
                  bind(String.class).annotatedWith(Names.named(PROPERTY_HEADER_TAG)).toInstance("amz");
                  bind(String.class).annotatedWith(TimeStamp.class).toInstance("2009-11-08T15:54:08.897Z");
View Full Code Here


      return ContextBuilder
            .newBuilder(
                  AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(IntegrationTestClient.class,
                        IntegrationTestAsyncClient.class, "http://localhost"))
            .credentialsSupplier(Suppliers.<Credentials> ofInstance(creds)).apiVersion("apiVersion")
            .modules(ImmutableList.<Module> of(new MockModule(), new NullLoggingModule(), new AbstractModule() {
               @Override
               protected void configure() {
                  bind(RequestSigner.class).to(FormSigner.class);
                  bind(String.class).annotatedWith(Names.named(PROPERTY_HEADER_TAG)).toInstance("amz");
                  bind(String.class).annotatedWith(TimeStamp.class).toInstance("2009-11-08T15:54:08.897Z");
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

               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

                        .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

      return ContextBuilder
            .newBuilder(
                  AnonymousProviderMetadata.forClientMappedToAsyncClientOnEndpoint(IntegrationTestClient.class,
                        IntegrationTestAsyncClient.class, "http://localhost"))
            .credentialsSupplier(Suppliers.<Credentials> ofInstance(creds)).apiVersion("apiVersion")
            .modules(ImmutableList.<Module> of(new MockModule(), new NullLoggingModule(), new AbstractModule() {
               @Override
               protected void configure() {
                  bind(RequestSigner.class).to(FormSigner.class);
                  bind(String.class).annotatedWith(Names.named(PROPERTY_HEADER_TAG)).toInstance("amz");
                  bind(String.class).annotatedWith(TimeStamp.class).toInstance("2009-11-08T15:54:08.897Z");
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

   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

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.