我想实现这段代码
public void testGetExchangeRate() throws Exception
{
ECKey key = KeyUtils.createEcKey();
String clientName = "server 1";
BitPay bitpay = new BitPay(key, clientName);
if (!bitpay.clientIsAuthorized(BitPay.FACADE_MERCHANT))
{
// Get Merchant facade authorization code
String pairingCode = bitpay.requestClientAuthorization(
BitPay.FACADE_MERCHANT);
// Signal the device operator that this client needs to
// be paired with a merchant account.
System.out.print("Info: Pair this client with your merchant account using the pairing Code: " + pairingCode);
throw new BitPayException("Error:client is not authorized for Merchant facade");
}
}
我包括了这些依赖项:
<dependency>
<groupId>com.github.bitpay</groupId>
<artifactId>java-bitpay-client</artifactId>
<version>v2.0.4</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.5</version>
<type>jar</type>
</dependency>
但是当我运行代码时,我得到:
testGetExchangeRate(com.payment.gateway.bitpay.impl.BitpayImplTest) Time elapsed: 1.665 sec <<< ERROR!
java.lang.NoSuchFieldError: INSTANCE
at com.payment.gateway.bitpay.impl.BitpayImplTest.testGetExchangeRate(BitpayImplTest.java:55)
问题:您能给我一些建议,我该如何解决这个问题?