use of io.cucumber.java.en.Given in project open-smart-grid-platform by OSGP.
the class BundledSetRandomisationSettingsSteps method theBundleRequestContainsASetRandomisationSettingsActionWithParameters.
@Given("the bundle request contains a set randomisation settings action with parameters")
public void theBundleRequestContainsASetRandomisationSettingsActionWithParameters(final Map<String, String> parameters) {
final SetRandomisationSettingsRequest action = new SetRandomisationSettingsRequestBuilder().fromParameterMap(parameters).build();
this.addActionToBundleRequest(action);
}
use of io.cucumber.java.en.Given in project open-smart-grid-platform by OSGP.
the class BundledSynchronizeTimeSteps method theBundleRequestContainsAValidSynchronizeTimeAction.
@Given("^the bundle request contains a valid synchronize time action for timezone \"([^\"]*)\"")
public void theBundleRequestContainsAValidSynchronizeTimeAction(final String timeZoneId) throws Throwable {
final SynchronizeTimeRequest action = new SynchronizeTimeRequest();
final ZoneId zone = ZoneId.of(timeZoneId);
final Instant now = Instant.now();
final ZoneRules rules = zone.getRules();
final int offset = (rules.getOffset(now).getTotalSeconds() / 60) * -1;
final boolean dst = rules.isDaylightSavings(now);
action.setDeviation(offset);
action.setDst(dst);
this.addActionToBundleRequest(action);
}
use of io.cucumber.java.en.Given in project open-smart-grid-platform by OSGP.
the class BundledGetAssociationLnObjectListSteps method theBundleRequestContainsAGetAssociationLnObjectsAction.
@Given("^the bundle request contains a get association ln objects action$")
public void theBundleRequestContainsAGetAssociationLnObjectsAction() throws Throwable {
final GetAssociationLnObjectsRequest action = new GetAssociationLnObjectsRequest();
this.addActionToBundleRequest(action);
}
use of io.cucumber.java.en.Given in project open-smart-grid-platform by OSGP.
the class BundledGetFirmwareVersionSteps method theBundleRequestContainsAGetFirmwareVersionAction.
@Given("^the bundle request contains a get firmware version action$")
public void theBundleRequestContainsAGetFirmwareVersionAction() throws Throwable {
final GetFirmwareVersionRequest action = new GetFirmwareVersionRequest();
this.addActionToBundleRequest(action);
}
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);
}
Aggregations