diff --git a/desktop/src/test/java/bisq/desktop/main/market/offerbook/OfferBookChartViewModelTest.java b/desktop/src/test/java/bisq/desktop/main/market/offerbook/OfferBookChartViewModelTest.java index cec316e70f..a13b1ce946 100644 --- a/desktop/src/test/java/bisq/desktop/main/market/offerbook/OfferBookChartViewModelTest.java +++ b/desktop/src/test/java/bisq/desktop/main/market/offerbook/OfferBookChartViewModelTest.java @@ -38,10 +38,10 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import static bisq.core.locale.TradeCurrencyMakers.usd; -import static bisq.core.user.PreferenceMakers.empty; import static bisq.desktop.main.offer.offerbook.OfferBookListItemMaker.btcBuyItem; import static bisq.desktop.main.offer.offerbook.OfferBookListItemMaker.btcSellItem; +import static bisq.desktop.maker.PreferenceMakers.empty; +import static bisq.desktop.maker.TradeCurrencyMakers.usd; import static com.natpryce.makeiteasy.MakeItEasy.make; import static com.natpryce.makeiteasy.MakeItEasy.with; import static org.junit.Assert.assertEquals; diff --git a/desktop/src/test/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModelTest.java b/desktop/src/test/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModelTest.java index 2fa9694899..8ee590cf89 100644 --- a/desktop/src/test/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModelTest.java +++ b/desktop/src/test/java/bisq/desktop/main/offer/createoffer/CreateOfferViewModelTest.java @@ -54,7 +54,7 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import static bisq.core.user.PreferenceMakers.empty; +import static bisq.desktop.maker.PreferenceMakers.empty; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNull; import static org.mockito.ArgumentMatchers.any; diff --git a/desktop/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookListItemMaker.java b/desktop/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookListItemMaker.java index fc3a481e02..e6e7790a64 100644 --- a/desktop/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookListItemMaker.java +++ b/desktop/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookListItemMaker.java @@ -17,7 +17,8 @@ package bisq.desktop.main.offer.offerbook; -import bisq.core.offer.OfferMaker; +import bisq.desktop.maker.OfferMaker; + import bisq.core.offer.OfferPayload; import com.natpryce.makeiteasy.Instantiator; @@ -25,7 +26,7 @@ import com.natpryce.makeiteasy.MakeItEasy; import com.natpryce.makeiteasy.Maker; import com.natpryce.makeiteasy.Property; -import static bisq.core.offer.OfferMaker.btcUsdOffer; +import static bisq.desktop.maker.OfferMaker.btcUsdOffer; import static com.natpryce.makeiteasy.MakeItEasy.a; import static com.natpryce.makeiteasy.MakeItEasy.make; import static com.natpryce.makeiteasy.MakeItEasy.with; diff --git a/desktop/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookViewModelTest.java b/desktop/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookViewModelTest.java index d92f87c1fe..89c2b748a4 100644 --- a/desktop/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookViewModelTest.java +++ b/desktop/src/test/java/bisq/desktop/main/offer/offerbook/OfferBookViewModelTest.java @@ -69,9 +69,9 @@ import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; -import static bisq.core.locale.TradeCurrencyMakers.usd; -import static bisq.core.user.PreferenceMakers.empty; import static bisq.desktop.main.offer.offerbook.OfferBookListItemMaker.*; +import static bisq.desktop.maker.PreferenceMakers.empty; +import static bisq.desktop.maker.TradeCurrencyMakers.usd; import static com.natpryce.makeiteasy.MakeItEasy.make; import static com.natpryce.makeiteasy.MakeItEasy.with; import static org.junit.Assert.assertEquals; diff --git a/desktop/src/test/java/bisq/desktop/main/settings/preferences/PreferencesViewModelTest.java b/desktop/src/test/java/bisq/desktop/main/settings/preferences/PreferencesViewModelTest.java index 42b368b145..515b88190f 100644 --- a/desktop/src/test/java/bisq/desktop/main/settings/preferences/PreferencesViewModelTest.java +++ b/desktop/src/test/java/bisq/desktop/main/settings/preferences/PreferencesViewModelTest.java @@ -17,9 +17,10 @@ package bisq.desktop.main.settings.preferences; +import bisq.desktop.maker.PreferenceMakers; + import bisq.core.arbitration.Arbitrator; import bisq.core.arbitration.ArbitratorManager; -import bisq.core.user.PreferenceMakers; import bisq.core.user.Preferences; import bisq.network.p2p.NodeAddress; diff --git a/desktop/src/test/java/bisq/desktop/util/CurrencyListItemMakers.java b/desktop/src/test/java/bisq/desktop/maker/CurrencyListItemMakers.java similarity index 82% rename from desktop/src/test/java/bisq/desktop/util/CurrencyListItemMakers.java rename to desktop/src/test/java/bisq/desktop/maker/CurrencyListItemMakers.java index afcd83a0cc..f85acc19bc 100644 --- a/desktop/src/test/java/bisq/desktop/util/CurrencyListItemMakers.java +++ b/desktop/src/test/java/bisq/desktop/maker/CurrencyListItemMakers.java @@ -15,7 +15,9 @@ * along with Bisq. If not, see . */ -package bisq.desktop.util; +package bisq.desktop.maker; + +import bisq.desktop.util.CurrencyListItem; import bisq.core.locale.TradeCurrency; @@ -23,14 +25,14 @@ import com.natpryce.makeiteasy.Instantiator; import com.natpryce.makeiteasy.Maker; import com.natpryce.makeiteasy.Property; -import static bisq.core.locale.TradeCurrencyMakers.bitcoin; -import static bisq.core.locale.TradeCurrencyMakers.euro; +import static bisq.desktop.maker.TradeCurrencyMakers.bitcoin; +import static bisq.desktop.maker.TradeCurrencyMakers.euro; import static com.natpryce.makeiteasy.MakeItEasy.a; import static com.natpryce.makeiteasy.MakeItEasy.with; public class CurrencyListItemMakers { - public static final Property tradeCurrency = new Property<>(); + public static final Property tradeCurrency = new Property<>(); public static final Property numberOfTrades = new Property<>(); public static final Instantiator CurrencyListItem = lookup -> diff --git a/desktop/src/test/java/bisq/desktop/maker/OfferMaker.java b/desktop/src/test/java/bisq/desktop/maker/OfferMaker.java new file mode 100644 index 0000000000..e620d1ba92 --- /dev/null +++ b/desktop/src/test/java/bisq/desktop/maker/OfferMaker.java @@ -0,0 +1,82 @@ +/* + * This file is part of Bisq. + * + * Bisq is free software: you can redistribute it and/or modify it + * under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation, either version 3 of the License, or (at + * your option) any later version. + * + * Bisq is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public + * License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with Bisq. If not, see . + */ + +package bisq.desktop.maker; + +import bisq.core.offer.Offer; +import bisq.core.offer.OfferPayload; + +import com.natpryce.makeiteasy.Instantiator; +import com.natpryce.makeiteasy.Maker; +import com.natpryce.makeiteasy.Property; + +import static com.natpryce.makeiteasy.MakeItEasy.a; + +public class OfferMaker { + + public static final Property price = new Property<>(); + public static final Property minAmount = new Property<>(); + public static final Property amount = new Property<>(); + public static final Property baseCurrencyCode = new Property<>(); + public static final Property counterCurrencyCode = new Property<>(); + public static final Property direction = new Property<>(); + public static final Property useMarketBasedPrice = new Property<>(); + public static final Property marketPriceMargin = new Property<>(); + public static final Property id = new Property<>(); + + public static final Instantiator Offer = lookup -> new Offer( + new OfferPayload(lookup.valueOf(id, "1234"), + 0L, + null, + null, + lookup.valueOf(direction, OfferPayload.Direction.BUY), + lookup.valueOf(price, 100000L), + lookup.valueOf(marketPriceMargin, 0.0), + lookup.valueOf(useMarketBasedPrice, false), + lookup.valueOf(amount, 100000L), + lookup.valueOf(minAmount, 100000L), + lookup.valueOf(baseCurrencyCode, "BTC"), + lookup.valueOf(counterCurrencyCode, "USD"), + null, + null, + "SEPA", + "", + null, + null, + null, + null, + null, + "", + 0L, + 0L, + 0L, + false, + 0L, + 0L, + 0L, + 0L, + false, + false, + 0L, + 0L, + false, + null, + null, + 0)); + + public static final Maker btcUsdOffer = a(Offer); +} diff --git a/core/src/test/java/bisq/core/user/PreferenceMakers.java b/desktop/src/test/java/bisq/desktop/maker/PreferenceMakers.java similarity index 92% rename from core/src/test/java/bisq/core/user/PreferenceMakers.java rename to desktop/src/test/java/bisq/desktop/maker/PreferenceMakers.java index cbaad42cb0..22b3340645 100644 --- a/core/src/test/java/bisq/core/user/PreferenceMakers.java +++ b/desktop/src/test/java/bisq/desktop/maker/PreferenceMakers.java @@ -15,9 +15,10 @@ * along with Bisq. If not, see . */ -package bisq.core.user; +package bisq.desktop.maker; import bisq.core.app.BisqEnvironment; +import bisq.core.user.Preferences; import bisq.common.storage.Storage; @@ -30,7 +31,7 @@ import static com.natpryce.makeiteasy.MakeItEasy.make; public class PreferenceMakers { - public static final Property storage = new Property<>(); + public static final Property storage = new Property<>(); public static final Property bisqEnvironment = new Property<>(); public static final Property btcNodesFromOptions = new Property<>(); public static final Property useTorFlagFromOptions = new Property<>(); diff --git a/core/src/test/java/bisq/core/monetary/PriceMaker.java b/desktop/src/test/java/bisq/desktop/maker/PriceMaker.java similarity index 94% rename from core/src/test/java/bisq/core/monetary/PriceMaker.java rename to desktop/src/test/java/bisq/desktop/maker/PriceMaker.java index 765282aaeb..e96f7c40d2 100644 --- a/core/src/test/java/bisq/core/monetary/PriceMaker.java +++ b/desktop/src/test/java/bisq/desktop/maker/PriceMaker.java @@ -15,7 +15,10 @@ * along with Bisq. If not, see . */ -package bisq.core.monetary; +package bisq.desktop.maker; + +import bisq.core.monetary.Altcoin; +import bisq.core.monetary.Price; import org.bitcoinj.utils.Fiat; diff --git a/core/src/test/java/bisq/core/locale/TradeCurrencyMakers.java b/desktop/src/test/java/bisq/desktop/maker/TradeCurrencyMakers.java similarity index 82% rename from core/src/test/java/bisq/core/locale/TradeCurrencyMakers.java rename to desktop/src/test/java/bisq/desktop/maker/TradeCurrencyMakers.java index 425f148523..cdd4d3cf4f 100644 --- a/core/src/test/java/bisq/core/locale/TradeCurrencyMakers.java +++ b/desktop/src/test/java/bisq/desktop/maker/TradeCurrencyMakers.java @@ -15,7 +15,11 @@ * along with Bisq. If not, see . */ -package bisq.core.locale; +package bisq.desktop.maker; + +import bisq.core.locale.CryptoCurrency; +import bisq.core.locale.FiatCurrency; +import bisq.core.locale.TradeCurrency; import com.natpryce.makeiteasy.Instantiator; import com.natpryce.makeiteasy.Property; @@ -29,10 +33,10 @@ public class TradeCurrencyMakers { public static final Property currencyCode = new Property<>(); public static final Property currencyName = new Property<>(); - public static final Instantiator CryptoCurrency = lookup -> + public static final Instantiator CryptoCurrency = lookup -> new CryptoCurrency(lookup.valueOf(currencyCode, "BTC"), lookup.valueOf(currencyName, "Bitcoin")); - public static final Instantiator FiatCurrency = lookup -> + public static final Instantiator FiatCurrency = lookup -> new FiatCurrency(lookup.valueOf(currencyCode, "EUR")); public static final CryptoCurrency bitcoin = make(a(CryptoCurrency)); diff --git a/core/src/test/java/bisq/core/monetary/VolumeMaker.java b/desktop/src/test/java/bisq/desktop/maker/VolumeMaker.java similarity index 94% rename from core/src/test/java/bisq/core/monetary/VolumeMaker.java rename to desktop/src/test/java/bisq/desktop/maker/VolumeMaker.java index 9ac73504c9..d52d128b3a 100644 --- a/core/src/test/java/bisq/core/monetary/VolumeMaker.java +++ b/desktop/src/test/java/bisq/desktop/maker/VolumeMaker.java @@ -15,7 +15,10 @@ * along with Bisq. If not, see . */ -package bisq.core.monetary; +package bisq.desktop.maker; + +import bisq.core.monetary.Altcoin; +import bisq.core.monetary.Volume; import org.bitcoinj.utils.Fiat; diff --git a/desktop/src/test/java/bisq/desktop/util/BSFormatterTest.java b/desktop/src/test/java/bisq/desktop/util/BSFormatterTest.java index 292435e4eb..d9bbf5b9dd 100644 --- a/desktop/src/test/java/bisq/desktop/util/BSFormatterTest.java +++ b/desktop/src/test/java/bisq/desktop/util/BSFormatterTest.java @@ -37,11 +37,11 @@ import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; -import static bisq.core.monetary.PriceMaker.priceString; -import static bisq.core.monetary.PriceMaker.usdPrice; -import static bisq.core.monetary.VolumeMaker.usdVolume; -import static bisq.core.monetary.VolumeMaker.volumeString; -import static bisq.core.offer.OfferMaker.btcUsdOffer; +import static bisq.desktop.maker.OfferMaker.btcUsdOffer; +import static bisq.desktop.maker.PriceMaker.priceString; +import static bisq.desktop.maker.PriceMaker.usdPrice; +import static bisq.desktop.maker.VolumeMaker.usdVolume; +import static bisq.desktop.maker.VolumeMaker.volumeString; import static com.natpryce.makeiteasy.MakeItEasy.a; import static com.natpryce.makeiteasy.MakeItEasy.make; import static com.natpryce.makeiteasy.MakeItEasy.with; diff --git a/desktop/src/test/java/bisq/desktop/util/GUIUtilTest.java b/desktop/src/test/java/bisq/desktop/util/GUIUtilTest.java index 0525023158..b7073cb791 100644 --- a/desktop/src/test/java/bisq/desktop/util/GUIUtilTest.java +++ b/desktop/src/test/java/bisq/desktop/util/GUIUtilTest.java @@ -30,12 +30,12 @@ import java.util.Map; import org.junit.Before; import org.junit.Test; -import static bisq.core.locale.TradeCurrencyMakers.bitcoin; -import static bisq.core.locale.TradeCurrencyMakers.euro; -import static bisq.core.user.PreferenceMakers.empty; -import static bisq.desktop.util.CurrencyListItemMakers.bitcoinItem; -import static bisq.desktop.util.CurrencyListItemMakers.euroItem; -import static bisq.desktop.util.CurrencyListItemMakers.numberOfTrades; +import static bisq.desktop.maker.CurrencyListItemMakers.bitcoinItem; +import static bisq.desktop.maker.CurrencyListItemMakers.euroItem; +import static bisq.desktop.maker.CurrencyListItemMakers.numberOfTrades; +import static bisq.desktop.maker.PreferenceMakers.empty; +import static bisq.desktop.maker.TradeCurrencyMakers.bitcoin; +import static bisq.desktop.maker.TradeCurrencyMakers.euro; import static com.natpryce.makeiteasy.MakeItEasy.make; import static com.natpryce.makeiteasy.MakeItEasy.with; import static org.junit.Assert.assertEquals;