Search in sources :

Example 46 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 47 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 48 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 49 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)

Example 50 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)

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