Skip to content

Commit b154c99

Browse files
committed
DMP-5252-ARM-5-2-Upgrade
Started to move the ARM clients into a service so the current version and new version can be enabled accordingly
1 parent 49c9945 commit b154c99

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

src/main/java/uk/gov/hmcts/darts/arm/service/impl/ArmApiServiceImpl.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package uk.gov.hmcts.darts.arm.service.impl;
22

33
import feign.FeignException;
4-
import lombok.RequiredArgsConstructor;
54
import lombok.extern.slf4j.Slf4j;
65
import org.apache.commons.lang3.StringUtils;
76
import org.springframework.http.HttpStatus;
@@ -30,14 +29,22 @@
3029
import static java.util.Objects.nonNull;
3130

3231
@Service
33-
@RequiredArgsConstructor
32+
//@RequiredArgsConstructor
3433
@Slf4j
3534
public class ArmApiServiceImpl implements ArmApiService {
3635

3736
private final ArmApiConfigurationProperties armApiConfigurationProperties;
3837
private final ArmDataManagementConfiguration armDataManagementConfiguration;
3938
private final ArmClientService armClientService;
4039

40+
public ArmApiServiceImpl(ArmApiConfigurationProperties armApiConfigurationProperties,
41+
ArmDataManagementConfiguration armDataManagementConfiguration,
42+
ArmClientService armClientService) {
43+
this.armApiConfigurationProperties = armApiConfigurationProperties;
44+
this.armDataManagementConfiguration = armDataManagementConfiguration;
45+
this.armClientService = armClientService;
46+
}
47+
4148
@Override
4249
public UpdateMetadataResponse updateMetadata(String externalRecordId,
4350
OffsetDateTime eventTimestamp,

src/main/java/uk/gov/hmcts/darts/arm/service/impl/ArmClientServiceImpl.java

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package uk.gov.hmcts.darts.arm.service.impl;
22

33
import feign.Response;
4-
import lombok.RequiredArgsConstructor;
4+
import lombok.AllArgsConstructor;
55
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
6-
import org.springframework.stereotype.Service;
6+
import org.springframework.stereotype.Component;
77
import uk.gov.hmcts.darts.arm.client.ArmApiClient;
88
import uk.gov.hmcts.darts.arm.client.ArmRpoClient;
99
import uk.gov.hmcts.darts.arm.client.ArmTokenClient;
@@ -38,9 +38,13 @@
3838
* Pre ARM version 5.2 implementation of the ArmClientService.
3939
* This implementation is activated when the property 'darts.storage.arm.arm-api.enable-arm-v5' is set to false.
4040
*/
41-
@Service
42-
@ConditionalOnProperty(prefix = "darts.storage.arm.arm-api", name = "enable-arm-v5-2-upgrade", havingValue = "false", matchIfMissing = false)
43-
@RequiredArgsConstructor
41+
//@Component
42+
//@ConditionalOnProperty(prefix = "darts.storage.arm", name = "is-mock-arm-rpo-download-csv", havingValue = "false")
43+
//@AllArgsConstructor
44+
@Component
45+
@ConditionalOnProperty(prefix = "darts.storage.arm.arm-api", name = "enable-arm-v5-2-upgrade", havingValue = "false")
46+
//@RequiredArgsConstructor(onConstructor_ = {@Autowired, @Lazy})
47+
@AllArgsConstructor
4448
@SuppressWarnings({"PMD.CouplingBetweenObjects", "PMD.UseObjectForClearerAPI"})
4549
public class ArmClientServiceImpl implements ArmClientService {
4650

src/main/java/uk/gov/hmcts/darts/arm/service/impl/ArmClientServiceWrapper.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
package uk.gov.hmcts.darts.arm.service.impl;
22

33
import feign.Response;
4-
import lombok.RequiredArgsConstructor;
4+
import lombok.AllArgsConstructor;
55
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
6-
import org.springframework.stereotype.Service;
6+
import org.springframework.stereotype.Component;
77
import uk.gov.hmcts.darts.arm.client.model.ArmTokenRequest;
88
import uk.gov.hmcts.darts.arm.client.model.ArmTokenResponse;
99
import uk.gov.hmcts.darts.arm.client.model.AvailableEntitlementProfile;
@@ -37,9 +37,12 @@
3737
* Post ARM version 5.2 implementation of the ArmClientService.
3838
* This implementation is activated when the property 'darts.storage.arm.arm-api.enable-arm-v5' is set to true.
3939
*/
40-
@Service
40+
//@Component
41+
//@ConditionalOnProperty(prefix = "darts.storage.arm", name = "is-mock-arm-rpo-download-csv", havingValue = "false")
42+
//@AllArgsConstructor
43+
@Component
4144
@ConditionalOnProperty(prefix = "darts.storage.arm.arm-api", name = "enable-arm-v5-2-upgrade", havingValue = "true")
42-
@RequiredArgsConstructor
45+
@AllArgsConstructor
4346
@SuppressWarnings({"PMD.CouplingBetweenObjects", "PMD.UseObjectForClearerAPI"})
4447
public class ArmClientServiceWrapper implements ArmClientService {
4548

0 commit comments

Comments
 (0)