1
1
package com .authenteq .api ;
2
2
3
+ import static org .junit .Assert .assertEquals ;
3
4
import static org .junit .Assert .assertFalse ;
4
5
import static org .junit .Assert .assertNotNull ;
5
6
import static org .junit .Assert .assertTrue ;
20
21
import com .authenteq .constants .BlockStatus ;
21
22
import com .authenteq .constants .Operations ;
22
23
import com .authenteq .model .Account ;
24
+ import com .authenteq .model .StatusCode ;
23
25
import com .authenteq .model .Transaction ;
24
26
25
27
import net .i2p .crypto .eddsa .EdDSAPrivateKey ;
@@ -35,7 +37,7 @@ public class BlocksApiTest extends AbstractApiTest
35
37
36
38
/**
37
39
* Test asset search.
38
- * @throws InterruptedException
40
+ * @throws InterruptedException
39
41
*/
40
42
@ Test
41
43
public void testBlockSearch () throws InterruptedException {
@@ -48,17 +50,18 @@ public void testBlockSearch() throws InterruptedException {
48
50
put ( "ziddlename" , "mname" );
49
51
put ( "lastname" , "Smith" );
50
52
}};
51
-
53
+
52
54
Transaction transaction = BigchainDbTransactionBuilder
53
55
.init ()
54
56
.addAssets (assetData , TreeMap .class )
55
57
.operation (Operations .CREATE )
56
58
.buildAndSign ((EdDSAPublicKey ) Account .publicKeyFromHex (publicKey ), (EdDSAPrivateKey ) Account .privateKeyFromHex (privateKey ))
57
59
.sendTransaction ();
58
-
60
+
61
+ assertEquals (StatusCode .VALID , getStatus (transaction ).getStatus ());
59
62
assertFalse (BlocksApi .getBlocks (transaction .getId (), BlockStatus .VALID ).isEmpty ());
60
-
61
- } catch (IOException | InvalidKeySpecException e ) {
63
+
64
+ } catch (IOException | InvalidKeySpecException | StatusException e ) {
62
65
e .printStackTrace ();
63
66
}
64
67
}
0 commit comments