Skip to content

Commit ac17a77

Browse files
review changes
1 parent 7c028f4 commit ac17a77

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

api/src/main/java/org/apache/cloudstack/api/command/user/job/ListAsyncJobsCmd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ public class ListAsyncJobsCmd extends BaseListAccountResourcesCmd {
4141
@Parameter(name = ApiConstants.MANAGEMENT_SERVER_ID, type = CommandType.UUID, entityType = ManagementServerResponse.class, description = "The id of the management server", since="4.19")
4242
private Long managementServerId;
4343

44-
@Parameter(name = ApiConstants.RESOURCE_ID, validations = {ApiArgValidator.UuidString}, type = CommandType.STRING, description = "the ID of the resource associated with the event", since="4.22.1")
44+
@Parameter(name = ApiConstants.RESOURCE_ID, validations = {ApiArgValidator.UuidString}, type = CommandType.STRING, description = "the ID of the resource associated with the job", since="4.22.1")
4545
private String resourceId;
4646

47-
@Parameter(name = ApiConstants.RESOURCE_TYPE, type = CommandType.STRING, description = "the type of the resource associated with the event", since="4.22.1")
47+
@Parameter(name = ApiConstants.RESOURCE_TYPE, type = CommandType.STRING, description = "the type of the resource associated with the job", since="4.22.1")
4848
private String resourceType;
4949

5050
/////////////////////////////////////////////////////

api/src/main/java/org/apache/cloudstack/api/command/user/job/QueryAsyncJobResultCmd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ public class QueryAsyncJobResultCmd extends BaseCmd {
3737
@Parameter(name = ApiConstants.JOB_ID, type = CommandType.UUID, entityType = AsyncJobResponse.class, description = "The ID of the asynchronous job")
3838
private Long id;
3939

40-
@Parameter(name = ApiConstants.RESOURCE_ID, validations = {ApiArgValidator.UuidString}, type = CommandType.STRING, description = "the ID of the resource associated with the event", since="4.22.1")
40+
@Parameter(name = ApiConstants.RESOURCE_ID, validations = {ApiArgValidator.UuidString}, type = CommandType.STRING, description = "the ID of the resource associated with the job", since="4.22.1")
4141
private String resourceId;
4242

43-
@Parameter(name = ApiConstants.RESOURCE_TYPE, type = CommandType.STRING, description = "the type of the resource associated with the event", since="4.22.1")
43+
@Parameter(name = ApiConstants.RESOURCE_TYPE, type = CommandType.STRING, description = "the type of the resource associated with the job", since="4.22.1")
4444
private String resourceType;
4545

4646
/////////////////////////////////////////////////////

server/src/main/java/com/cloud/api/ApiResponseHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2315,7 +2315,7 @@ public AsyncJobResponse queryJobResult(final QueryAsyncJobResultCmd cmd) {
23152315

23162316
Long resourceId = getResourceId(resourceType, cmd.getResourceId());
23172317
Long jobId = cmd.getId();
2318-
if(jobId == null && resourceId == null) {
2318+
if (jobId == null && resourceId == null) {
23192319
throw new InvalidParameterValueException("Expected parameter job id or parameters resource type and resource id");
23202320
}
23212321

server/src/test/java/com/cloud/api/query/QueryManagerImplTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ public void searchForEventsFailResourceTypeInvalid() {
267267
public void searchForEventsFailResourceIdInvalid() {
268268
ListEventsCmd cmd = setupMockListEventsCmd();
269269
Mockito.when(cmd.getResourceId()).thenReturn("random");
270-
Mockito.when(cmd.getResourceType()).thenReturn(ApiCommandResourceType.VirtualMachine.toString());
270+
Mockito.lenient().when(cmd.getResourceType()).thenReturn(ApiCommandResourceType.VirtualMachine.toString());
271271
queryManager.searchForEvents(cmd);
272272
}
273273

0 commit comments

Comments
 (0)