Search in sources :

Example 6 with ConnectionParameters

use of org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.ConnectionParameters 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

ConnectionParameters (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.ConnectionParameters)5 DeviceConnection (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.DeviceConnection)5 Test (org.junit.jupiter.api.Test)3 RequestMetadata (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.RequestMetadata)3 Connection (org.openmuc.j60870.Connection)2 ClientConnection (org.opensmartgridplatform.adapter.protocol.iec60870.domain.services.ClientConnection)2 IOException (java.io.IOException)1 InetAddress (java.net.InetAddress)1 ASdu (org.openmuc.j60870.ASdu)1 CauseOfTransmission (org.openmuc.j60870.CauseOfTransmission)1 ClientConnectionBuilder (org.openmuc.j60870.ClientConnectionBuilder)1 IeQualifierOfInterrogation (org.openmuc.j60870.ie.IeQualifierOfInterrogation)1 Iec60870Device (org.opensmartgridplatform.adapter.protocol.iec60870.domain.entities.Iec60870Device)1 ClientConnectionAlreadyInCacheException (org.opensmartgridplatform.adapter.protocol.iec60870.domain.exceptions.ClientConnectionAlreadyInCacheException)1 LogItem (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.LogItem)1 ResponseMetadata (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.ResponseMetadata)1 ConnectionFailureException (org.opensmartgridplatform.shared.exceptionhandling.ConnectionFailureException)1