Search in sources :

Example 11 with RequestMetadata

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

RequestMetadata (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.RequestMetadata)8 Test (org.junit.jupiter.api.Test)7 Iec60870Device (org.opensmartgridplatform.adapter.protocol.iec60870.domain.entities.Iec60870Device)6 ConnectionParameters (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.ConnectionParameters)4 DeviceConnection (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.DeviceConnection)3 ASdu (org.openmuc.j60870.ASdu)2 ConnectionEventListener (org.openmuc.j60870.ConnectionEventListener)2 IeQualifierOfInterrogation (org.openmuc.j60870.ie.IeQualifierOfInterrogation)2 LogItem (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.LogItem)2 JMSException (javax.jms.JMSException)1 CauseOfTransmission (org.openmuc.j60870.CauseOfTransmission)1 InformationObject (org.openmuc.j60870.ie.InformationObject)1 ClientConnectionAlreadyInCacheException (org.opensmartgridplatform.adapter.protocol.iec60870.domain.exceptions.ClientConnectionAlreadyInCacheException)1 ClientConnection (org.opensmartgridplatform.adapter.protocol.iec60870.domain.services.ClientConnection)1 ResponseMetadata (org.opensmartgridplatform.adapter.protocol.iec60870.domain.valueobjects.ResponseMetadata)1 ProtocolAdapterException (org.opensmartgridplatform.shared.exceptionhandling.ProtocolAdapterException)1 MessageMetadata (org.opensmartgridplatform.shared.infra.jms.MessageMetadata)1