use of org.thingsboard.server.common.data.edge.EdgeEvent in project thingsboard by thingsboard.
the class BaseEdgeEventServiceTest method saveEdgeEventWithProvidedTime.
private EdgeEvent saveEdgeEventWithProvidedTime(long time, EdgeId edgeId, EntityId entityId, TenantId tenantId) throws Exception {
EdgeEvent edgeEvent = generateEdgeEvent(tenantId, edgeId, entityId, EdgeEventActionType.ADDED);
edgeEvent.setId(new EdgeEventId(Uuids.startOf(time)));
return edgeEventService.save(edgeEvent);
}
use of org.thingsboard.server.common.data.edge.EdgeEvent in project thingsboard by thingsboard.
the class BaseEdgeEventServiceTest method saveEdgeEvent.
@Test
public void saveEdgeEvent() throws Exception {
EdgeId edgeId = new EdgeId(Uuids.timeBased());
DeviceId deviceId = new DeviceId(Uuids.timeBased());
EdgeEvent edgeEvent = generateEdgeEvent(null, edgeId, deviceId, EdgeEventActionType.ADDED);
EdgeEvent saved = edgeEventService.save(edgeEvent);
Assert.assertEquals(saved.getTenantId(), edgeEvent.getTenantId());
Assert.assertEquals(saved.getEdgeId(), edgeEvent.getEdgeId());
Assert.assertEquals(saved.getEntityId(), edgeEvent.getEntityId());
Assert.assertEquals(saved.getType(), edgeEvent.getType());
Assert.assertEquals(saved.getAction(), edgeEvent.getAction());
Assert.assertEquals(saved.getBody(), edgeEvent.getBody());
}
Aggregations