Tabnine Logo
ApiKeyPairs
Code IndexAdd Tabnine to your IDE (free)

How to use
ApiKeyPairs
in
org.jclouds.cloudstack.util

Best Java code snippets using org.jclouds.cloudstack.util.ApiKeyPairs (Showing top 4 results out of 315)

origin: jclouds/legacy-jclouds

@Test(expectedExceptions = AuthorizationException.class)
public void testTryToGetApiKeypairWithWrongCredentials() {
 ApiKeyPairs.loginToEndpointAsUsernameInDomainWithPasswordAndReturnApiKeyPair(
   URI.create(endpoint), "dummy-missing-user", "with-a-wrong-password", "");
}
origin: apache/jclouds

@Test(expectedExceptions = AuthorizationException.class)
public void testTryToGetApiKeypairWithWrongCredentials() {
 ApiKeyPairs.loginToEndpointAsUsernameInDomainWithPasswordAndReturnApiKeyPair(
   URI.create(endpoint), "dummy-missing-user", "with-a-wrong-password", "");
}
origin: jclouds/legacy-jclouds

@Test
public void testCreateContextUsingUserAndPasswordAuthentication() {
 skipIfNotGlobalAdmin();
 Account testAccount = null;
 User testUser = null;
 String prefix = this.prefix + "-session";
 try {
   testAccount = createTestAccount(globalAdminClient, prefix);
   testUser = createTestUser(globalAdminClient, testAccount, prefix);
   String expectedUsername = prefix + "-user";
   assertEquals(testUser.getName(), expectedUsername);
   checkLoginAsTheNewUser(expectedUsername);
   ApiKeyPair expected = globalAdminClient.getUserClient().registerUserKeys(testUser.getId());
   ApiKeyPair actual = ApiKeyPairs.loginToEndpointAsUsernameInDomainWithPasswordAndReturnApiKeyPair(
    URI.create(endpoint), prefix + "-user", "password", "");
   assertEquals(actual, expected);
 } finally {
   if (testUser != null)
    globalAdminClient.getUserClient().deleteUser(testUser.getId());
   if (testAccount != null)
    globalAdminClient.getAccountClient().deleteAccount(testAccount.getId());
 }
}
origin: apache/jclouds

@Test
public void testCreateContextUsingUserAndPasswordAuthentication() {
 skipIfNotGlobalAdmin();
 Account testAccount = null;
 User testUser = null;
 String prefix = this.prefix + "-session";
 try {
   testAccount = createTestAccount(globalAdminClient, prefix);
   testUser = createTestUser(globalAdminClient, testAccount, prefix);
   String expectedUsername = prefix + "-user";
   assertEquals(testUser.getName(), expectedUsername);
   checkLoginAsTheNewUser(expectedUsername);
   ApiKeyPair expected = globalAdminClient.getUserClient().registerUserKeys(testUser.getId());
   ApiKeyPair actual = ApiKeyPairs.loginToEndpointAsUsernameInDomainWithPasswordAndReturnApiKeyPair(
    URI.create(endpoint), prefix + "-user", "password", "");
   assertEquals(actual, expected);
 } finally {
   if (testUser != null)
    globalAdminClient.getUserClient().deleteUser(testUser.getId());
   if (testAccount != null)
    globalAdminClient.getAccountApi().deleteAccount(testAccount.getId());
 }
}
org.jclouds.cloudstack.utilApiKeyPairs

Most used methods

  • loginToEndpointAsUsernameInDomainWithPasswordAndReturnApiKeyPair
    Retrieve the API key pair for a given CloudStack user

Popular in Java

  • Reactive rest calls using spring rest template
  • notifyDataSetChanged (ArrayAdapter)
  • getSharedPreferences (Context)
  • getResourceAsStream (ClassLoader)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Permission (java.security)
    Legacy security code; do not use.
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • JLabel (javax.swing)
  • JOptionPane (javax.swing)
  • IsNull (org.hamcrest.core)
    Is the value null?
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now