@Test public void testExtensionResponseParsingWithBrokenConfigurationUpdate() throws Exception { ArgumentCaptor<Throwable> argumentCaptor = ArgumentCaptor.forClass(Throwable.class); ConfigurationListener<ExtenderConfiguration> extenderConfigurationListener = mock(ConfigurationListener.class); PduV2Factory pduFactoryWithConfHandler = new PduV2Factory(new ExtenderPduV2Factory(extenderConfigurationListener)); KSIRequestContext context = new KSIRequestContext(8396215651691691389L, 42L, 42L); ExtensionResponse response = pduFactoryWithConfHandler.readExtensionResponse(context, CREDENTIALS, loadTlv("pdu/extension/extension-response-v2-with-broken-conf.tlv")); Assert.assertNotNull(response); verify(extenderConfigurationListener, times(0)).updated(any(ExtenderConfiguration.class)); verify(extenderConfigurationListener, times(1)).updateFailed(argumentCaptor.capture()); Assert.assertEquals(argumentCaptor.getValue().getMessage(), "Unknown critical TLV element with tag=0x5 encountered"); }
public ExtensionResponse readExtensionResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input) throws KSIException { return this.extenderPduV2Factory.readExtensionResponse(context, credentials, input); }
PduV2Factory implements PduFactory { public ExtensionResponse readExtensionResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input) throws KSIException { return this.extenderPduV2Factory.readExtensionResponse(context, credentials, input); } }
PduV2Factory implements PduFactory { public ExtensionResponse readExtensionResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input) throws KSIException { return this.extenderPduV2Factory.readExtensionResponse(context, credentials, input); } PduV2Factory();  PduV2Factory(AggregatorPduV2Factory aggregatorPduV2Factory, ExtenderPduV2Factory extenderPduV2Factory);  PduV2Factory(AggregatorPduV2Factory aggregatorPduV2Factory);  PduV2Factory(ExtenderPduV2Factory extenderPduV2Factory); }
PduV2Factory implements PduFactory { public ExtensionResponse readExtensionResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input) throws KSIException { return this.extenderPduV2Factory.readExtensionResponse(context, credentials, input); } PduV2Factory();  PduV2Factory(AggregatorPduV2Factory aggregatorPduV2Factory, ExtenderPduV2Factory extenderPduV2Factory);  PduV2Factory(AggregatorPduV2Factory aggregatorPduV2Factory);  PduV2Factory(ExtenderPduV2Factory extenderPduV2Factory); AggregationRequest createAggregationRequest(KSIRequestContext context, ServiceCredentials credentials, DataHash imprint, Long level); AggregationResponse readAggregationResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input); AggregationRequest createAggregatorConfigurationRequest(KSIRequestContext context, ServiceCredentials credentials); AggregatorConfiguration readAggregatorConfigurationResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input); ExtensionRequest createExtensionRequest(KSIRequestContext context, ServiceCredentials credentials, Date aggregationTime, Date publicationTime); ExtensionResponse readExtensionResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input); ExtensionRequest createExtensionConfigurationRequest(KSIRequestContext context, ServiceCredentials credentials); ExtenderConfiguration readExtenderConfigurationResponse(ServiceCredentials credentials, TLVElement input); }
PduV2Factory implements PduFactory { public ExtensionResponse readExtensionResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input) throws KSIException { return this.extenderPduV2Factory.readExtensionResponse(context, credentials, input); } PduV2Factory();  PduV2Factory(AggregatorPduV2Factory aggregatorPduV2Factory, ExtenderPduV2Factory extenderPduV2Factory);  PduV2Factory(AggregatorPduV2Factory aggregatorPduV2Factory);  PduV2Factory(ExtenderPduV2Factory extenderPduV2Factory); AggregationRequest createAggregationRequest(KSIRequestContext context, ServiceCredentials credentials, DataHash imprint, Long level); AggregationResponse readAggregationResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input); AggregationRequest createAggregatorConfigurationRequest(KSIRequestContext context, ServiceCredentials credentials); AggregatorConfiguration readAggregatorConfigurationResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input); ExtensionRequest createExtensionRequest(KSIRequestContext context, ServiceCredentials credentials, Date aggregationTime, Date publicationTime); ExtensionResponse readExtensionResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input); ExtensionRequest createExtensionConfigurationRequest(KSIRequestContext context, ServiceCredentials credentials); ExtenderConfiguration readExtenderConfigurationResponse(ServiceCredentials credentials, TLVElement input);  }