@Test public void getConfigurationObjectGprsModeNull() throws ProtocolAdapterException { final DataObject structure = mock(DataObject.class); when(structure.isComplex()).thenReturn(true); when(this.getResult.getResultData()).thenReturn(structure); final List<DataObject> elements = new ArrayList<>(); elements.add(null); elements.add(null); when(structure.getValue()).thenReturn(elements); assertThatExceptionOfType(ProtocolAdapterException.class).isThrownBy(() -> { this.instance.getConfigurationObject(this.getResult); }); }
@Override ConfigurationObjectDto getConfigurationObject(final GetResult result) throws ProtocolAdapterException { final DataObject resultData = result.getResultData(); if (resultData == null || !resultData.isComplex()) { final String message = String.format("Expected ConfigurationObject ResultData as Complex, but got: %s", resultData); LOGGER.warn(message); throw new ProtocolAdapterException(message); } return this.getConfigurationObject(resultData); }
GetConfigurationObjectServiceDsmr4 extends GetConfigurationObjectService { @Override ConfigurationObjectDto getConfigurationObject(final GetResult result) throws ProtocolAdapterException { final DataObject resultData = result.getResultData(); if (resultData == null || !resultData.isComplex()) { final String message = String.format("Expected ConfigurationObject ResultData as Complex, but got: %s", resultData); LOGGER.warn(message); throw new ProtocolAdapterException(message); } return this.getConfigurationObject(resultData); } }
GetConfigurationObjectServiceDsmr4 extends GetConfigurationObjectService { @Override ConfigurationObjectDto getConfigurationObject(final GetResult result) throws ProtocolAdapterException { final DataObject resultData = result.getResultData(); if (resultData == null || !resultData.isComplex()) { final String message = String.format("Expected ConfigurationObject ResultData as Complex, but got: %s", resultData); LOGGER.warn(message); throw new ProtocolAdapterException(message); } return this.getConfigurationObject(resultData); } GetConfigurationObjectServiceDsmr4(final DlmsHelper dlmsHelper); }
GetConfigurationObjectServiceDsmr4 extends GetConfigurationObjectService { @Override ConfigurationObjectDto getConfigurationObject(final GetResult result) throws ProtocolAdapterException { final DataObject resultData = result.getResultData(); if (resultData == null || !resultData.isComplex()) { final String message = String.format("Expected ConfigurationObject ResultData as Complex, but got: %s", resultData); LOGGER.warn(message); throw new ProtocolAdapterException(message); } return this.getConfigurationObject(resultData); } GetConfigurationObjectServiceDsmr4(final DlmsHelper dlmsHelper); @Override boolean handles(final Protocol protocol); }
GetConfigurationObjectServiceDsmr4 extends GetConfigurationObjectService { @Override ConfigurationObjectDto getConfigurationObject(final GetResult result) throws ProtocolAdapterException { final DataObject resultData = result.getResultData(); if (resultData == null || !resultData.isComplex()) { final String message = String.format("Expected ConfigurationObject ResultData as Complex, but got: %s", resultData); LOGGER.warn(message); throw new ProtocolAdapterException(message); } return this.getConfigurationObject(resultData); } GetConfigurationObjectServiceDsmr4(final DlmsHelper dlmsHelper); @Override boolean handles(final Protocol protocol);  }