use of org.killbill.billing.ObjectType in project killbill by killbill.
the class TestDefaultCustomFieldCreationEvent method testPojo.
@Test(groups = "fast")
public void testPojo() throws Exception {
final UUID customFieldId = UUID.randomUUID();
final UUID objectId = UUID.randomUUID();
final ObjectType objectType = ObjectType.ACCOUNT_EMAIL;
final DefaultCustomFieldCreationEvent event = new DefaultCustomFieldCreationEvent(customFieldId, objectId, objectType, 1L, 2L, UUID.randomUUID());
Assert.assertEquals(event.getBusEventType(), BusInternalEventType.CUSTOM_FIELD_CREATION);
Assert.assertEquals(event.getObjectId(), objectId);
Assert.assertEquals(event.getObjectType(), objectType);
Assert.assertEquals(event, event);
Assert.assertEquals(event, new DefaultCustomFieldCreationEvent(customFieldId, objectId, objectType, 1L, 2L, UUID.randomUUID()));
}
use of org.killbill.billing.ObjectType in project killbill by killbill.
the class TestDefaultCustomFieldCreationEvent method testSerialization.
@Test(groups = "fast")
public void testSerialization() throws Exception {
final ObjectMapper objectMapper = new ObjectMapper();
final UUID customFieldId = UUID.randomUUID();
final UUID objectId = UUID.randomUUID();
final ObjectType objectType = ObjectType.ACCOUNT_EMAIL;
final DefaultCustomFieldCreationEvent event = new DefaultCustomFieldCreationEvent(customFieldId, objectId, objectType, 1L, 2L, UUID.randomUUID());
final String json = objectMapper.writeValueAsString(event);
final DefaultCustomFieldCreationEvent fromJson = objectMapper.readValue(json, DefaultCustomFieldCreationEvent.class);
Assert.assertEquals(fromJson, event);
}
use of org.killbill.billing.ObjectType in project killbill by killbill.
the class TestDefaultCustomFieldDeletionEvent method testSerialization.
@Test(groups = "fast")
public void testSerialization() throws Exception {
final ObjectMapper objectMapper = new ObjectMapper();
final UUID customFieldId = UUID.randomUUID();
final UUID objectId = UUID.randomUUID();
final ObjectType objectType = ObjectType.ACCOUNT_EMAIL;
final UUID userToken = UUID.randomUUID();
final DefaultCustomFieldDeletionEvent event = new DefaultCustomFieldDeletionEvent(customFieldId, objectId, objectType, 1L, 2L, UUID.randomUUID());
final String json = objectMapper.writeValueAsString(event);
final DefaultCustomFieldDeletionEvent fromJson = objectMapper.readValue(json, DefaultCustomFieldDeletionEvent.class);
Assert.assertEquals(fromJson, event);
}
use of org.killbill.billing.ObjectType in project killbill by killbill.
the class TestDefaultCustomFieldDeletionEvent method testPojo.
@Test(groups = "fast")
public void testPojo() throws Exception {
final UUID customFieldId = UUID.randomUUID();
final UUID objectId = UUID.randomUUID();
final ObjectType objectType = ObjectType.ACCOUNT_EMAIL;
final UUID userToken = UUID.randomUUID();
final DefaultCustomFieldDeletionEvent event = new DefaultCustomFieldDeletionEvent(customFieldId, objectId, objectType, 1L, 2L, UUID.randomUUID());
Assert.assertEquals(event.getBusEventType(), BusInternalEventType.CUSTOM_FIELD_DELETION);
Assert.assertEquals(event.getObjectId(), objectId);
Assert.assertEquals(event.getObjectType(), objectType);
Assert.assertEquals(event, event);
Assert.assertEquals(event, new DefaultCustomFieldDeletionEvent(customFieldId, objectId, objectType, 1L, 2L, UUID.randomUUID()));
}
use of org.killbill.billing.ObjectType in project killbill by killbill.
the class DefaultOverdueConfigCache method initializeCacheLoaderArgument.
private CacheLoaderArgument initializeCacheLoaderArgument() {
final LoaderCallback loaderCallback = new LoaderCallback() {
@Override
public OverdueConfig loadOverdueConfig(final String overdueConfigXML) throws OverdueApiException {
final InputStream overdueConfigStream = new ByteArrayInputStream(overdueConfigXML.getBytes());
try {
return XMLLoader.getObjectFromStream(overdueConfigStream, DefaultOverdueConfig.class);
} catch (final Exception e) {
throw new OverdueApiException(ErrorCode.OVERDUE_INVALID_FOR_TENANT, "Problem encountered loading overdue config ", e);
}
}
};
final Object[] args = new Object[1];
args[0] = loaderCallback;
final ObjectType irrelevant = null;
final InternalTenantContext notUsed = null;
return new CacheLoaderArgument(irrelevant, args, notUsed);
}
Aggregations