Advertisement
aadddrr

Untitled

Oct 18th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.12 KB | None | 0 0
  1. @Test
  2.     public void testForCoaIdNotFound() {
  3.         String code = "PRE_TAX_30";
  4.         String name = "Prepaid Tax Art 30";
  5.         Long coaId = -99l;
  6.        
  7.         String datetime = DateUtil.dateTimeNow();
  8.         Long tenantLoginId = 10l;
  9.         Long roleLoginId = 1l;
  10.         String active = GeneralConstants.YES;
  11.         Long userLoginId = 1l;
  12.        
  13.         Dto inputDto = new Dto();
  14.         inputDto.put("code", code);        
  15.         inputDto.put("name", name);        
  16.         inputDto.put("coaId", coaId);
  17.         inputDto.put("active", active);        
  18.         inputDto.put("tenantLoginId", tenantLoginId);          
  19.         inputDto.put("userLoginId", userLoginId);          
  20.         inputDto.put("roleLoginId", roleLoginId);          
  21.         inputDto.put("datetime", datetime);                    
  22.        
  23.         try{           
  24.             Dto outputDto = addActivity.execute(inputDto);         
  25.             Assert.fail("This addActivity  should be error: "+outputDto);
  26.         } catch(CoreException e){                      
  27.             log.error("Coa Id {0} is not found", e);
  28.             Assert.assertEquals(1, e.getParamValues().length);
  29.             Assert.assertEquals(MasterExceptionConstants.COA_ID_NOT_FOUND, e.getErrorKey());           
  30.         } catch (Exception e){
  31.             log.error("Exception{}",e);        
  32.             Assert.fail(e.toString());                     
  33.         }  
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement