test_class.declarator: s_logger = LoggerFactory.getLogger(CreateAccountCmdTest.class.getName())
test_class.modifier: public static final
test_class.original_string: public static final Logger s_logger = LoggerFactory.getLogger(CreateAccountCmdTest.class.getName());
test_class.type: Logger
test_class.var_name: s_logger
test_class.declarator: accountService
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private AccountService accountService;
test_class.type: AccountService
test_class.var_name: accountService
test_class.declarator: createAccountCmd = new CreateAccountCmd()
test_class.modifier: @InjectMocks
      private final
test_class.original_string: @InjectMocks
      private final CreateAccountCmd createAccountCmd = new CreateAccountCmd();
test_class.type: CreateAccountCmd
test_class.var_name: createAccountCmd
test_class.declarator: accountType = 1
test_class.modifier: private final
test_class.original_string: private final short accountType = 1;
test_class.type: short
test_class.var_name: accountType
test_class.declarator: domainId = 1L
test_class.modifier: private final
test_class.original_string: private final Long domainId = 1L;
test_class.type: Long
test_class.var_name: domainId
test_class.file: cosmic-core/api/src/test/java/com/cloud/api/command/admin/account/CreateAccountCmdTest.java
test_class.identifier: CreateAccountCmdTest
test_case.body: @Test
      public void testExecuteWithNullPassword() {
          ReflectionTestUtils.setField(createAccountCmd, "password", null);
          try {
              createAccountCmd.execute();
              Assert.fail("should throw exception for a null password");
          } catch (final ServerApiException e) {
              Assert.assertEquals(ApiErrorCode.PARAM_ERROR, e.getErrorCode());
              Assert.assertEquals("Empty passwords are not allowed", e.getMessage());
          }
          Mockito.verify(accountService, Mockito.never()).createUserAccount(null, null, null, null, null, null, null, accountType, domainId, null, null, null, null);
      }
test_case.class_method_signature: CreateAccountCmdTest.testExecuteWithNullPassword()
test_case.full_signature: @Test public void testExecuteWithNullPassword()
test_case.identifier: testExecuteWithNullPassword
test_case.invocations: setField execute fail assertEquals getErrorCode assertEquals getMessage createUserAccount verify never
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testExecuteWithNullPassword()
focal_class.declarator: s_logger = LoggerFactory.getLogger(CreateAccountCmd.class.getName())
focal_class.modifier: public static final
focal_class.original_string: public static final Logger s_logger = LoggerFactory.getLogger(CreateAccountCmd.class.getName());
focal_class.type: Logger
focal_class.var_name: s_logger
focal_class.declarator: s_name = "createaccountresponse"
focal_class.modifier: private static final
focal_class.original_string: private static final String s_name = "createaccountresponse";
focal_class.type: String
focal_class.var_name: s_name
focal_class.declarator: accountName
focal_class.modifier: @Parameter(name = ApiConstants.ACCOUNT,
              type = CommandType.STRING,
              description = "Creates the user under the specified account. If no account is specified, the username will be used as the account name.")
      private
focal_class.original_string: @Parameter(name = ApiConstants.ACCOUNT,
              type = CommandType.STRING,
              description = "Creates the user under the specified account. If no account is specified, the username will be used as the account name.")
      private String accountName;
focal_class.type: String
focal_class.var_name: accountName
focal_class.declarator: accountType
focal_class.modifier: @Parameter(name = ApiConstants.ACCOUNT_TYPE,
              type = CommandType.SHORT,
              required = true,
              description = "Type of the account.  Specify 0 for user, 1 for root admin, and 2 for domain admin")
      private
focal_class.original_string: @Parameter(name = ApiConstants.ACCOUNT_TYPE,
              type = CommandType.SHORT,
              required = true,
              description = "Type of the account.  Specify 0 for user, 1 for root admin, and 2 for domain admin")
      private Short accountType;
focal_class.type: Short
focal_class.var_name: accountType
focal_class.declarator: domainId
focal_class.modifier: @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, entityType = DomainResponse.class, description = "Creates the user under the specified domain.")
      private
focal_class.original_string: @Parameter(name = ApiConstants.DOMAIN_ID, type = CommandType.UUID, entityType = DomainResponse.class, description = "Creates the user under the specified domain.")
      private Long domainId;
focal_class.type: Long
focal_class.var_name: domainId
focal_class.declarator: email
focal_class.modifier: @Parameter(name = ApiConstants.EMAIL, type = CommandType.STRING, required = true, description = "email")
      private
