@Test public void testAggregationResponseParsingWithConfigurationUpdate() throws Exception { ArgumentCaptor<AggregatorConfiguration> argumentCaptor = ArgumentCaptor.forClass(AggregatorConfiguration.class); ConfigurationListener<AggregatorConfiguration> aggregatorConfigurationListener = mock(ConfigurationListener.class); PduV2Factory pduFactoryWithConfHandler = new PduV2Factory(new AggregatorPduV2Factory(aggregatorConfigurationListener)); AggregationResponse response = pduFactoryWithConfHandler.readAggregationResponse(requestContext, CREDENTIALS, loadTlv("pdu/aggregation/aggregator-response-v2-multiple-mixed-and-duplicate-payloads.tlv")); Assert.assertNotNull(response); verify(aggregatorConfigurationListener, times(1)).updated(argumentCaptor.capture()); verify(aggregatorConfigurationListener, times(0)).updateFailed(any(Throwable.class)); AggregatorConfiguration configuration = argumentCaptor.getValue(); Assert.assertEquals((long) configuration.getMaximumLevel(), 19L); Assert.assertEquals((long) configuration.getAggregationPeriod(), 12288L); Assert.assertEquals((long) configuration.getMaximumRequests(), 17L); Assert.assertEquals(configuration.getAggregationAlgorithm(), HashAlgorithm.SHA2_384); Assert.assertEquals(configuration.getParents().size(), 3); }
public AggregationResponse readAggregationResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input) throws KSIException { return this.aggregatorPduV2Factory.readAggregationResponse(context, credentials, input); }
PduV2Factory implements PduFactory { public AggregationResponse readAggregationResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input) throws KSIException { return this.aggregatorPduV2Factory.readAggregationResponse(context, credentials, input); } }
PduV2Factory implements PduFactory { public AggregationResponse readAggregationResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input) throws KSIException { return this.aggregatorPduV2Factory.readAggregationResponse(context, credentials, input); } PduV2Factory();  PduV2Factory(AggregatorPduV2Factory aggregatorPduV2Factory, ExtenderPduV2Factory extenderPduV2Factory);  PduV2Factory(AggregatorPduV2Factory aggregatorPduV2Factory);  PduV2Factory(ExtenderPduV2Factory extenderPduV2Factory); }
PduV2Factory implements PduFactory { public AggregationResponse readAggregationResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input) throws KSIException { return this.aggregatorPduV2Factory.readAggregationResponse(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 AggregationResponse readAggregationResponse(KSIRequestContext context, ServiceCredentials credentials, TLVElement input) throws KSIException { return this.aggregatorPduV2Factory.readAggregationResponse(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);  }