GetConfigurationObjectCommandExecutor extends AbstractCommandExecutor<Void, ConfigurationObjectDto> { @Override public ConfigurationObjectDto execute(final DlmsConnectionManager conn, final DlmsDevice device, final Void object) throws ProtocolAdapterException { return this.protocolServiceLookup.lookupGetService(Protocol.forDevice(device)).getConfigurationObject(conn); } GetConfigurationObjectCommandExecutor(final ProtocolServiceLookup protocolServiceLookup); @Override Void fromBundleRequestInput(final ActionRequestDto bundleInput); @Override ActionResponseDto asBundleResponse(final ConfigurationObjectDto executionResult); @Override ConfigurationObjectDto execute(final DlmsConnectionManager conn, final DlmsDevice device, final Void object);  }
@Test public void execute() throws ProtocolAdapterException { final DlmsDevice device = new DlmsDevice(); final Protocol protocol = Protocol.DSMR_4_2_2; device.setProtocol(protocol); when(this.protocolServiceLookup.lookupGetService(protocol)).thenReturn(this.getService); when(this.getService.getConfigurationObject(this.conn)).thenReturn(this.configurationObjectDto); final ConfigurationObjectDto result = this.instance.execute(this.conn, device, null); assertThat(result).isSameAs(this.configurationObjectDto); }