focal_class.original_string: @Parameter(name = ApiConstants.EMAIL, type = CommandType.STRING, required = true, description = "email")
      private String email;
focal_class.type: String
focal_class.var_name: email
focal_class.declarator: firstName
focal_class.modifier: @Parameter(name = ApiConstants.FIRSTNAME, type = CommandType.STRING, required = true, description = "firstname")
      private
focal_class.original_string: @Parameter(name = ApiConstants.FIRSTNAME, type = CommandType.STRING, required = true, description = "firstname")
      private String firstName;
focal_class.type: String
focal_class.var_name: firstName
focal_class.declarator: lastName
focal_class.modifier: @Parameter(name = ApiConstants.LASTNAME, type = CommandType.STRING, required = true, description = "lastname")
      private
focal_class.original_string: @Parameter(name = ApiConstants.LASTNAME, type = CommandType.STRING, required = true, description = "lastname")
      private String lastName;
focal_class.type: String
focal_class.var_name: lastName
focal_class.declarator: password
focal_class.modifier: @Parameter(name = ApiConstants.PASSWORD,
              type = CommandType.STRING,
              required = true,
              description = "Clear text password (Default hashed to SHA256SALT). If you wish to use any other hashing algorithm, you would need to write a custom authentication " +
                      "adapter See Docs section.")
      private
focal_class.original_string: @Parameter(name = ApiConstants.PASSWORD,
              type = CommandType.STRING,
              required = true,
              description = "Clear text password (Default hashed to SHA256SALT). If you wish to use any other hashing algorithm, you would need to write a custom authentication " +
                      "adapter See Docs section.")
      private String password;
focal_class.type: String
focal_class.var_name: password
focal_class.declarator: timeZone
focal_class.modifier: @Parameter(name = ApiConstants.TIMEZONE,
              type = CommandType.STRING,
              description = "Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.")
      private
focal_class.original_string: @Parameter(name = ApiConstants.TIMEZONE,
              type = CommandType.STRING,
              description = "Specifies a timezone for this command. For more information on the timezone parameter, see Time Zone Format.")
      private String timeZone;
focal_class.type: String
focal_class.var_name: timeZone
focal_class.declarator: userName
focal_class.modifier: @Parameter(name = ApiConstants.USERNAME, type = CommandType.STRING, required = true, description = "Unique username.")
      private
focal_class.original_string: @Parameter(name = ApiConstants.USERNAME, type = CommandType.STRING, required = true, description = "Unique username.")
      private String userName;
focal_class.type: String
focal_class.var_name: userName
focal_class.declarator: networkDomain
focal_class.modifier: @Parameter(name = ApiConstants.NETWORK_DOMAIN, type = CommandType.STRING, description = "Network domain for the account's networks")
      private
focal_class.original_string: @Parameter(name = ApiConstants.NETWORK_DOMAIN, type = CommandType.STRING, description = "Network domain for the account's networks")
      private String networkDomain;
focal_class.type: String
focal_class.var_name: networkDomain
focal_class.declarator: details
focal_class.modifier: @Parameter(name = ApiConstants.ACCOUNT_DETAILS, type = CommandType.MAP, description = "details for account used to store specific parameters")
      private
focal_class.original_string: @Parameter(name = ApiConstants.ACCOUNT_DETAILS, type = CommandType.MAP, description = "details for account used to store specific parameters")
      private Map<String, String> details;
focal_class.type: Map<String, String>
focal_class.var_name: details
focal_class.declarator: accountUUID
focal_class.modifier: @Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.STRING, description = "Account UUID, required for adding account from external provisioning system")
      private
focal_class.original_string: @Parameter(name = ApiConstants.ACCOUNT_ID, type = CommandType.STRING, description = "Account UUID, required for adding account from external provisioning system")
      private String accountUUID;
focal_class.type: String
focal_class.var_name: accountUUID
focal_class.declarator: userUUID
focal_class.modifier: @Parameter(name = ApiConstants.USER_ID, type = CommandType.STRING, description = "User UUID, required for adding account from external provisioning system")
      private
focal_class.original_string: @Parameter(name = ApiConstants.USER_ID, type = CommandType.STRING, description = "User UUID, required for adding account from external provisioning system")
      private String userUUID;
