urbanairship-core/src/test/java/com/urbanairship/analytics/CustomEventTest.java
@Test
    public void testCustomEvent() throws JSONException {
        String eventName = createFixedSizeString('a', 255);
        String interactionId = createFixedSizeString('b', 255);
        String interactionType = createFixedSizeString('c', 255);
        String transactionId = createFixedSizeString('d', 255);
        String templateType = createFixedSizeString('e', 255);

        CustomEvent event = CustomEvent.newBuilder(eventName)
                .setTransactionId(transactionId)
                .setInteraction(interactionType, interactionId)
                .setEventValue(100.123456)
                .setTemplateType(templateType)
                .build();

        EventTestUtils.validateEventValue(event, "event_name", eventName);
        EventTestUtils.validateEventValue(event, "event_value", 100123456L);
        EventTestUtils.validateEventValue(event, "transaction_id", transactionId);
        EventTestUtils.validateEventValue(event, "interaction_id", interactionId);
        EventTestUtils.validateEventValue(event, "interaction_type", interactionType);
        EventTestUtils.validateEventValue(event, "template_type", templateType);
    }
/**
     * Test creating a custom event.
     */
Test creating a custom event.
Test creating a custom event .
@Test
    public void testCustomEvent() throws JSONException {
        String eventName = createFixedSizeString('a', 255);
        String interactionId = createFixedSizeString('b', 255);
        String interactionType = createFixedSizeString('c', 255);
        String transactionId = createFixedSizeString('d', 255);
        String templateType = createFixedSizeString('e', 255);
        CustomEvent event = CustomEvent.newBuilder(eventName)
                .setTransactionId(transactionId)
                .setInteraction(interactionType, interactionId)
                .setEventValue(100.123456)
                .setTemplateType(templateType)
                .build();
        EventTestUtils.validateEventValue(event, "event_name", eventName);
        EventTestUtils.validateEventValue(event, "event_value", 100123456L);
        EventTestUtils.validateEventValue(event, "transaction_id", transactionId);
        EventTestUtils.validateEventValue(event, "interaction_id", interactionId);
        EventTestUtils.validateEventValue(event, "interaction_type", interactionType);
        EventTestUtils.validateEventValue(event, "template_type", templateType);
    }
@ Test public void testCustomEvent ( ) throws JSONException { String eventName = createFixedSizeString ( 'a' , 255 ) ; String interactionId = createFixedSizeString ( 'b' , 255 ) ; String interactionType = createFixedSizeString ( 'c' , 255 ) ; String transactionId = createFixedSizeString ( 'd' , 255 ) ; String templateType = createFixedSizeString ( 'e' , 255 ) ; CustomEvent event = CustomEvent . newBuilder ( eventName ) . setTransactionId ( transactionId ) . setInteraction ( interactionType , interactionId ) . setEventValue ( 100.123456 ) . setTemplateType ( templateType ) . build ( ) ; EventTestUtils . validateEventValue ( event , "event_name" , eventName ) ; EventTestUtils . validateEventValue ( event , "event_value" , 100123456L ) ; EventTestUtils . validateEventValue ( event , "transaction_id" , transactionId ) ; EventTestUtils . validateEventValue ( event , "interaction_id" , interactionId ) ; EventTestUtils . validateEventValue ( event , "interaction_type" , interactionType ) ; EventTestUtils . validateEventValue ( event , "template_type" , templateType ) ; }
Test creating a custom event.
Test creating a custom event .