예제 #1
0
 @Test(expected = IllegalArgumentException.class)
 public void testInvalidTimes() {
   CallDetailRecordDto cdr =
       CdrHelper.csvLineToCdrDto(
           "20150513184533:58747ffc-6b7c-4abb-91d3-f099aa1bf5a3,"
               + "1111111111,c,d,e,123456,g,h,1001,j,k,456,123,o,p,q,3,s");
   assertNotNull(cdr);
 }
예제 #2
0
  @Test
  public void testCsvLineToCdr() {
    CallDetailRecordDto expectedCdr = new CallDetailRecordDto();
    expectedCdr.setRequestId(
        new RequestId("58747ffc-6b7c-4abb-91d3-f099aa1bf5a3", "20150513184533"));
    expectedCdr.setMsisdn(1111111111L);
    expectedCdr.setCallAnswerTime(new DateTime(123456L));
    expectedCdr.setStatusCode(StatusCode.OBD_SUCCESS_CALL_CONNECTED);
    expectedCdr.setLanguageLocationId("j");
    expectedCdr.setContentFile("k");
    expectedCdr.setMsgPlayDuration(333);
    expectedCdr.setCircleId("o");
    expectedCdr.setOperatorId("p");
    expectedCdr.setCallDisconnectReason(CallDisconnectReason.CONTENT_NOT_FOUND);
    expectedCdr.setWeekId("s");

    CallDetailRecordDto cdr =
        CdrHelper.csvLineToCdrDto(
            "20150513184533:58747ffc-6b7c-4abb-91d3-f099aa1bf5a3,"
                + "1111111111,c,d,e,123456,g,h,1001,j,k,123,456,o,p,q,3,s");
    assertEquals(expectedCdr, cdr);
  }
예제 #3
0
 @Test(expected = IllegalArgumentException.class)
 public void testInvalidFields() {
   CallDetailRecordDto cdr = CdrHelper.csvLineToCdrDto("a,b,c,d,e,f,g,h,i,j,k,l,m,o,p,q,r");
   assertNotNull(cdr);
 }
예제 #4
0
 @Test(expected = IllegalArgumentException.class)
 public void testTooFewFields() {
   CallDetailRecordDto cdr = CdrHelper.csvLineToCdrDto("a,b");
   assertNotNull(cdr);
 }