From 3d1d12092d02a9a051f01e4596c1e54a4f472e4d Mon Sep 17 00:00:00 2001 From: mabofu Date: Thu, 27 Mar 2025 19:19:10 +0800 Subject: [PATCH] Fixed sonar issue: fixed CreateStoragePoolRequest issue --- .../dsms/modules/storagepool/task/CreateStoragePoolTask.java | 2 +- .../com/dsms/dfsbroker/storagepool/api/StoragePoolApiTest.java | 2 +- .../dfsbroker/storagepool/request/CreateStoragePoolRequest.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dsms-engine-application/src/main/java/com/dsms/modules/storagepool/task/CreateStoragePoolTask.java b/dsms-engine-application/src/main/java/com/dsms/modules/storagepool/task/CreateStoragePoolTask.java index c6c040c..7bc1b69 100644 --- a/dsms-engine-application/src/main/java/com/dsms/modules/storagepool/task/CreateStoragePoolTask.java +++ b/dsms-engine-application/src/main/java/com/dsms/modules/storagepool/task/CreateStoragePoolTask.java @@ -164,7 +164,7 @@ public class CreateStoragePoolTask implements TaskStrategy { RemoteResponse createResponse = storagePoolApi.createPool(RemoteCallUtil.generateRemoteRequest(), storagePoolCreateDTO); boolean flag = true;//use to check whether the task in cluster is complete while (flag) { - getStepResponse(step, createResponse, String.format(CreateStoragePoolRequest.Create_POOL_SUCCESS, storagePoolCreateDTO.getPoolName()), "create pool fail"); + getStepResponse(step, createResponse, String.format(CreateStoragePoolRequest.CREATE_POOL_SUCCESS, storagePoolCreateDTO.getPoolName()), "create pool fail"); if (Objects.equals(step.getStepStatus(), TaskStatusEnum.FINISH.getStatus()) || Objects.equals(step.getStepStatus(), TaskStatusEnum.FAIL.getStatus())) { flag = false; } diff --git a/dsms-engine-application/src/test/java/com/dsms/dfsbroker/storagepool/api/StoragePoolApiTest.java b/dsms-engine-application/src/test/java/com/dsms/dfsbroker/storagepool/api/StoragePoolApiTest.java index 96de5b7..9a9d04b 100644 --- a/dsms-engine-application/src/test/java/com/dsms/dfsbroker/storagepool/api/StoragePoolApiTest.java +++ b/dsms-engine-application/src/test/java/com/dsms/dfsbroker/storagepool/api/StoragePoolApiTest.java @@ -83,7 +83,7 @@ class StoragePoolApiTest { assertEquals(RemoteResponseStatusEnum.SUCCESS.getMessage(), createPoolResult.getState()); List finished = createPoolResult.getFinished(); String outs = finished.get(0).getOuts(); - assertEquals(outs, String.format(CreateStoragePoolRequest.Create_POOL_SUCCESS, erasureCreateDTO.getPoolName())); + assertEquals(outs, String.format(CreateStoragePoolRequest.CREATE_POOL_SUCCESS, erasureCreateDTO.getPoolName())); } @Test diff --git a/dsms-engine-dfsbroker/src/main/java/com/dsms/dfsbroker/storagepool/request/CreateStoragePoolRequest.java b/dsms-engine-dfsbroker/src/main/java/com/dsms/dfsbroker/storagepool/request/CreateStoragePoolRequest.java index 2f7e242..6a607f8 100644 --- a/dsms-engine-dfsbroker/src/main/java/com/dsms/dfsbroker/storagepool/request/CreateStoragePoolRequest.java +++ b/dsms-engine-dfsbroker/src/main/java/com/dsms/dfsbroker/storagepool/request/CreateStoragePoolRequest.java @@ -31,7 +31,7 @@ import java.util.Map; public class CreateStoragePoolRequest extends RemoteRequest { - public static final String Create_POOL_SUCCESS = "pool '%s' created"; + public static final String CREATE_POOL_SUCCESS = "pool '%s' created"; public CreateStoragePoolRequest(StoragePoolCreateDTO pool) { if (ObjectUtil.checkObjFieldContainNull(pool)) { -- Gitee