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);
}
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);
}
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);
}
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);
}
});
}
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);
}
Aggregations