Skip to content

Commit 460bae2

Browse files
author
BramBear
authored
Merge pull request #72 from Rokko11/master
Fix travis build
2 parents fb0b537 + 7d8a425 commit 460bae2

File tree

3 files changed

+30
-13
lines changed

3 files changed

+30
-13
lines changed

.travis.yml

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
language: java
2-
sudo: false
2+
sudo: required
33
jdk:
4-
- oraclejdk8
4+
- oraclejdk8
55
install: true
66

7+
services:
8+
- docker
9+
10+
install:
11+
- docker pull bigchaindb/bigchaindb
12+
- docker run --interactive --rm --tty --volume $HOME/bigchaindb_docker:/data --env BIGCHAINDB_DATABASE_HOST=172.17.0.1 bigchaindb/bigchaindb -y configure mongodb
13+
- docker run --detach --name=mongodb --publish=27017:27017 --restart=always --volume=$HOME/mongodb_docker/db:/data/db --volume=$HOME/mongodb_docker/configdb:/data/configdb mongo:3.4.9 --replSet=bigchain-rs
14+
- docker run --detach --name=bigchaindb --publish=9984:9984 --restart=always --volume=$HOME/bigchaindb_docker:/data bigchaindb/bigchaindb start
15+
716
before_script:
8-
- mvn install:install-file -Dfile=$TRAVIS_BUILD_DIR/libs/java-crypto-conditions-2.0.0-SNAPSHOT.jar -DgroupId=org.interledger -DartifactId=java-crypto-conditions -Dversion=2.0.0-SNAPSHOT -Dpackaging=jar
17+
- mvn install:install-file -Dfile=$TRAVIS_BUILD_DIR/libs/java-crypto-conditions-2.0.0-SNAPSHOT.jar -DgroupId=org.interledger -DartifactId=java-crypto-conditions -Dversion=2.0.0-SNAPSHOT -Dpackaging=jar
18+
19+
cache:
20+
directories:
21+
- $HOME/.m2
922

1023
branches:
11-
only:
12-
- master
24+
only:
25+
- master
1326

1427
script:
15-
- mvn clean install
28+
- mvn clean install

src/test/java/com/authenteq/api/BlocksApiTest.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.authenteq.api;
22

3+
import static org.junit.Assert.assertEquals;
34
import static org.junit.Assert.assertFalse;
45
import static org.junit.Assert.assertNotNull;
56
import static org.junit.Assert.assertTrue;
@@ -20,6 +21,7 @@
2021
import com.authenteq.constants.BlockStatus;
2122
import com.authenteq.constants.Operations;
2223
import com.authenteq.model.Account;
24+
import com.authenteq.model.StatusCode;
2325
import com.authenteq.model.Transaction;
2426

2527
import net.i2p.crypto.eddsa.EdDSAPrivateKey;
@@ -35,7 +37,7 @@ public class BlocksApiTest extends AbstractApiTest
3537

3638
/**
3739
* Test asset search.
38-
* @throws InterruptedException
40+
* @throws InterruptedException
3941
*/
4042
@Test
4143
public void testBlockSearch() throws InterruptedException {
@@ -48,17 +50,18 @@ public void testBlockSearch() throws InterruptedException {
4850
put( "ziddlename", "mname" );
4951
put( "lastname", "Smith" );
5052
}};
51-
53+
5254
Transaction transaction = BigchainDbTransactionBuilder
5355
.init()
5456
.addAssets(assetData, TreeMap.class)
5557
.operation(Operations.CREATE)
5658
.buildAndSign((EdDSAPublicKey) Account.publicKeyFromHex(publicKey), (EdDSAPrivateKey) Account.privateKeyFromHex(privateKey))
5759
.sendTransaction();
58-
60+
61+
assertEquals(StatusCode.VALID, getStatus(transaction).getStatus());
5962
assertFalse(BlocksApi.getBlocks(transaction.getId(), BlockStatus.VALID).isEmpty());
60-
61-
} catch (IOException | InvalidKeySpecException e) {
63+
64+
} catch (IOException | InvalidKeySpecException | StatusException e) {
6265
e.printStackTrace();
6366
}
6467
}

src/test/resources/test.properties

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
test.api.url=https://test.ipdb.io
1+
test.api.url=http://localhost:9984
22
test.app.id=2bbaf3ff
3-
test.app.key=c929b708177dcc8b9d58180082029b8d
3+
test.app.key=c929b708177dcc8b9d58180082029b8d
4+
test.status.retries=300

0 commit comments

Comments
 (0)