-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from Q1nt/add-exchange-rates-fallback
Add exchange-rates-client fallback implementation
- Loading branch information
Showing
3 changed files
with
21 additions
and
3 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
19 changes: 19 additions & 0 deletions
19
...service/src/main/java/com/piggymetrics/statistics/client/ExchangeRatesClientFallback.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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package com.piggymetrics.statistics.client; | ||
|
||
import com.piggymetrics.statistics.domain.Currency; | ||
import com.piggymetrics.statistics.domain.ExchangeRatesContainer; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.Collections; | ||
|
||
@Component | ||
public class ExchangeRatesClientFallback implements ExchangeRatesClient { | ||
|
||
@Override | ||
public ExchangeRatesContainer getRates(Currency base) { | ||
ExchangeRatesContainer container = new ExchangeRatesContainer(); | ||
container.setBase(Currency.getBase()); | ||
container.setRates(Collections.emptyMap()); | ||
return container; | ||
} | ||
} |
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