Search in sources :

Example 51 with Given

use of io.cucumber.java.en.Given in project open-smart-grid-platform by OSGP.

the class BundledReadAlarmRegisterSteps method theBundleRequestContainsAReadAlarmRegisterAction.

@Given("^the bundle request contains a read alarm register action$")
public void theBundleRequestContainsAReadAlarmRegisterAction() throws Throwable {
    final ReadAlarmRegisterRequest action = new ReadAlarmRegisterRequest();
    this.addActionToBundleRequest(action);
}
Also used : ReadAlarmRegisterRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.ReadAlarmRegisterRequest) Given(io.cucumber.java.en.Given)

Example 52 with Given

use of io.cucumber.java.en.Given in project open-smart-grid-platform by OSGP.

the class BundledScanMbusChannelsSteps method theBundleRequestContainsAScanMbusChannelsAction.

@Given("^the bundle request contains a scan mbus channels action$")
public void theBundleRequestContainsAScanMbusChannelsAction() throws Throwable {
    final ScanMbusChannelsRequest action = new ScanMbusChannelsRequest();
    this.addActionToBundleRequest(action);
}
Also used : ScanMbusChannelsRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.ScanMbusChannelsRequest) Given(io.cucumber.java.en.Given)

Example 53 with Given

use of io.cucumber.java.en.Given in project open-smart-grid-platform by OSGP.

the class BundledSetAdministrativeStatusSteps method theBundleRequestContainsASetAdministrativeStatusAction.

@Given("^the bundle request contains a set administrative status action with parameters$")
public void theBundleRequestContainsASetAdministrativeStatusAction(final Map<String, String> parameters) throws Throwable {
    final SetAdministrativeStatusRequest action = new SetAdministrativeStatusRequestBuilder().fromParameterMap(parameters).build();
    this.addActionToBundleRequest(action);
}
Also used : SetAdministrativeStatusRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.SetAdministrativeStatusRequest) SetAdministrativeStatusRequestBuilder(org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.SetAdministrativeStatusRequestBuilder) Given(io.cucumber.java.en.Given)

Example 54 with Given

use of io.cucumber.java.en.Given in project open-smart-grid-platform by OSGP.

the class MBusClientObjectSteps method deviceSimulationOfMBusClientObject.

@Given("^device simulation of \"([^\"]*)\" with M-Bus client version (\\d+) values for channel (\\d+)$")
public void deviceSimulationOfMBusClientObject(final String deviceIdentification, final int version, final int channel, final Map<String, String> inputSettings) throws Throwable {
    this.deviceSimulatorSteps.deviceSimulationOfEquipmentIdentifier(deviceIdentification);
    final ObisCode obisCode = new ObisCode(0, channel, 24, 1, 0, 255);
    inputSettings.forEach((key, value) -> {
        switch(key) {
            case MBUS_PRIMARY_ADDRESS:
                this.setStandardAttribute(value, "unsigned", ATTRIBUTE_ID_PRIMARY_ADDRESS, obisCode);
                break;
            case MBUS_IDENTIFICATION_NUMBER:
                this.setIdentificationNumberAttribute(value, obisCode, version);
                break;
            case MBUS_MANUFACTURER_IDENTIFICATION:
                this.setManufacturerIdAttribute(value, obisCode);
                break;
            case MBUS_VERSION:
                this.setStandardAttribute(value, "unsigned", ATTRIBUTE_ID_VERSION, obisCode);
                break;
            case MBUS_DEVICE_TYPE_IDENTIFICATION:
                this.setStandardAttribute(value, "unsigned", ATTRIBUTE_ID_DEVICE_TYPE, obisCode);
                break;
            case MBUS_ENCRYPTION_KEY_STATUS:
                this.setStandardAttribute(value, "enumerate", ATTRIBUTE_ID_ENCRYPTION_KEY_STATUS, obisCode);
                break;
            default:
                throw new IllegalArgumentException("Unsupported attribute: " + key);
        }
    });
}
Also used : ObisCode(org.openmuc.jdlms.ObisCode) Given(io.cucumber.java.en.Given)

Example 55 with Given

use of io.cucumber.java.en.Given in project open-smart-grid-platform by OSGP.

the class BundledGetGsmDiagnosticSteps method theBundleRequestContainsAGetGsmDiagnosticAction.

@Given("^the bundle request contains a get gsm diagnostic action$")
public void theBundleRequestContainsAGetGsmDiagnosticAction() throws Throwable {
    final GetGsmDiagnosticRequest action = new GetGsmDiagnosticRequest();
    this.addActionToBundleRequest(action);
}
Also used : GetGsmDiagnosticRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetGsmDiagnosticRequest) Given(io.cucumber.java.en.Given)

Aggregations

Given (io.cucumber.java.en.Given)251 ReadSettingsHelper.getString (org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getString)27 File (java.io.File)19 ArrayList (java.util.ArrayList)13 CitrusResource (com.consol.citrus.annotations.CitrusResource)12 CitrusRuntimeException (com.consol.citrus.exceptions.CitrusRuntimeException)11 Transactional (org.springframework.transaction.annotation.Transactional)11 IOException (java.io.IOException)10 HashMap (java.util.HashMap)10 ExpandedAccountId (com.hedera.mirror.test.e2e.acceptance.props.ExpandedAccountId)9 Map (java.util.Map)9 Citrus (com.consol.citrus.Citrus)8 TestCaseRunner (com.consol.citrus.TestCaseRunner)8 CitrusFramework (com.consol.citrus.annotations.CitrusFramework)8 TestContext (com.consol.citrus.context.TestContext)8 Before (io.cucumber.java.Before)8 Scenario (io.cucumber.java.Scenario)8 Date (java.util.Date)8 Ssld (org.opensmartgridplatform.domain.core.entities.Ssld)8 Resource (org.springframework.core.io.Resource)8