GetPowerQualityProfileCommandExecutor extends AbstractCommandExecutor<GetPowerQualityProfileRequestDataDto, GetPowerQualityProfileResponseDto> { @Override public GetPowerQualityProfileResponseDto execute(DlmsConnectionManager conn, DlmsDevice device, GetPowerQualityProfileRequestDataDto getPowerQualityProfileRequestDataDto) throws ProtocolAdapterException { if (device.isSelectiveAccessSupported()) { return this.getPowerQualityProfileSelectiveAccessHandler .handle(conn, device, getPowerQualityProfileRequestDataDto); } else { return this.getPowerQualityProfileNoSelectiveAccessHandler .handle(conn, device, getPowerQualityProfileRequestDataDto); } } GetPowerQualityProfileCommandExecutor(); @Override GetPowerQualityProfileResponseDto execute(DlmsConnectionManager conn, DlmsDevice device,
            GetPowerQualityProfileRequestDataDto getPowerQualityProfileRequestDataDto);  }
@Test public void executeWithSelectiveAccess() throws ProtocolAdapterException { DlmsDevice dlmsDevice = new DlmsDevice(); dlmsDevice.setSelectiveAccessSupported(true); executor.execute(conn, dlmsDevice, getPowerQualityProfileRequestDataDto); verify(getPowerQualityProfileSelectiveAccessHandler) .handle(any(DlmsConnectionManager.class), any(DlmsDevice.class), any(GetPowerQualityProfileRequestDataDto.class)); }
@Test public void executeWithoutSelectiveAccess() throws ProtocolAdapterException { DlmsDevice dlmsDevice = new DlmsDevice(); dlmsDevice.setSelectiveAccessSupported(false); executor.execute(conn, dlmsDevice, getPowerQualityProfileRequestDataDto); verify(getPowerQualityProfileNoSelectiveAccessHandler) .handle(any(DlmsConnectionManager.class), any(DlmsDevice.class), any(GetPowerQualityProfileRequestDataDto.class)); }