Search in sources :

Example 1 with GetPowerQualityProfileRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetPowerQualityProfileRequest in project open-smart-grid-platform by OSGP.

the class GetGetPowerQualityProfileRequestMappingTest method makeRequest.

private GetPowerQualityProfileRequest makeRequest() {
    final GetPowerQualityProfileRequest result = new GetPowerQualityProfileRequest();
    result.setProfileType("PRIVATE");
    result.setBeginDate(this.toGregorianCalendar(BEGIN_DATE));
    result.setEndDate(this.toGregorianCalendar(END_DATE));
    result.setSelectedValues(new CaptureObjectDefinitions());
    return result;
}
Also used : GetPowerQualityProfileRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetPowerQualityProfileRequest) CaptureObjectDefinitions(org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.CaptureObjectDefinitions)

Example 2 with GetPowerQualityProfileRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetPowerQualityProfileRequest in project open-smart-grid-platform by OSGP.

the class GetGetPowerQualityProfileRequestMappingTest method shouldConvertGetPowerQualityProfileRequest.

@Test
public void shouldConvertGetPowerQualityProfileRequest() {
    final GetPowerQualityProfileRequest source = this.makeRequest();
    final GetPowerQualityProfileRequestData result = this.mapper.map(source, GetPowerQualityProfileRequestData.class);
    assertThat(result).as(MAPPED_OBJECT_NULL_MESSAGE).isNotNull();
    assertThat(result.getProfileType()).as(MAPPED_FIELD_VALUE_MESSAGE).isEqualTo(source.getProfileType());
    assertThat(this.toGregorianCalendar(new DateTime(result.getBeginDate()))).as(MAPPED_FIELD_VALUE_MESSAGE).isEqualTo(source.getBeginDate());
    assertThat(this.toGregorianCalendar(new DateTime(result.getEndDate()))).as(MAPPED_FIELD_VALUE_MESSAGE).isEqualTo(source.getEndDate());
}
Also used : GetPowerQualityProfileRequestData(org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetPowerQualityProfileRequestData) GetPowerQualityProfileRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetPowerQualityProfileRequest) DateTime(org.joda.time.DateTime) Test(org.junit.jupiter.api.Test)

Example 3 with GetPowerQualityProfileRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetPowerQualityProfileRequest in project open-smart-grid-platform by OSGP.

the class BundledGetPowerQualityProfileDataSteps method theBundleRequestContainsAGetPowerQualityProfileRequestAction.

@Given("^the bundle request contains a get power quality profile request with parameters$")
public void theBundleRequestContainsAGetPowerQualityProfileRequestAction(final Map<String, String> parameters) throws Throwable {
    final GetPowerQualityProfileRequest action = new GetPowerQualityProfileRequestBuilder().fromParameterMap(parameters).build();
    this.addActionToBundleRequest(action);
}
Also used : GetPowerQualityProfileRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetPowerQualityProfileRequest) GetPowerQualityProfileRequestBuilder(org.opensmartgridplatform.cucumber.platform.smartmetering.builders.GetPowerQualityProfileRequestBuilder) Given(io.cucumber.java.en.Given)

Example 4 with GetPowerQualityProfileRequest

use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetPowerQualityProfileRequest in project open-smart-grid-platform by OSGP.

the class GetPowerQualityProfileRequestBuilder method build.

public GetPowerQualityProfileRequest build() {
    final GetPowerQualityProfileRequest request = new GetPowerQualityProfileRequest();
    request.setProfileType(this.profileType);
    request.setBeginDate(this.beginDate);
    request.setEndDate(this.endDate);
    request.setSelectedValues(this.selectedValues);
    return request;
}
Also used : GetPowerQualityProfileRequest(org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetPowerQualityProfileRequest)

Aggregations

GetPowerQualityProfileRequest (org.opensmartgridplatform.adapter.ws.schema.smartmetering.bundle.GetPowerQualityProfileRequest)4 Given (io.cucumber.java.en.Given)1 DateTime (org.joda.time.DateTime)1 Test (org.junit.jupiter.api.Test)1 CaptureObjectDefinitions (org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.CaptureObjectDefinitions)1 GetPowerQualityProfileRequestBuilder (org.opensmartgridplatform.cucumber.platform.smartmetering.builders.GetPowerQualityProfileRequestBuilder)1 GetPowerQualityProfileRequestData (org.opensmartgridplatform.domain.core.valueobjects.smartmetering.GetPowerQualityProfileRequestData)1