PduV2Factory implements PduFactory { public ExtensionRequest createExtensionRequest(KSIRequestContext context, ServiceCredentials credentials, Date aggregationTime, Date publicationTime) throws KSIException { return this.extenderPduV2Factory.createExtensionRequest(context, credentials, aggregationTime, publicationTime); } 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);  }
@Test public void testCreateExtenderRequest_Ok() throws Exception { ExtensionRequest request = pduFactory.createExtensionRequest(requestContext, CREDENTIALS, new Date(1489520040000L), new Date(1489520040000L)); Assert.assertNotNull(request); }
@Test(expectedExceptions = KSIProtocolException.class, expectedExceptionsMessageRegExp = "There is no suitable publication yet") public void testCreateExtenderRequestWithAggregationTimeAfterPublicationTime_ThrowsKSIProtocolException() throws Exception { ExtensionRequest request = pduFactory.createExtensionRequest(requestContext, CREDENTIALS, new Date(1489520050000L), new Date(1489520040000L)); Assert.assertNotNull(request); }