use of org.influxdb.impl.InfluxDBResultMapper in project cas by apereo.
the class InfluxDbConnectionFactoryTests method verifyWritePoint.
@Test
public void verifyWritePoint() {
final Point p = Point.measurement("events").time(System.currentTimeMillis(), TimeUnit.MILLISECONDS).addField("hostname", "cas.example.org").build();
factory.write(p, CAS_EVENTS_DATABASE);
final QueryResult result = factory.query("*", "events", CAS_EVENTS_DATABASE);
final InfluxDBResultMapper resultMapper = new InfluxDBResultMapper();
final List<InfluxEvent> resultEvents = resultMapper.toPOJO(result, InfluxEvent.class);
assertNotNull(resultEvents);
assertEquals(1, resultEvents.size());
assertEquals("cas.example.org", resultEvents.iterator().next().hostname);
}
Aggregations