test_class.declarator: volumeService
test_class.modifier: private
test_class.original_string: private VolumeApiService volumeService;
test_class.type: VolumeApiService
test_class.var_name: volumeService
test_class.declarator: responseGenerator
test_class.modifier: private
test_class.original_string: private ResponseGenerator responseGenerator;
test_class.type: ResponseGenerator
test_class.var_name: responseGenerator
test_class.declarator: updateVolumeCmd
test_class.modifier: private
test_class.original_string: private UpdateVolumeCmd updateVolumeCmd;
test_class.type: UpdateVolumeCmd
test_class.var_name: updateVolumeCmd
test_class.file: cosmic-core/api/src/test/java/com/cloud/api/command/user/volume/UpdateVolumeCmdTest.java
test_class.identifier: UpdateVolumeCmdTest
test_case.body: @Test(expected = ServerApiException.class)
      public void testUpdateFailure() {
          final Volume volume = Mockito.mock(Volume.class);
  
          updateVolumeCmd._volumeService = volumeService;
          updateVolumeCmd._responseGenerator = responseGenerator;
  
          Mockito.when(volume.getAccountId()).thenReturn(1L);
          Mockito.when(responseGenerator.findVolumeById(Mockito.anyLong())).thenReturn(volume);
          Mockito.when(volumeService.updateVolume(Mockito.eq(1L), Mockito.anyString(), Mockito.anyString(), Mockito.anyString(), Mockito.anyLong(), Mockito.anyBoolean(), Mockito.anyString(), Mockito.eq(1L), Mockito.anyString(), Mockito.any(DiskControllerType.class))).thenReturn(null);
  
          updateVolumeCmd.execute();
      }
test_case.class_method_signature: UpdateVolumeCmdTest.testUpdateFailure()
test_case.full_signature: @Test(expected = ServerApiException.class) public void testUpdateFailure()
test_case.identifier: testUpdateFailure
test_case.invocations: mock thenReturn when getAccountId thenReturn when findVolumeById anyLong thenReturn when updateVolume eq anyString anyString anyString anyLong anyBoolean anyString eq anyString any execute
test_case.modifiers: @Test(expected = ServerApiException.class) public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testUpdateFailure()
focal_class.declarator: s_logger = LoggerFactory.getLogger(UpdateVolumeCmd.class.getName())
focal_class.modifier: public static final
focal_class.original_string: public static final Logger s_logger = LoggerFactory.getLogger(UpdateVolumeCmd.class.getName());
focal_class.type: Logger
focal_class.var_name: s_logger
focal_class.declarator: s_name = "updatevolumeresponse"
focal_class.modifier: private static final
focal_class.original_string: private static final String s_name = "updatevolumeresponse";
focal_class.type: String
focal_class.var_name: s_name
focal_class.declarator: id
focal_class.modifier: @ACL(accessType = AccessType.OperateEntry)
      @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = VolumeResponse.class, description = "the ID of the disk volume")
      private
focal_class.original_string: @ACL(accessType = AccessType.OperateEntry)
      @Parameter(name = ApiConstants.ID, type = CommandType.UUID, entityType = VolumeResponse.class, description = "the ID of the disk volume")
      private Long id;
focal_class.type: Long
focal_class.var_name: id
focal_class.declarator: path
focal_class.modifier: @Parameter(name = ApiConstants.PATH, type = CommandType.STRING, description = "The path of the volume")
      private
focal_class.original_string: @Parameter(name = ApiConstants.PATH, type = CommandType.STRING, description = "The path of the volume")
      private String path;
focal_class.type: String
focal_class.var_name: path
focal_class.declarator: chainInfo
focal_class.modifier: @Parameter(name = ApiConstants.CHAIN_INFO,
              type = CommandType.STRING,
              description = "The chain info of the volume",
              since = "4.4")
      private
focal_class.original_string: @Parameter(name = ApiConstants.CHAIN_INFO,
              type = CommandType.STRING,
              description = "The chain info of the volume",
              since = "4.4")
      private String chainInfo;
focal_class.type: String
focal_class.var_name: chainInfo
focal_class.declarator: storageId
focal_class.modifier: @Parameter(name = ApiConstants.STORAGE_ID,
              type = CommandType.UUID,
              entityType = StoragePoolResponse.class,
              description = "Destination storage pool UUID for the volume",
              since = "4.3")
      private
focal_class.original_string: @Parameter(name = ApiConstants.STORAGE_ID,
              type = CommandType.UUID,
              entityType = StoragePoolResponse.class,
              description = "Destination storage pool UUID for the volume",
              since = "4.3")
      private Long storageId;
focal_class.type: Long
focal_class.var_name: storageId
focal_class.declarator: state
focal_class.modifier: @Parameter(name = ApiConstants.STATE, type = CommandType.STRING, description = "The state of the volume", since = "4.3")
      private
focal_class.original_string: @Parameter(name = ApiConstants.STATE, type = CommandType.STRING, description = "The state of the volume", since = "4.3")
      private String state;
focal_class.type: String
focal_class.var_name: state
focal_class.declarator: displayVolume
focal_class.modifier: @Parameter(name = ApiConstants.DISPLAY_VOLUME,
              type = CommandType.BOOLEAN,
              description = "an optional field, whether to the display the volume to the end user or not.", authorized = {RoleType.Admin})
      private
