-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use ObjectProvider for service dependency (#261)
Co-authored-by: Michael Peels <[email protected]>
- Loading branch information
Showing
5 changed files
with
45 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 7 additions & 3 deletions
10
...va/gov/cdc/dataprocessing/service/implementation/person/matching/DeduplicationClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
package gov.cdc.dataprocessing.service.implementation.person.matching; | ||
|
||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.client.RestClient; | ||
|
||
@Configuration | ||
@ConditionalOnProperty(name = "${features.modernizedMatching.enabled}", havingValue = "true") | ||
public class DeduplicationClient { | ||
|
||
@Bean("deduplicationRestClient") | ||
public RestClient restClient(@Value("${features.modernizedMatching.url}") String modernizedMatchingUrl) { | ||
return RestClient.builder().baseUrl(modernizedMatchingUrl).build(); | ||
@Bean | ||
public DeduplicationService deduplicationService( | ||
@Value("${features.modernizedMatching.url}") String modernizedMatchingUrl) { | ||
return new DeduplicationService(RestClient.builder().baseUrl(modernizedMatchingUrl).build()); | ||
} | ||
|
||
} |
6 changes: 1 addition & 5 deletions
6
...a/gov/cdc/dataprocessing/service/implementation/person/matching/DeduplicationService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters