Package org.jclouds.joyent.cloudapi.v6_5.features

Examples of org.jclouds.joyent.cloudapi.v6_5.features.KeyApi.create()


      KeyApi keyApi = createMock(KeyApi.class);
      Key key = Key.builder().name("group-foo").key(keyPair.get("public")).build();

      expect(cloudApiApi.getKeyApi()).andReturn(keyApi);

      expect(keyApi.create(key)).andReturn(key);

      replay(cloudApiApi, keyApi);

      CreateUniqueKey parser = new CreateUniqueKey(cloudApiApi, namingConvention, sshKeyPairGenerator);
View Full Code Here


      KeyApi keyApi = createMock(KeyApi.class);
      Key key = Key.builder().name("group-foo").key(keyPair.get("public")).build();

      expect(cloudApiApi.getKeyApi()).andReturn(keyApi);

      expect(keyApi.create(key)).andReturn(key);

      replay(cloudApiApi, keyApi);

      CreateUniqueKey parser = new CreateUniqueKey(cloudApiApi, namingConvention, sshKeyPairGenerator);
View Full Code Here

   }

   public void testCreateKey() {
      KeyApi api = cloudApiContext.getApi().getKeyApi();

      Key newKey = api.create(Key.builder().name(fingerprint).key(keyText).build());
      assertEquals(newKey.getName(), fingerprint);
      assertEquals(newKey.get(), keyText);

      newKey = api.get(fingerprint);
      assertEquals(newKey.getName(), fingerprint);
View Full Code Here

   }

   @Test(dependsOnMethods = "testCreateKey", expectedExceptions = IllegalStateException.class)
   public void testDuplicateKey() {
      KeyApi api = cloudApiContext.getApi().getKeyApi();
      api.create(Key.builder().name(fingerprint).key(keyText).build());
   }

   @Test(dependsOnMethods = "testDuplicateKey")
   public void testDestroyKey() {
      final KeyApi api = cloudApiContext.getApi().getKeyApi();
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.