Search in sources :

Example 1 with Location

use of org.opensmartgridplatform.adapter.kafka.da.domain.entities.Location in project open-smart-grid-platform by OSGP.

the class FeederSteps method givenAFeeder.

@Given("a feeder")
public void givenAFeeder(final Map<String, String> settings) {
    final Feeder feeder = new Feeder();
    final String substationIdentification = ReadSettingsHelper.getString(settings, PlatformDistributionAutomationKeys.SUBSTATION_IDENTIFICATION, PlatformDistributionAutomationDefaults.SUBSTATION_IDENTIFICATION);
    final Location location = this.locationSteps.findLocation(substationIdentification);
    feeder.setLocation(location);
    feeder.setFeederNumber(ReadSettingsHelper.getInteger(settings, PlatformDistributionAutomationKeys.FEEDER_NUMBER, PlatformDistributionAutomationDefaults.FEEDER_NUMBER));
    feeder.setFieldCode(ReadSettingsHelper.getString(settings, PlatformDistributionAutomationKeys.FEEDER_FIELD_CODE));
    feeder.setName(ReadSettingsHelper.getString(settings, PlatformDistributionAutomationKeys.FEEDER_NAME, PlatformDistributionAutomationDefaults.FEEDER_NAME));
    feeder.setAssetLabel(ReadSettingsHelper.getString(settings, PlatformDistributionAutomationKeys.FEEDER_ASSET_LABEL));
    this.feederRepository.save(feeder);
}
Also used : Feeder(org.opensmartgridplatform.adapter.kafka.da.domain.entities.Feeder) Location(org.opensmartgridplatform.adapter.kafka.da.domain.entities.Location) Given(io.cucumber.java.en.Given)

Example 2 with Location

use of org.opensmartgridplatform.adapter.kafka.da.domain.entities.Location in project open-smart-grid-platform by OSGP.

the class LocationSteps method givenALocation.

@Given("a location")
public void givenALocation(final Map<String, String> settings) {
    final Location location = new Location();
    location.setSubstationIdentification(ReadSettingsHelper.getString(settings, PlatformDistributionAutomationKeys.SUBSTATION_IDENTIFICATION, PlatformDistributionAutomationKeys.SUBSTATION_IDENTIFICATION));
    location.setName(ReadSettingsHelper.getString(settings, PlatformDistributionAutomationKeys.SUBSTATION_NAME, PlatformDistributionAutomationDefaults.SUBSTATION_NAME));
    this.locationRepository.save(location);
}
Also used : Location(org.opensmartgridplatform.adapter.kafka.da.domain.entities.Location) Given(io.cucumber.java.en.Given)

Aggregations

Given (io.cucumber.java.en.Given)2 Location (org.opensmartgridplatform.adapter.kafka.da.domain.entities.Location)2 Feeder (org.opensmartgridplatform.adapter.kafka.da.domain.entities.Feeder)1