test_class.declarator: s_logger = LoggerFactory.getLogger(CreateUserCmdTest.class.getName())
test_class.modifier: public static final
test_class.original_string: public static final Logger s_logger = LoggerFactory.getLogger(CreateUserCmdTest.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: createUserCmd = new CreateUserCmd()
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private CreateUserCmd createUserCmd = new CreateUserCmd();
test_class.type: CreateUserCmd
test_class.var_name: createUserCmd
test_class.file: api/src/test/java/org/apache/cloudstack/api/command/admin/user/CreateUserCmdTest.java
test_class.identifier: CreateUserCmdTest
test_case.body: @Test
      public void testExecuteWithNotBlankPassword() {
          ReflectionTestUtils.setField(createUserCmd, "password", "Test");
          try {
              createUserCmd.execute();
          } catch (ServerApiException e) {
              Assert.assertTrue("Received exception as the mock accountService createUser returns null user", true);
          }
          Mockito.verify(accountService, Mockito.times(1)).createUser(null, "Test", null, null, null, null, null, null, null);
      }
test_case.class_method_signature: CreateUserCmdTest.testExecuteWithNotBlankPassword()
test_case.full_signature: @Test public void testExecuteWithNotBlankPassword()
test_case.identifier: testExecuteWithNotBlankPassword
test_case.invocations: setField execute assertTrue createUser verify times
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testExecuteWithNotBlankPassword()
focal_class.declarator: s_logger = LoggerFactory.getLogger(CreateUserCmd.class.getName())
focal_class.modifier: public static final
focal_class.original_string: public static final Logger s_logger = LoggerFactory.getLogger(CreateUserCmd.class.getName());
focal_class.type: Logger
focal_class.var_name: s_logger
focal_class.declarator: s_name = "createuserresponse"
focal_class.modifier: private static final
focal_class.original_string: private static final String s_name = "createuserresponse";
focal_class.type: String
focal_class.var_name: s_name
focal_class.declarator: accountName
focal_class.modifier: @Parameter(name = ApiConstants.ACCOUNT,
                 type = CommandType.STRING,
                 required = true,
                 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,
                 required = true,
                 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: domainId
focal_class.modifier: @Parameter(name = ApiConstants.DOMAIN_ID,
                 type = CommandType.UUID,
                 entityType = DomainResponse.class,
                 description = "Creates the user under the specified domain. Has to be accompanied with the account parameter")
      private
focal_class.original_string: @Parameter(name = ApiConstants.DOMAIN_ID,
                 type = CommandType.UUID,
                 entityType = DomainResponse.class,
                 description = "Creates the user under the specified domain. Has to be accompanied with the account parameter")
      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: 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: api/src/main/java/org/apache/cloudstack/api/command/admin/user/CreateUserCmd.java
focal_class.identifier: CreateUserCmd
focal_class.class_method_signature: CreateUserCmd.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: CreateUserCmd.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: CreateUserCmd.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: CreateUserCmd.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: CreateUserCmd.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: CreateUserCmd.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: CreateUserCmd.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: CreateUserCmd.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: CreateUserCmd.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.class_method_signature: CreateUserCmd.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: CreateUserCmd.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: CreateUserCmd.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: CreateUserCmd.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.superclass: extends BaseCmd
focal_method.body: @Override
      public void execute() {
          validateParams();
          CallContext.current().setEventDetails("UserName: " + getUserName() + ", FirstName :" + getFirstName() + ", LastName: " + getLastName());
          User user =
              _accountService.createUser(getUserName(), getPassword(), getFirstName(), getLastName(), getEmail(), getTimezone(), getAccountName(), getDomainId(),
                  getUserUUID());
          if (user != null) {
              UserResponse response = _responseGenerator.createUserResponse(user);
              response.setResponseName(getCommandName());
              this.setResponseObject(response);
          } else {
              throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to create a user");
          }
      }
focal_method.class_method_signature: CreateUserCmd.execute()
focal_method.full_signature: @Override public void execute()
focal_method.identifier: execute
focal_method.invocations: validateParams setEventDetails current getUserName getFirstName getLastName createUser getUserName getPassword getFirstName getLastName getEmail getTimezone getAccountName getDomainId getUserUUID createUserResponse setResponseName getCommandName setResponseObject
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void execute()