diff --git a/pom.xml b/pom.xml index 21f13c8..340c229 100644 --- a/pom.xml +++ b/pom.xml @@ -65,13 +65,10 @@ - - ossrh - https://oss.sonatype.org/content/repositories/snapshots - - ossrh - https://oss.sonatype.org/service/local/staging/deploy/maven2/ + internal.repo + Temporary Staging Repository + file://${project.build.directory}/mvn-repo @@ -126,6 +123,15 @@ + + maven-deploy-plugin + 2.8.2 + + + internal.repo::default::file://${project.build.directory}/mvn-repo + + + org.apache.maven.plugins maven-compiler-plugin diff --git a/src/main/java/com/github/jnidzwetzki/bitfinex/v2/symbol/BitfinexOrderBookSymbol.java b/src/main/java/com/github/jnidzwetzki/bitfinex/v2/symbol/BitfinexOrderBookSymbol.java index e8d7036..6a75173 100644 --- a/src/main/java/com/github/jnidzwetzki/bitfinex/v2/symbol/BitfinexOrderBookSymbol.java +++ b/src/main/java/com/github/jnidzwetzki/bitfinex/v2/symbol/BitfinexOrderBookSymbol.java @@ -17,6 +17,7 @@ *******************************************************************************/ package com.github.jnidzwetzki.bitfinex.v2.symbol; +import java.util.Arrays; import java.util.Objects; import org.json.JSONObject; @@ -59,25 +60,24 @@ public enum Precision { private final Integer pricePoints; - BitfinexOrderBookSymbol(final BitfinexCurrencyPair currencyPair, final Precision orderBookPrecision, - final Frequency frequency, final Integer pricePoints) { + BitfinexOrderBookSymbol( + final BitfinexCurrencyPair currencyPair, final com.github.jnidzwetzki.bitfinex.v2.symbol.BitfinexOrderBookSymbol.Precision orderBookPrecision, + final com.github.jnidzwetzki.bitfinex.v2.symbol.BitfinexOrderBookSymbol.Frequency frequency, final Integer pricePoints + ) { this.currencyPair = currencyPair; this.orderBookPrecision = orderBookPrecision; - if (orderBookPrecision != Precision.R0) { + if (orderBookPrecision != com.github.jnidzwetzki.bitfinex.v2.symbol.BitfinexOrderBookSymbol.Precision.R0) { this.frequency = frequency; - if(pricePoints == null) { throw new IllegalArgumentException("Price points must be != NULL"); } - - if (pricePoints < 25 || pricePoints > 100) { - throw new IllegalArgumentException("Price points must be between 25 and 100"); + if (!Arrays.asList(1, 25, 100, 250).contains(pricePoints)) { + throw new IllegalArgumentException("Possible values for Price points are: 1, 25, 100, 250"); } this.pricePoints = pricePoints; } else { this.frequency = null; this.pricePoints = null; - } } diff --git a/src/test/java/com/github/jnidzwetzki/bitfinex/v2/test/CommandsTest.java b/src/test/java/com/github/jnidzwetzki/bitfinex/v2/test/CommandsTest.java index 2bc3190..0b696b0 100644 --- a/src/test/java/com/github/jnidzwetzki/bitfinex/v2/test/CommandsTest.java +++ b/src/test/java/com/github/jnidzwetzki/bitfinex/v2/test/CommandsTest.java @@ -69,7 +69,7 @@ public void testCommandsJSON() throws BitfinexCommandException { final BitfinexCandlestickSymbol candleSymbol = BitfinexSymbols.candlesticks(currencyPair, BitfinexCandleTimeFrame.HOUR_1); BitfinexOrderBookSymbol orderbookConfiguration = BitfinexSymbols.orderBook(currencyPair, BitfinexOrderBookSymbol.Precision.P0, - BitfinexOrderBookSymbol.Frequency.F0, 50); + BitfinexOrderBookSymbol.Frequency.F0, 25); BitfinexOrderBookSymbol rawOrderbookConfiguration = BitfinexSymbols.rawOrderBook(BitfinexCurrencyPair.of("ETH", "BTC")); diff --git a/src/test/java/com/github/jnidzwetzki/bitfinex/v2/test/OrderbookTest.java b/src/test/java/com/github/jnidzwetzki/bitfinex/v2/test/OrderbookTest.java index ca89cdb..c93a7b1 100644 --- a/src/test/java/com/github/jnidzwetzki/bitfinex/v2/test/OrderbookTest.java +++ b/src/test/java/com/github/jnidzwetzki/bitfinex/v2/test/OrderbookTest.java @@ -43,13 +43,13 @@ public static void registerDefaultCurrencyPairs() { @Test public void testTradingOrderbookEquals() { final BitfinexOrderBookSymbol configuration1 = BitfinexSymbols.orderBook( - BitfinexCurrencyPair.of("BTC","USD"), BitfinexOrderBookSymbol.Precision.P1, BitfinexOrderBookSymbol.Frequency.F1, 50); + BitfinexCurrencyPair.of("BTC","USD"), BitfinexOrderBookSymbol.Precision.P1, BitfinexOrderBookSymbol.Frequency.F1, 25); final BitfinexOrderBookSymbol configuration2 = BitfinexSymbols.orderBook( - BitfinexCurrencyPair.of("BTC","USD"), BitfinexOrderBookSymbol.Precision.P1, BitfinexOrderBookSymbol.Frequency.F1, 50); + BitfinexCurrencyPair.of("BTC","USD"), BitfinexOrderBookSymbol.Precision.P1, BitfinexOrderBookSymbol.Frequency.F1, 25); final BitfinexOrderBookSymbol configuration3 = BitfinexSymbols.orderBook( - BitfinexCurrencyPair.of("BTC","USD"), BitfinexOrderBookSymbol.Precision.P0, BitfinexOrderBookSymbol.Frequency.F1, 50); + BitfinexCurrencyPair.of("BTC","USD"), BitfinexOrderBookSymbol.Precision.P0, BitfinexOrderBookSymbol.Frequency.F1, 25); Assert.assertEquals(configuration1.hashCode(), configuration2.hashCode()); Assert.assertEquals(configuration1, configuration2);