Search in sources :

Example 11 with DeviceConnection

use of org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.DeviceConnection in project open-smart-grid-platform by OSGP.

the class ConnectRequestMessageProcessorTest method testProcessShouldSendGeneralInInterrogation.

@Test
void testProcessShouldSendGeneralInInterrogation() throws Exception {
    // Arrange
    final ConnectionParameters connectionParameters = ConnectionParameters.newBuilder().deviceIdentification(DEVICE_IDENTIFICATION).build();
    final DeviceConnection deviceConnection = new DeviceConnection(this.connection, connectionParameters);
    final RequestMetadata requestMetadata = RequestMetadataFactory.forDevice(DEVICE_IDENTIFICATION);
    // Act
    this.connectRequestMessageProcessor.process(deviceConnection, requestMetadata);
    // Assert
    verify(this.generalInterrogationService).sendGeneralInterrogation(deviceConnection, requestMetadata);
}
Also used : ConnectionParameters(org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.ConnectionParameters) DeviceConnection(org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.DeviceConnection) RequestMetadata(org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.RequestMetadata) Test(org.junit.jupiter.api.Test)

Aggregations

DeviceConnection (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.DeviceConnection)9 ConnectionParameters (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.ConnectionParameters)5 Connection (org.openmuc.j60870.Connection)4 RequestMetadata (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.RequestMetadata)4 Test (org.junit.jupiter.api.Test)3 IeQualifierOfInterrogation (org.openmuc.j60870.ie.IeQualifierOfInterrogation)3 ClientConnection (org.opensmartgridplatform.adapter.protocol.iec60870.domain.services.ClientConnection)3 ClientConnectionEventListener (org.opensmartgridplatform.adapter.protocol.iec60870.domain.services.ClientConnectionEventListener)3 Given (io.cucumber.java.en.Given)2 ASdu (org.openmuc.j60870.ASdu)2 LogItem (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.LogItem)2 ConnectionFailureException (org.opensmartgridplatform.shared.exceptionhandling.ConnectionFailureException)2 Then (io.cucumber.java.en.Then)1 When (io.cucumber.java.en.When)1 IOException (java.io.IOException)1 InetAddress (java.net.InetAddress)1 JMSException (javax.jms.JMSException)1 CauseOfTransmission (org.openmuc.j60870.CauseOfTransmission)1 ClientConnectionBuilder (org.openmuc.j60870.ClientConnectionBuilder)1 ConnectionEventListener (org.openmuc.j60870.ConnectionEventListener)1