test_class.declarator: s_logger = LoggerFactory.getLogger(GetUserCmdTest.class.getName())
test_class.modifier: public static final
test_class.original_string: public static final Logger s_logger = LoggerFactory.getLogger(GetUserCmdTest.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: responseGenerator
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ResponseGenerator responseGenerator;
test_class.type: ResponseGenerator
test_class.var_name: responseGenerator
test_class.declarator: userAccount
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private UserAccount userAccount;
test_class.type: UserAccount
test_class.var_name: userAccount
test_class.declarator: getUserCmd = new GetUserCmd()
test_class.modifier: @InjectMocks
      private final
test_class.original_string: @InjectMocks
      private final GetUserCmd getUserCmd = new GetUserCmd();
test_class.type: GetUserCmd
test_class.var_name: getUserCmd
test_class.file: cosmic-core/api/src/test/java/com/cloud/api/command/admin/user/GetUserCmdTest.java
test_class.identifier: GetUserCmdTest
test_case.body: @Test
      public void testExecuteWithDefault() {
          final String secretKey = "Very secret key";
          UserResponse response = new UserResponse();
          response.setSecretKey(secretKey);
  
          when(accountService.getUserByApiKey(null)).thenReturn(userAccount);
          when(responseGenerator.createUserResponse(userAccount)).thenReturn(response);
  
          getUserCmd.execute();
  
          response = (UserResponse) getUserCmd.getResponseObject();
          assertFalse("SecretKey was revealed in ResponseObject, wasn't masked", secretKey.equals(response.getSecretKey()));
      }
test_case.class_method_signature: GetUserCmdTest.testExecuteWithDefault()
test_case.full_signature: @Test public void testExecuteWithDefault()
test_case.identifier: testExecuteWithDefault
test_case.invocations: setSecretKey thenReturn when getUserByApiKey thenReturn when createUserResponse execute getResponseObject assertFalse equals getSecretKey
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testExecuteWithDefault()
focal_class.declarator: s_logger = LoggerFactory.getLogger(GetUserCmd.class.getName())
focal_class.modifier: public static final
focal_class.original_string: public static final Logger s_logger = LoggerFactory.getLogger(GetUserCmd.class.getName());
focal_class.type: Logger
focal_class.var_name: s_logger
focal_class.declarator: s_name = "getuserresponse"
focal_class.modifier: private static final
focal_class.original_string: private static final String s_name = "getuserresponse";
focal_class.type: String
focal_class.var_name: s_name
focal_class.declarator: apiKey
focal_class.modifier: @Parameter(name = ApiConstants.USER_API_KEY, type = CommandType.STRING, required = true, description = "API key of the user")
      private
focal_class.original_string: @Parameter(name = ApiConstants.USER_API_KEY, type = CommandType.STRING, required = true, description = "API key of the user")
      private String apiKey;
focal_class.type: String
focal_class.var_name: apiKey
focal_class.file: cosmic-core/api/src/main/java/com/cloud/api/command/admin/user/GetUserCmd.java
focal_class.identifier: GetUserCmd
focal_class.class_method_signature: GetUserCmd.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: GetUserCmd.getApiKey()
focal_class.full_signature: public String getApiKey()
focal_class.identifier: getApiKey
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getApiKey()
focal_class.class_method_signature: GetUserCmd.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: GetUserCmd.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.superclass: extends BaseCmd
focal_method.body: @Override
      public void execute() {
          final UserAccount result = _accountService.getUserByApiKey(getApiKey());
          if (result != null) {
              final UserResponse response = _responseGenerator.createUserResponse(result);
              if (StringUtils.isNotBlank(response.getSecretKey())) {
                  response.setSecretKey("SecretKey only visible when generating a new key");
              }
              response.setResponseName(getCommandName());
              this.setResponseObject(response);
          } else {
              throw new InvalidParameterValueException("User with specified API key does not exist");
          }
      }
focal_method.class_method_signature: GetUserCmd.execute()
focal_method.full_signature: @Override public void execute()
focal_method.identifier: execute
focal_method.invocations: getUserByApiKey getApiKey createUserResponse isNotBlank getSecretKey setSecretKey setResponseName getCommandName setResponseObject
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void execute()