Fix sonar findings (#2572)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -33,7 +33,7 @@ public class MgmtActionStatus {
|
||||
private Long id;
|
||||
|
||||
@Schema(example = "running")
|
||||
private StatusType type;
|
||||
private Type type;
|
||||
|
||||
private List<String> messages;
|
||||
|
||||
@@ -46,7 +46,7 @@ public class MgmtActionStatus {
|
||||
@Schema(example = "200")
|
||||
private Integer code;
|
||||
|
||||
public enum StatusType {
|
||||
public enum Type {
|
||||
|
||||
/**
|
||||
* Action is finished successfully for this target.
|
||||
@@ -116,8 +116,8 @@ public class MgmtActionStatus {
|
||||
}
|
||||
|
||||
@JsonCreator
|
||||
public static StatusType forValue(String s) {
|
||||
return StatusType.valueOf(s.toUpperCase());
|
||||
public static Type forValue(String s) {
|
||||
return Type.valueOf(s.toUpperCase());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,6 @@ import java.util.List;
|
||||
import com.fasterxml.jackson.databind.JsonNode;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.context.annotation.Description;
|
||||
|
||||
/**
|
||||
* Feature: Tests for the MgmtTargetAssignmentResponseBody<br/>
|
||||
|
||||
@@ -64,14 +64,14 @@ public class MgmtRolloutResource implements MgmtRolloutRestApi {
|
||||
|
||||
private final RolloutManagement rolloutManagement;
|
||||
private final RolloutGroupManagement rolloutGroupManagement;
|
||||
private final DistributionSetManagement distributionSetManagement;
|
||||
private final DistributionSetManagement<? extends DistributionSet> distributionSetManagement;
|
||||
private final TargetFilterQueryManagement targetFilterQueryManagement;
|
||||
private final EntityFactory entityFactory;
|
||||
private final TenantConfigHelper tenantConfigHelper;
|
||||
|
||||
MgmtRolloutResource(
|
||||
final RolloutManagement rolloutManagement, final RolloutGroupManagement rolloutGroupManagement,
|
||||
final DistributionSetManagement distributionSetManagement,
|
||||
final DistributionSetManagement<? extends DistributionSet> distributionSetManagement,
|
||||
final TargetFilterQueryManagement targetFilterQueryManagement, final EntityFactory entityFactory,
|
||||
final SystemSecurityContext systemSecurityContext,
|
||||
final TenantConfigurationManagement tenantConfigurationManagement) {
|
||||
|
||||
@@ -21,7 +21,6 @@ import org.eclipse.hawkbit.mgmt.json.model.softwaremoduletype.MgmtSoftwareModule
|
||||
import org.eclipse.hawkbit.mgmt.rest.api.MgmtSoftwareModuleTypeRestApi;
|
||||
import org.eclipse.hawkbit.mgmt.rest.resource.mapper.MgmtSoftwareModuleTypeMapper;
|
||||
import org.eclipse.hawkbit.mgmt.rest.resource.util.PagingUtility;
|
||||
import org.eclipse.hawkbit.repository.EntityFactory;
|
||||
import org.eclipse.hawkbit.repository.SoftwareModuleTypeManagement;
|
||||
import org.eclipse.hawkbit.repository.exception.EntityNotFoundException;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
||||
|
||||
@@ -346,7 +346,7 @@ public final class MgmtTargetMapper {
|
||||
result.setReportedAt(actionStatus.getCreatedAt());
|
||||
result.setTimestamp(actionStatus.getOccurredAt());
|
||||
result.setId(actionStatus.getId());
|
||||
result.setType(MgmtActionStatus.StatusType.forValue(actionStatus.getStatus().name()));
|
||||
result.setType(MgmtActionStatus.Type.forValue(actionStatus.getStatus().name()));
|
||||
actionStatus.getCode().ifPresent(result::setCode);
|
||||
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user