Search in sources :

Example 21 with Given

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

the class BundledSetAlarmNotificationsSteps method theBundleRequestContainsASetAlarmNotificationsAction.

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

Example 22 with Given

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);
}
Also used : SetRandomisationSettingsRequestBuilder(org.opensmartgridplatform.cucumber.platform.smartmetering.support.ws.smartmetering.bundle.SetRandomisationSettingsRequestBuilder) SetRandomisationSettingsRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.SetRandomisationSettingsRequest) Given(io.cucumber.java.en.Given)

Example 23 with Given

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);
}
Also used : ZoneId(java.time.ZoneId) Instant(java.time.Instant) ZoneRules(java.time.zone.ZoneRules) SynchronizeTimeRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.SynchronizeTimeRequest) Given(io.cucumber.java.en.Given)

Example 24 with Given

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);
}
Also used : GetAssociationLnObjectsRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetAssociationLnObjectsRequest) Given(io.cucumber.java.en.Given)

Example 25 with Given

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);
}
Also used : GetFirmwareVersionRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetFirmwareVersionRequest) 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