Search in sources :

Example 26 with Given

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

the class BundledGetFirmwareVersionSteps method theBundleRequestContainsAGetFirmwareVersionGasAction.

@Given("^the bundle request contains a get firmware version gas action$")
public void theBundleRequestContainsAGetFirmwareVersionGasAction(final Map<String, String> settings) throws Throwable {
    final GetFirmwareVersionGasRequest action = new GetFirmwareVersionGasRequest();
    action.setDeviceIdentification(getString(settings, PlatformSmartmeteringKeys.DEVICE_IDENTIFICATION, PlatformSmartmeteringDefaults.DEVICE_IDENTIFICATION));
    this.addActionToBundleRequest(action);
}
Also used : GetFirmwareVersionGasRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetFirmwareVersionGasRequest) Given(io.cucumber.java.en.Given)

Example 27 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 28 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 29 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 30 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)

Aggregations

Given (io.cucumber.java.en.Given)125 ReadSettingsHelper.getString (org.opensmartgridplatform.cucumber.core.ReadSettingsHelper.getString)27 ArrayList (java.util.ArrayList)11 Transactional (org.springframework.transaction.annotation.Transactional)11 Ssld (org.opensmartgridplatform.domain.core.entities.Ssld)8 Date (java.util.Date)7 DeviceOutputSetting (org.opensmartgridplatform.domain.core.entities.DeviceOutputSetting)6 ActivityCalendar (org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.activitycalendar.ActivityCalendar)5 Device (org.opensmartgridplatform.domain.core.entities.Device)5 RelayType (org.opensmartgridplatform.domain.core.valueobjects.RelayType)5 ByteString (com.google.protobuf.ByteString)4 Account (io.syndesis.qe.account.Account)4 File (java.io.File)4 List (java.util.List)4 ElementsCollection (com.codeborne.selenide.ElementsCollection)3 Field (java.lang.reflect.Field)3 HashMap (java.util.HashMap)3 ResponseData (org.opensmartgridplatform.adapter.ws.domain.entities.ResponseData)3 ResponseDataBuilder (org.opensmartgridplatform.cucumber.platform.glue.steps.database.ws.ResponseDataBuilder)3 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2