### Question:
EidasAwaitingCycle3DataStateController extends AbstractAwaitingCycle3DataStateController<EidasAttributeQueryRequestDto, EidasAwaitingCycle3DataState> implements StateController, ResponseProcessingStateController, ErrorResponsePreparedStateController { @Override public EidasAttributeQueryRequestDto createAttributeQuery(final Cycle3Dataset cycle3Dataset) { MatchingServiceConfigEntityDataDto matchingServiceConfigData = getMatchingServiceConfigProxy().getMatchingService(getState().getMatchingServiceEntityId()); URI matchingServiceAdapterUri = matchingServiceConfigData.getUri(); return new EidasAttributeQueryRequestDto( getState().getRequestId(), getState().getRequestIssuerEntityId(), getState().getAssertionConsumerServiceUri(), getAssertionRestrictionsFactory().getAssertionExpiry(), getState().getMatchingServiceEntityId(), matchingServiceAdapterUri, DateTime.now().plus(getPolicyConfiguration().getMatchingServiceResponseWaitPeriod()), matchingServiceConfigData.isOnboarding(), getState().getLevelOfAssurance(), getState().getPersistentId(), Optional.ofNullable(cycle3Dataset), Optional.empty(), getState().getEncryptedIdentityAssertion(), getState().getCountrySignedResponseContainer() ); } EidasAwaitingCycle3DataStateController(
        final EidasAwaitingCycle3DataState state,
        final HubEventLogger hubEventLogger,
        final StateTransitionAction stateTransitionAction,
        final TransactionsConfigProxy transactionsConfigProxy,
        final ResponseFromHubFactory responseFromHubFactory,
        final PolicyConfiguration policyConfiguration,
        final AssertionRestrictionsFactory assertionRestrictionsFactory,
        final MatchingServiceConfigProxy matchingServiceConfigProxy); @Override EidasAttributeQueryRequestDto createAttributeQuery(final Cycle3Dataset cycle3Dataset); @Override void handleCycle3DataSubmitted(final String principalIpAddressAsSeenByHub);  }### Answer:
@Test public void createAttributeQuery() { final Cycle3Dataset cycle3Dataset = Cycle3Dataset.createFromData("attribute", "attributeValue"); final MatchingServiceConfigEntityDataDto matchingServiceConfigEntityDataDto = aMatchingServiceConfigEntityDataDto() .withEntityId(state.getMatchingServiceEntityId()) .build(); when(matchingServiceConfigProxy.getMatchingService(state.getMatchingServiceEntityId())).thenReturn(matchingServiceConfigEntityDataDto); when(policyConfiguration.getMatchingServiceResponseWaitPeriod()).thenReturn(Duration.standardMinutes(60)); when(assertionRestrictionsFactory.getAssertionExpiry()).thenReturn(DateTime.now().plusHours(2)); final EidasAttributeQueryRequestDto expectedDto = new EidasAttributeQueryRequestDto( state.getRequestId(), state.getRequestIssuerEntityId(), state.getAssertionConsumerServiceUri(), assertionRestrictionsFactory.getAssertionExpiry(), state.getMatchingServiceEntityId(), matchingServiceConfigEntityDataDto.getUri(), DateTime.now().plus(policyConfiguration.getMatchingServiceResponseWaitPeriod()), matchingServiceConfigEntityDataDto.isOnboarding(), state.getLevelOfAssurance(), state.getPersistentId(), Optional.of(cycle3Dataset), Optional.empty(), state.getEncryptedIdentityAssertion(), Optional.empty() ); EidasAttributeQueryRequestDto actualDto = controller.createAttributeQuery(cycle3Dataset); assertThat(actualDto).isEqualTo(expectedDto); }