Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CurrencyListTest when locale is not en_US #2264

Merged
merged 1 commit into from
Jan 14, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions desktop/src/test/java/bisq/desktop/util/CurrencyListTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.google.common.collect.Lists;

import java.util.ArrayList;
import java.util.Currency;
import java.util.List;
import java.util.Locale;

Expand All @@ -44,8 +45,10 @@
@PrepareForTest(Preferences.class)
@PowerMockIgnore({"com.sun.org.apache.xerces.*", "javax.xml.*", "org.xml.*"})
public class CurrencyListTest {
private static final TradeCurrency USD = new FiatCurrency("USD");
private static final TradeCurrency RUR = new FiatCurrency("RUR");
private static final Locale locale = new Locale("en", "US");

private static final TradeCurrency USD = new FiatCurrency(Currency.getInstance("USD"), locale);
private static final TradeCurrency RUR = new FiatCurrency(Currency.getInstance("RUR"), locale);
private static final TradeCurrency BTC = new CryptoCurrency("BTC", "Bitcoin");
private static final TradeCurrency ETH = new CryptoCurrency("ETH", "Ether");
private static final TradeCurrency BSQ = new CryptoCurrency("BSQ", "Bisq Token");
Expand All @@ -56,7 +59,7 @@ public class CurrencyListTest {

@Before
public void setUp() {
Locale.setDefault(new Locale("en", "US"));
Locale.setDefault(locale);

CurrencyPredicates predicates = mock(CurrencyPredicates.class);
when(predicates.isCryptoCurrency(USD)).thenReturn(false);
Expand Down