focal_class.type: String
focal_class.var_name: userUUID
focal_class.file: cosmic-core/api/src/main/java/com/cloud/api/command/admin/account/CreateAccountCmd.java
focal_class.identifier: CreateAccountCmd
focal_class.class_method_signature: CreateAccountCmd.execute()
focal_class.full_signature: @Override public void execute()
focal_class.identifier: execute
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void execute()
focal_class.class_method_signature: CreateAccountCmd.getCommandName()
focal_class.full_signature: @Override public String getCommandName()
focal_class.identifier: getCommandName
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getCommandName()
focal_class.class_method_signature: CreateAccountCmd.getEntityOwnerId()
focal_class.full_signature: @Override public long getEntityOwnerId()
focal_class.identifier: getEntityOwnerId
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: long
focal_class.signature: long getEntityOwnerId()
focal_class.class_method_signature: CreateAccountCmd.validateParams()
focal_class.full_signature: private void validateParams()
focal_class.identifier: validateParams
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void validateParams()
focal_class.class_method_signature: CreateAccountCmd.getAccountName()
focal_class.full_signature: public String getAccountName()
focal_class.identifier: getAccountName
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getAccountName()
focal_class.class_method_signature: CreateAccountCmd.getDomainId()
focal_class.full_signature: public Long getDomainId()
focal_class.identifier: getDomainId
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Long
focal_class.signature: Long getDomainId()
focal_class.class_method_signature: CreateAccountCmd.getUsername()
focal_class.full_signature: public String getUsername()
focal_class.identifier: getUsername
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getUsername()
focal_class.class_method_signature: CreateAccountCmd.getPassword()
focal_class.full_signature: public String getPassword()
focal_class.identifier: getPassword
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getPassword()
focal_class.class_method_signature: CreateAccountCmd.getFirstName()
focal_class.full_signature: public String getFirstName()
focal_class.identifier: getFirstName
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getFirstName()
focal_class.class_method_signature: CreateAccountCmd.getLastName()
focal_class.full_signature: public String getLastName()
focal_class.identifier: getLastName
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getLastName()
focal_class.class_method_signature: CreateAccountCmd.getEmail()
focal_class.full_signature: public String getEmail()
focal_class.identifier: getEmail
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getEmail()
focal_class.class_method_signature: CreateAccountCmd.getTimeZone()
focal_class.full_signature: public String getTimeZone()
focal_class.identifier: getTimeZone
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getTimeZone()
focal_class.class_method_signature: CreateAccountCmd.getAccountType()
focal_class.full_signature: public Short getAccountType()
focal_class.identifier: getAccountType
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Short
focal_class.signature: Short getAccountType()
focal_class.class_method_signature: CreateAccountCmd.getNetworkDomain()
focal_class.full_signature: public String getNetworkDomain()
focal_class.identifier: getNetworkDomain
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getNetworkDomain()
focal_class.class_method_signature: CreateAccountCmd.getDetails()
focal_class.full_signature: public Map<String, String> getDetails()
focal_class.identifier: getDetails
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Map<String, String>
focal_class.signature: Map<String, String> getDetails()
focal_class.class_method_signature: CreateAccountCmd.getAccountUUID()
focal_class.full_signature: public String getAccountUUID()
focal_class.identifier: getAccountUUID
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getAccountUUID()
focal_class.class_method_signature: CreateAccountCmd.getUserUUID()
focal_class.full_signature: public String getUserUUID()
focal_class.identifier: getUserUUID
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getUserUUID()
focal_class.superclass: extends BaseCmd
focal_method.body: @Override
      public void execute() {
          validateParams();
          CallContext.current().setEventDetails("Account Name: " + getAccountName() + ", Domain Id:" + getDomainId());
          final UserAccount userAccount =
                  _accountService.createUserAccount(getUsername(), getPassword(), getFirstName(), getLastName(), getEmail(), getTimeZone(), getAccountName(), getAccountType(),
                          getDomainId(), getNetworkDomain(), getDetails(), getAccountUUID(), getUserUUID());
          if (userAccount != null) {
              final AccountResponse response = _responseGenerator.createUserAccountResponse(ResponseView.Full, userAccount);
              response.setResponseName(getCommandName());
              setResponseObject(response);
          } else {
              throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create a user account");
          }
      }
focal_method.class_method_signature: CreateAccountCmd.execute()
focal_method.full_signature: @Override public void execute()
focal_method.identifier: execute
focal_method.invocations: validateParams setEventDetails current getAccountName getDomainId createUserAccount getUsername getPassword getFirstName getLastName getEmail getTimeZone getAccountName getAccountType getDomainId getNetworkDomain getDetails getAccountUUID getUserUUID createUserAccountResponse setResponseName getCommandName setResponseObject
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void execute()