Class InfluxConnectorTest

java.lang.Object
test.de.iip_ecosphere.platform.connectors.influxv3.InfluxConnectorTest

@PrepareForTest(com.influxdb.v3.client.InfluxDBClient.class) public class InfluxConnectorTest extends Object
Tests the InfluxConnector.
Author:
Holger Eichelberger, SSE
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private class 
    Customizes the type translators/assertions for this case.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private List<test.de.iip_ecosphere.platform.connectors.MachineData>
     
    private com.influxdb.v3.client.Point
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    private Stream<com.influxdb.v3.client.PointValues>
    Creates/returns INFLUX data/query result for mocking.
    void
    Tests the InfluxConnector.
    private int
    toInt(com.influxdb.v3.client.Point point, String field, int dflt)
    Turns an INFLUX object value to an int.
    private test.de.iip_ecosphere.platform.connectors.MachineCommand
    toMachineCommand(com.influxdb.v3.client.Point point)
    Turns a point back to a machine command.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • written

      private com.influxdb.v3.client.Point written
    • expectedData

      private List<test.de.iip_ecosphere.platform.connectors.MachineData> expectedData
  • Constructor Details

    • InfluxConnectorTest

      public InfluxConnectorTest()
  • Method Details

    • getDataTable

      private Stream<com.influxdb.v3.client.PointValues> getDataTable()
      Creates/returns INFLUX data/query result for mocking.
      Returns:
      the table(s)
    • toMachineCommand

      private test.de.iip_ecosphere.platform.connectors.MachineCommand toMachineCommand(com.influxdb.v3.client.Point point)
      Turns a point back to a machine command.
      Parameters:
      point - the point
      Returns:
      the machine command instance, null if value access is not possible
    • toInt

      private int toInt(com.influxdb.v3.client.Point point, String field, int dflt)
      Turns an INFLUX object value to an int.
      Parameters:
      field - the field to read the value from
      dflt - a default value if the stored object does not exist or cannot be converted
      fields - the point fields to read the value from
      Returns:
      the int value or dflt
    • testInfluxConnector

      public void testInfluxConnector() throws Exception
      Tests the InfluxConnector.
      Throws:
      Exception - shall not occur