File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed 
src/test/java/com/bigchaindb/api Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 88import  com .bigchaindb .api .TransactionsApi ;
99import  com .bigchaindb .builders .BigchainDbTransactionBuilder ;
1010import  com .bigchaindb .constants .Operations ;
11+ import  com .bigchaindb .exceptions .TransactionNotFoundException ;
1112import  com .bigchaindb .json .strategy .MetaDataDeserializer ;
1213import  com .bigchaindb .json .strategy .MetaDataSerializer ;
1314import  com .bigchaindb .json .strategy .TransactionDeserializer ;
4142public  class  TransactionCreateApiTest  extends  AbstractApiTest  {
4243
4344    public  static  String  TRANSACTION_ID  = "4957744b3ac54434b8270f2c854cc1040228c82ea4e72d66d2887a4d3e30b317" ;
45+     public  static  String  NON_EXISTENT_TRANSACTION_ID  = "4957744b3ac5434b8270f2c854cc1040228c8ea4e72d66d2887a4d3e30b317" ;
4446    public  static  String  V1_GET_TRANSACTION_JSON  = "{\n "  +
4547            "  \" asset\" : {\n "  +
4648            "    \" data\" : {\n "  +
@@ -245,9 +247,25 @@ public void testGetTransaction() {
245247            assertTrue (transaction .getId ().equals (TRANSACTION_ID ));
246248        } catch  (IOException  e ) {
247249            e .printStackTrace ();
250+         } catch  (TransactionNotFoundException  e ) {
251+             e .printStackTrace ();
248252        }
249253    }
250254
255+     /** 
256+      * Test get transaction when the transaction with supplied id is not present. 
257+      */ 
258+     @ Test (expected  = TransactionNotFoundException .class )
259+     public  void  testGetNonExistentTransaction () throws  TransactionNotFoundException  {
260+         try  {
261+            TransactionsApi .getTransactionById (NON_EXISTENT_TRANSACTION_ID );
262+         } catch  (IOException  e ) {
263+             e .printStackTrace ();
264+         }
265+     }
266+ 
267+ 
268+ 
251269    /** 
252270     * Test get transactions by assets id 
253271     */ 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments