use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.Action in project open-smart-grid-platform by OSGP.
the class ActionMapperService method mapAllActions.
public List<ActionRequest> mapAllActions(final List<? extends Action> actionList) throws FunctionalException {
final List<ActionRequest> actionRequestList = new ArrayList<>();
for (final Action action : actionList) {
final ConfigurableMapper mapper = CLASS_TO_MAPPER_MAP.get(action.getClass());
final Class<? extends ActionRequest> clazz = CLASS_MAP.get(action.getClass());
if (mapper != null) {
actionRequestList.add(this.getActionRequestWithDefaultMapper(action, mapper, clazz));
} else {
throw new FunctionalException(FunctionalExceptionType.VALIDATION_ERROR, ComponentType.DOMAIN_SMART_METERING, new AssertionError("No mapper defined for class: " + action.getClass().getName()));
}
}
return actionRequestList;
}
use of org.opensmartgridplatform.adapter.ws.schema.smartmetering.common.Action in project open-smart-grid-platform by OSGP.
the class BundleSteps method assertSameOrder.
private void assertSameOrder(final BundleRequest bundleRequest, final BundleResponse bundleResponse) {
final int actionsSize = bundleRequest.getActions().getActionList().size();
for (int i = 0; i < actionsSize; i++) {
final Action action = bundleRequest.getActions().getActionList().get(i);
final Response response = bundleResponse.getAllResponses().getResponseList().get(i);
assertThat(response.getClass()).isEqualTo(REQUEST_RESPONSE_MAP.get(action.getClass()));
}
}
Aggregations