@Test public void testExtensionResponseParsingWithConfigurationUpdate() throws Exception { ArgumentCaptor<ExtenderConfiguration> argumentCaptor = ArgumentCaptor.forClass(ExtenderConfiguration.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-multiple-mixed-and-duplicate-payloads.tlv")); verify(extenderConfigurationListener, times(1)).updated(argumentCaptor.capture()); verify(extenderConfigurationListener, times(0)).updateFailed(any(Throwable.class)); ExtenderConfiguration configuration = argumentCaptor.getValue(); Assert.assertEquals((long) configuration.getMaximumRequests(), 4L); Assert.assertEquals(configuration.getCalendarFirstTime(), new Date(5557150000L)); Assert.assertEquals(configuration.getCalendarLastTime(), new Date(1422630579000L)); for (String parent : configuration.getParents()){ Assert.assertTrue(parent.contains(".url")); } Assert.assertNotNull(response); }
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);  }