use of org.thingsboard.server.common.data.id.EventId in project thingsboard by thingsboard.
the class JpaBaseEventDaoTest method getEvent.
private Event getEvent(UUID eventId, UUID tenantId, UUID entityId) {
Event event = new Event();
event.setId(new EventId(eventId));
event.setTenantId(new TenantId(tenantId));
EntityId deviceId = new DeviceId(entityId);
event.setEntityId(deviceId);
event.setUid(event.getId().getId().toString());
event.setType(STATS);
ObjectMapper mapper = new ObjectMapper();
try {
JsonNode jsonNode = mapper.readTree("{\"key\":\"value\"}");
event.setBody(jsonNode);
} catch (IOException e) {
log.error(e.getMessage(), e);
}
return event;
}
Aggregations