focal_class.original_string: @Parameter(name = ApiConstants.DISPLAY_VOLUME,
              type = CommandType.BOOLEAN,
              description = "an optional field, whether to the display the volume to the end user or not.", authorized = {RoleType.Admin})
      private Boolean displayVolume;
focal_class.type: Boolean
focal_class.var_name: displayVolume
focal_class.declarator: diskController
focal_class.modifier: @Parameter(name = ApiConstants.DISK_CONTROLLER,
              required = false,
              type = CommandType.STRING,
              description = "the disk controller to use. Either 'IDE', 'VIRTIO' or 'SCSI'")
      private
focal_class.original_string: @Parameter(name = ApiConstants.DISK_CONTROLLER,
              required = false,
              type = CommandType.STRING,
              description = "the disk controller to use. Either 'IDE', 'VIRTIO' or 'SCSI'")
      private String diskController;
focal_class.type: String
focal_class.var_name: diskController
focal_class.declarator: volumeName
focal_class.modifier: @Parameter(name = ApiConstants.NAME,
              required = false,
              type = CommandType.STRING,
              description = "the name of the disk volume")
      private
focal_class.original_string: @Parameter(name = ApiConstants.NAME,
              required = false,
              type = CommandType.STRING,
              description = "the name of the disk volume")
      private String volumeName;
focal_class.type: String
focal_class.var_name: volumeName
focal_class.file: cosmic-core/api/src/main/java/com/cloud/api/command/user/volume/UpdateVolumeCmd.java
focal_class.identifier: UpdateVolumeCmd
focal_class.class_method_signature: UpdateVolumeCmd.getEventType()
focal_class.full_signature: @Override public String getEventType()
focal_class.identifier: getEventType
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getEventType()
focal_class.class_method_signature: UpdateVolumeCmd.getEventDescription()
focal_class.full_signature: @Override public String getEventDescription()
focal_class.identifier: getEventDescription
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getEventDescription()
focal_class.class_method_signature: UpdateVolumeCmd.getInstanceId()
focal_class.full_signature: @Override public Long getInstanceId()
focal_class.identifier: getInstanceId
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: Long
focal_class.signature: Long getInstanceId()
focal_class.class_method_signature: UpdateVolumeCmd.getInstanceType()
focal_class.full_signature: @Override public ApiCommandJobType getInstanceType()
focal_class.identifier: getInstanceType
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: ApiCommandJobType
focal_class.signature: ApiCommandJobType getInstanceType()
focal_class.class_method_signature: UpdateVolumeCmd.getId()
focal_class.full_signature: public Long getId()
focal_class.identifier: getId
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Long
focal_class.signature: Long getId()
focal_class.class_method_signature: UpdateVolumeCmd.getPath()
focal_class.full_signature: public String getPath()
focal_class.identifier: getPath
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getPath()
focal_class.class_method_signature: UpdateVolumeCmd.getVolumeName()
focal_class.full_signature: public String getVolumeName()
focal_class.identifier: getVolumeName
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getVolumeName()
focal_class.class_method_signature: UpdateVolumeCmd.getStorageId()
focal_class.full_signature: public Long getStorageId()
focal_class.identifier: getStorageId
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Long
focal_class.signature: Long getStorageId()
focal_class.class_method_signature: UpdateVolumeCmd.getState()
focal_class.full_signature: public String getState()
focal_class.identifier: getState
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getState()
focal_class.class_method_signature: UpdateVolumeCmd.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: UpdateVolumeCmd.getDisplayVolume()
focal_class.full_signature: public Boolean getDisplayVolume()
focal_class.identifier: getDisplayVolume
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: Boolean
focal_class.signature: Boolean getDisplayVolume()
focal_class.class_method_signature: UpdateVolumeCmd.getChainInfo()
focal_class.full_signature: public String getChainInfo()
focal_class.identifier: getChainInfo
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getChainInfo()
focal_class.class_method_signature: UpdateVolumeCmd.getDiskController()
focal_class.full_signature: public DiskControllerType getDiskController()
focal_class.identifier: getDiskController
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: DiskControllerType
focal_class.signature: DiskControllerType getDiskController()
focal_class.class_method_signature: UpdateVolumeCmd.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: UpdateVolumeCmd.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: UpdateVolumeCmd.checkUuid()
focal_class.full_signature: @Override public void checkUuid()
focal_class.identifier: checkUuid
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void checkUuid()
focal_class.superclass: extends BaseAsyncCustomIdCmd
focal_method.body: @Override
      public void execute() {
          CallContext.current().setEventDetails("Volume Id: " + getId());
          final Volume result = _volumeService.updateVolume(getId(), getVolumeName(), getPath(), getState(), getStorageId(),
                  getDisplayVolume(), getCustomId(), getEntityOwnerId(), getChainInfo(), getDiskController());
          if (result != null) {
              final VolumeResponse response = _responseGenerator.createVolumeResponse(ResponseView.Restricted, result);
              response.setResponseName(getCommandName());
              setResponseObject(response);
          } else {
              throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to update volume");
          }
      }
focal_method.class_method_signature: UpdateVolumeCmd.execute()
focal_method.full_signature: @Override public void execute()
focal_method.identifier: execute
focal_method.invocations: setEventDetails current getId updateVolume getId getVolumeName getPath getState getStorageId getDisplayVolume getCustomId getEntityOwnerId getChainInfo getDiskController createVolumeResponse setResponseName getCommandName setResponseObject
focal_method.modifiers: @Override public
focal_method.parameters: ()
focal_method.return: void
focal_method.signature: void execute()