use of org.killbill.billing.util.tag.DefaultTagDefinition in project killbill by killbill.
the class TestDefaultControlTagDeletionEvent method testSerialization.
@Test(groups = "fast")
public void testSerialization() throws Exception {
final ObjectMapper objectMapper = new ObjectMapper();
final UUID tagId = UUID.randomUUID();
final UUID objectId = UUID.randomUUID();
final ObjectType objectType = ObjectType.ACCOUNT_EMAIL;
final UUID tagDefinitionId = UUID.randomUUID();
final String tagDefinitionName = UUID.randomUUID().toString();
final String tagDefinitionDescription = UUID.randomUUID().toString();
final boolean controlTag = false;
final TagDefinition tagDefinition = new DefaultTagDefinition(tagDefinitionId, tagDefinitionName, tagDefinitionDescription, controlTag);
final UUID userToken = UUID.randomUUID();
final DefaultControlTagDeletionEvent event = new DefaultControlTagDeletionEvent(tagId, objectId, objectType, tagDefinition, 1L, 2L, UUID.randomUUID());
final String json = objectMapper.writeValueAsString(event);
final DefaultControlTagDeletionEvent fromJson = objectMapper.readValue(json, DefaultControlTagDeletionEvent.class);
Assert.assertEquals(fromJson, event);
}
use of org.killbill.billing.util.tag.DefaultTagDefinition in project killbill by killbill.
the class TestDefaultUserTagCreationEvent method testPojo.
@Test(groups = "fast")
public void testPojo() throws Exception {
final UUID tagId = UUID.randomUUID();
final UUID objectId = UUID.randomUUID();
final ObjectType objectType = ObjectType.ACCOUNT_EMAIL;
final UUID tagDefinitionId = UUID.randomUUID();
final String tagDefinitionName = UUID.randomUUID().toString();
final String tagDefinitionDescription = UUID.randomUUID().toString();
final boolean controlTag = false;
final TagDefinition tagDefinition = new DefaultTagDefinition(tagDefinitionId, tagDefinitionName, tagDefinitionDescription, controlTag);
final UUID userToken = UUID.randomUUID();
final DefaultUserTagCreationEvent event = new DefaultUserTagCreationEvent(tagId, objectId, objectType, tagDefinition, 1L, 2L, UUID.randomUUID());
Assert.assertEquals(event.getBusEventType(), BusInternalEvent.BusInternalEventType.USER_TAG_CREATION);
Assert.assertEquals(event.getTagId(), tagId);
Assert.assertEquals(event.getObjectId(), objectId);
Assert.assertEquals(event.getObjectType(), objectType);
Assert.assertEquals(event.getTagDefinition(), tagDefinition);
Assert.assertEquals(event.getTagDefinition().getId(), tagDefinitionId);
Assert.assertEquals(event.getTagDefinition().getName(), tagDefinitionName);
Assert.assertEquals(event.getTagDefinition().getDescription(), tagDefinitionDescription);
Assert.assertEquals(event, event);
Assert.assertEquals(event, new DefaultUserTagCreationEvent(tagId, objectId, objectType, tagDefinition, 1L, 2L, UUID.randomUUID()));
Assert.assertTrue(event.equals(event));
Assert.assertTrue(event.equals(new DefaultUserTagCreationEvent(tagId, objectId, objectType, tagDefinition, 1L, 2L, UUID.randomUUID())));
}
use of org.killbill.billing.util.tag.DefaultTagDefinition in project killbill by killbill.
the class TestDefaultUserTagDefinitionCreationEvent method testSerialization.
@Test(groups = "fast")
public void testSerialization() throws Exception {
final ObjectMapper objectMapper = new ObjectMapper();
final UUID tagDefinitionId = UUID.randomUUID();
final String tagDefinitionName = UUID.randomUUID().toString();
final String tagDefinitionDescription = UUID.randomUUID().toString();
final boolean controlTag = false;
final TagDefinition tagDefinition = new DefaultTagDefinition(tagDefinitionId, tagDefinitionName, tagDefinitionDescription, controlTag);
final UUID userToken = UUID.randomUUID();
final DefaultUserTagDefinitionCreationEvent event = new DefaultUserTagDefinitionCreationEvent(tagDefinitionId, tagDefinition, 1L, 2L, UUID.randomUUID());
final String json = objectMapper.writeValueAsString(event);
final DefaultUserTagDefinitionCreationEvent fromJson = objectMapper.readValue(json, DefaultUserTagDefinitionCreationEvent.class);
Assert.assertEquals(fromJson, event);
}
use of org.killbill.billing.util.tag.DefaultTagDefinition in project killbill by killbill.
the class TestDefaultUserTagDefinitionCreationEvent method testPojo.
@Test(groups = "fast")
public void testPojo() throws Exception {
final UUID tagDefinitionId = UUID.randomUUID();
final String tagDefinitionName = UUID.randomUUID().toString();
final String tagDefinitionDescription = UUID.randomUUID().toString();
final boolean controlTag = false;
final TagDefinition tagDefinition = new DefaultTagDefinition(tagDefinitionId, tagDefinitionName, tagDefinitionDescription, controlTag);
final UUID userToken = UUID.randomUUID();
final DefaultUserTagDefinitionCreationEvent event = new DefaultUserTagDefinitionCreationEvent(tagDefinitionId, tagDefinition, 1L, 2L, UUID.randomUUID());
Assert.assertEquals(event.getBusEventType(), BusInternalEvent.BusInternalEventType.USER_TAGDEFINITION_CREATION);
Assert.assertEquals(event.getTagDefinitionId(), tagDefinitionId);
Assert.assertEquals(event.getTagDefinition(), tagDefinition);
Assert.assertEquals(event.getTagDefinition().getId(), tagDefinitionId);
Assert.assertEquals(event.getTagDefinition().getName(), tagDefinitionName);
Assert.assertEquals(event.getTagDefinition().getDescription(), tagDefinitionDescription);
Assert.assertEquals(event, event);
Assert.assertEquals(event, new DefaultUserTagDefinitionCreationEvent(tagDefinitionId, tagDefinition, 1L, 2L, UUID.randomUUID()));
Assert.assertTrue(event.equals(event));
Assert.assertTrue(event.equals(new DefaultUserTagDefinitionCreationEvent(tagDefinitionId, tagDefinition, 1L, 2L, UUID.randomUUID())));
}
use of org.killbill.billing.util.tag.DefaultTagDefinition in project killbill by killbill.
the class TestDefaultUserTagDefinitionDeletionEvent method testPojo.
@Test(groups = "fast")
public void testPojo() throws Exception {
final UUID tagDefinitionId = UUID.randomUUID();
final String tagDefinitionName = UUID.randomUUID().toString();
final String tagDefinitionDescription = UUID.randomUUID().toString();
final boolean controlTag = false;
final TagDefinition tagDefinition = new DefaultTagDefinition(tagDefinitionId, tagDefinitionName, tagDefinitionDescription, controlTag);
final UUID userToken = UUID.randomUUID();
final DefaultUserTagDefinitionDeletionEvent event = new DefaultUserTagDefinitionDeletionEvent(tagDefinitionId, tagDefinition, 1L, 2L, UUID.randomUUID());
Assert.assertEquals(event.getBusEventType(), BusInternalEvent.BusInternalEventType.USER_TAGDEFINITION_DELETION);
Assert.assertEquals(event.getTagDefinitionId(), tagDefinitionId);
Assert.assertEquals(event.getTagDefinition(), tagDefinition);
Assert.assertEquals(event.getTagDefinition().getId(), tagDefinitionId);
Assert.assertEquals(event.getTagDefinition().getName(), tagDefinitionName);
Assert.assertEquals(event.getTagDefinition().getDescription(), tagDefinitionDescription);
Assert.assertEquals(event, event);
Assert.assertEquals(event, new DefaultUserTagDefinitionDeletionEvent(tagDefinitionId, tagDefinition, 1L, 2L, UUID.randomUUID()));
Assert.assertTrue(event.equals(event));
Assert.assertTrue(event.equals(new DefaultUserTagDefinitionDeletionEvent(tagDefinitionId, tagDefinition, 1L, 2L, UUID.randomUUID())));
}
Aggregations