Search in sources :

Example 1 with ControlTagDefinitionDeletionInternalEvent

use of org.killbill.billing.events.ControlTagDefinitionDeletionInternalEvent in project killbill by killbill.

the class TestTagEventBuilder method testNewControlTagDefinitionDeletionEvent.

@Test(groups = "fast")
public void testNewControlTagDefinitionDeletionEvent() throws Exception {
    final UUID tagDefinitionId = ControlTagType.AUTO_PAY_OFF.getId();
    final String tagDefinitionName = UUID.randomUUID().toString();
    final String tagDefinitionDescription = UUID.randomUUID().toString();
    final boolean controlTag = true;
    final TagDefinition tagDefinition = new DefaultTagDefinition(tagDefinitionId, tagDefinitionName, tagDefinitionDescription, controlTag);
    final UUID userToken = internalCallContext.getUserToken();
    final TagEventBuilder tagEventBuilder = new TagEventBuilder();
    final TagDefinitionInternalEvent event = tagEventBuilder.newControlTagDefinitionDeletionEvent(tagDefinitionId, new TagDefinitionModelDao(tagDefinition), 1L, 2L, UUID.randomUUID());
    Assert.assertTrue(event instanceof ControlTagDefinitionDeletionInternalEvent);
    Assert.assertEquals(event, new DefaultControlTagDefinitionDeletionEvent(tagDefinitionId, tagDefinition, 1L, 2L, UUID.randomUUID()));
    Assert.assertTrue(event.equals(new DefaultControlTagDefinitionDeletionEvent(tagDefinitionId, tagDefinition, 1L, 2L, UUID.randomUUID())));
    verifyTagDefinitionEvent(tagDefinitionId, tagDefinitionName, tagDefinitionDescription, tagDefinition, userToken, event);
}
Also used : TagDefinition(org.killbill.billing.util.tag.TagDefinition) DefaultTagDefinition(org.killbill.billing.util.tag.DefaultTagDefinition) DefaultTagDefinition(org.killbill.billing.util.tag.DefaultTagDefinition) TagDefinitionInternalEvent(org.killbill.billing.events.TagDefinitionInternalEvent) TagDefinitionModelDao(org.killbill.billing.util.tag.dao.TagDefinitionModelDao) UUID(java.util.UUID) ControlTagDefinitionDeletionInternalEvent(org.killbill.billing.events.ControlTagDefinitionDeletionInternalEvent) Test(org.testng.annotations.Test)

Aggregations

UUID (java.util.UUID)1 ControlTagDefinitionDeletionInternalEvent (org.killbill.billing.events.ControlTagDefinitionDeletionInternalEvent)1 TagDefinitionInternalEvent (org.killbill.billing.events.TagDefinitionInternalEvent)1 DefaultTagDefinition (org.killbill.billing.util.tag.DefaultTagDefinition)1 TagDefinition (org.killbill.billing.util.tag.TagDefinition)1 TagDefinitionModelDao (org.killbill.billing.util.tag.dao.TagDefinitionModelDao)1 Test (org.testng.annotations.Test)1