Skip to content
This repository was archived by the owner on Oct 24, 2020. It is now read-only.
This repository was archived by the owner on Oct 24, 2020. It is now read-only.

junit tests fail #3

Open
Open

Description

@spicylobe

Multiple junit tests fail, both from the IDE and from "mvn clean install". For instance:

java.lang.ArrayIndexOutOfBoundsException: 0
at com.blockcypher.utils.sign.SignUtils.getBytesFromBase58Key(SignUtils.java:97)
at com.blockcypher.utils.sign.SignUtils.sign(SignUtils.java:50)
at com.blockcypher.utils.sign.SignUtils.signWithBase58KeyWithPubKey(SignUtils.java:40)
at com.blockcypher.service.TransactionServiceTest.testNewTransactionFromInputs(TransactionServiceTest.java:75)

and

java.lang.ArrayIndexOutOfBoundsException: 0
at com.blockcypher.utils.sign.SignUtils.getBytesFromBase58Key(SignUtils.java:97)
at com.blockcypher.utils.sign.SignUtils.sign(SignUtils.java:50)
at com.blockcypher.utils.sign.SignUtils.signWithBase58KeyWithPubKey(SignUtils.java:40)
at com.blockcypher.service.MultiSigTest.testMultiSigWithWebsocketOnConfirmedTransaction(MultiSigTest.java:57)

and

junit.framework.AssertionFailedError
at junit.framework.Assert.fail(Assert.java:55)
at junit.framework.Assert.assertTrue(Assert.java:22)
at junit.framework.Assert.assertNotNull(Assert.java:256)
at junit.framework.Assert.assertNotNull(Assert.java:248)
at com.blockcypher.service.AddressServiceTest.testGetAddress(AddressServiceTest.java:51)

Activity

  1. sebay commented on Jan 20, 2016

    @sebay
    Contributor

    Hi spicylobe,
    Did you put your own private key in:

    public class AbstractServiceTest {

    // In order to signWithBase58Key.. Of course do not store this is plain your java code... This is for test only!
    protected static final String MY_PRIVATE_KEY = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
    
  2. spicylobe commented on Jan 20, 2016

    @spicylobe
    Author

    I wouldn't expect to have to modify any code just to get unit tests to run. Why not include a valid private key that was generated only for use in unit tests? It seems like you could then test many additional elements that require matching key pairs.

  3. sebay commented on Jan 20, 2016

    @sebay
    Contributor

    Fair enough. Will try to do this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions