method2testcases
stringlengths
118
3.08k
### Question: RemoteJwkSetCache extends AbstractIdentifiableInitializableComponent { public void setStorage(@Nonnull final StorageService storageService) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); storage = Constraint.isNotNull(storageService, "StorageService cannot be null"); final Sto...
### Question: RemoteJwkSetCache extends AbstractIdentifiableInitializableComponent { public void setHttpClient(@Nonnull final HttpClient client) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); ComponentSupport.ifDestroyedThrowDestroyedComponentException(this); httpClient = Constraint.isNotNu...
### Question: AbstractAuthenticationRequestLookupFunction implements ContextDataLookupFunction<ProfileRequestContext, T> { @Override @Nullable public T apply(@Nullable final ProfileRequestContext input) { if (input == null || input.getInboundMessageContext() == null || input.getOutboundMessageContext() == null) { retur...
### Question: AbstractTokenRequestLookupFunction implements ContextDataLookupFunction<ProfileRequestContext, T> { @Override @Nullable public T apply(@Nullable final ProfileRequestContext input) { if (input == null || input.getInboundMessageContext() == null) { return null; } Object message = input.getInboundMessageCont...
### Question: OIDCRegistrationResponseContextLookupFunction implements ContextDataLookupFunction<ProfileRequestContext, OIDCClientRegistrationResponseContext> { @Override @Nullable public OIDCClientRegistrationResponseContext apply(@Nullable final ProfileRequestContext input) { if (input == null || input.getOutboundMes...
### Question: DefaultUserInfoSigningAlgLookupFunction implements ContextDataLookupFunction<ProfileRequestContext, JWSAlgorithm> { @Override @Nullable public JWSAlgorithm apply(@Nullable final ProfileRequestContext input) { if (input == null || input.getInboundMessageContext() == null) { return null; } OIDCMetadataConte...
### Question: UserInfoResponseClaimsSetLookupFunction implements ContextDataLookupFunction<ProfileRequestContext, ClaimsSet> { @Override @Nullable public ClaimsSet apply(@Nullable final ProfileRequestContext input) { if (input == null || input.getOutboundMessageContext() == null) { return null; } OIDCAuthenticationResp...
### Question: DefaultClientIDLookupFunction implements ContextDataLookupFunction<MessageContext, ClientID> { @Override public ClientID apply(@Nullable MessageContext input) { if (input == null) { return null; } Object message = input.getMessage(); if (!(message instanceof AuthenticationRequest)) { return null; } return...
### Question: UserInfoRequestClientIDLookupFunction implements ContextDataLookupFunction<MessageContext, ClientID> { @Override public ClientID apply(@Nullable MessageContext input) { if (input == null) { return null; } if (!(input.getParent() instanceof ProfileRequestContext)) { return null; } MessageContext msgCtx = (...
### Question: DefaultValidRedirectUrisLookupFunction implements ContextDataLookupFunction<ProfileRequestContext, Set<URI>> { @Override @Nullable public Set<URI> apply(@Nullable final ProfileRequestContext input) { if (input == null || input.getInboundMessageContext() == null) { return null; } OIDCMetadataContext ctx = ...
### Question: OIDCAuthenticationResponseContextLookupFunction implements ContextDataLookupFunction<ProfileRequestContext, OIDCAuthenticationResponseContext> { @Override @Nullable public OIDCAuthenticationResponseContext apply(@Nullable final ProfileRequestContext input) { if (input == null || input.getOutboundMessageCo...
### Question: FilesystemMetadataValueResolver extends AbstractFileOIDCEntityResolver<Identifier, Object> implements RefreshableMetadataValueResolver { @Override public Object resolveSingle(ProfileRequestContext profileRequestContext) throws ResolverException { return resolve(profileRequestContext).iterator().next(); } ...
### Question: DefaultResponseClaimsSetLookupFunction implements ContextDataLookupFunction<ProfileRequestContext, ClaimsSet> { @Override @Nullable public ClaimsSet apply(@Nullable final ProfileRequestContext input) { if (input == null || input.getOutboundMessageContext() == null) { return null; } OIDCAuthenticationRespo...
### Question: TokenRequestClientIDLookupFunction implements ContextDataLookupFunction<MessageContext, ClientID> { @Override public ClientID apply(@Nullable MessageContext input) { if (input == null) { return null; } Object message = input.getMessage(); if (!(message instanceof AbstractOptionallyAuthenticatedRequest)) {...
### Question: ValidatedRedirectURILookupFunction implements ContextDataLookupFunction<ProfileRequestContext, URI> { @Override @Nullable public URI apply(@Nullable final ProfileRequestContext input) { if (input == null || input.getOutboundMessageContext() == null) { return null; } OIDCAuthenticationResponseContext ctx =...
### Question: DefaultAuthTimeLookupFunction implements ContextDataLookupFunction<ProfileRequestContext, Long> { @Override @Nullable public Long apply(@Nullable final ProfileRequestContext input) { if (input == null) { return null; } AuthenticationContext authCtx = input.getSubcontext(AuthenticationContext.class, false)...
### Question: ProfileResponderIdLookupFunction extends AbstractIdentifiableInitializableComponent implements ContextDataLookupFunction<ProfileRequestContext, String> { @Override @Nullable public String apply(@Nullable final ProfileRequestContext input) { if (profileResponders.containsKey(input.getProfileId())) { return...
### Question: AbstractTokenClaimsLookupFunction implements ContextDataLookupFunction<ProfileRequestContext, T> { @Override @Nullable public T apply(@Nullable final ProfileRequestContext input) { if (input == null || input.getOutboundMessageContext() == null) { return null; } OIDCAuthenticationResponseContext oidcRespon...
### Question: DefaultOIDCMetadataContextLookupFunction implements ContextDataLookupFunction<ProfileRequestContext, OIDCMetadataContext> { @Override @Nullable public OIDCMetadataContext apply(@Nullable final ProfileRequestContext input) { if (input == null || input.getInboundMessageContext() == null) { return nu...
### Question: RevocationCache extends AbstractIdentifiableInitializableComponent { public void setStorage(@Nonnull final StorageService storageService) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); storage = Constraint.isNotNull(storageService, "StorageService cannot be null"); final Stora...
### Question: RevocationCache extends AbstractIdentifiableInitializableComponent { @Duration public void setEntryExpiration(@Positive @Duration final long entryExpiration) { expires = Constraint.isGreaterThan(0, entryExpiration, "revocation cache entry expiration must be greater than 0"); } RevocationCache(); @Duration...
### Question: RevocationCache extends AbstractIdentifiableInitializableComponent { @NonnullAfterInit public StorageService getStorage() { return storage; } RevocationCache(); @Duration void setEntryExpiration(@Positive @Duration final long entryExpiration); @NonnullAfterInit StorageService getStorage(); void setStorage...
### Question: JSONSuccessResponse implements SuccessResponse { @Override public HTTPResponse toHTTPResponse() { HTTPResponse httpResponse = new HTTPResponse(HTTPResponse.SC_OK); httpResponse.setContentType(CommonContentTypes.APPLICATION_JSON); if (cacheControl != null) { httpResponse.setCacheControl(cacheControl); } if...
### Question: StorageServiceClientInformationManager extends BaseStorageServiceClientInformationComponent implements ClientInformationManager { @Override public void storeClientInformation(final OIDCClientInformation clientInformation, final Long expiration) throws ClientInformationManagerException { log.debug("Attempt...
### Question: AuthenticationContextClassReferencePrincipal implements CloneablePrincipal { @Override public AuthenticationContextClassReferencePrincipal clone() throws CloneNotSupportedException { final AuthenticationContextClassReferencePrincipal copy = (AuthenticationContextClassReferencePrincipal) super.clone(); cop...
### Question: SubjectActivationCondition implements Predicate<ProfileRequestContext> { @Override public boolean apply(ProfileRequestContext input) { final MessageContext outboundMessageCtx = input.getOutboundMessageContext(); if (outboundMessageCtx == null) { return true; } OIDCAuthenticationResponseContext oidcRespons...
### Question: AuthenticationContextClassReferencePrincipal implements CloneablePrincipal { @Override public String toString() { return MoreObjects.toStringHelper(this).add("authnContextClassReference", authnContextClassReference) .toString(); } AuthenticationContextClassReferencePrincipal( @Nonnull @NotEmpt...
### Question: AttributeResolutionSubjectLookupFunction extends AbstractIdentifiableInitializableComponent implements ContextDataLookupFunction<ProfileRequestContext, String> { public void setAttributeContextLookupStrategy( @Nonnull final Function<ProfileRequestContext, AttributeContext> strategy) { ComponentSupport.ifI...
### Question: EncodeMessage extends AbstractProfileAction { public void setMessageEncoderFactory(@Nonnull final MessageEncoderFactory factory) { encoderFactory = Constraint.isNotNull(factory, "MessageEncoderFactory cannot be null"); } void setMessageEncoderFactory(@Nonnull final MessageEncoderFactory factory); void se...
### Question: SetSectorIdentifierForAttributeResolution extends AbstractOIDCAuthenticationRequestAction { public void setSectorIdentifierLookupStrategy(@Nonnull final Function<ProfileRequestContext, String> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); sectorIdentifierLookupStrat...
### Question: SetSectorIdentifierForAttributeResolution extends AbstractOIDCAuthenticationRequestAction { public void setSubjectTypeLookupStrategy(@Nonnull final Function<ProfileRequestContext, SubjectType> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); subjectTypeLookupStrategy =...
### Question: RevokeConsent extends AbstractOIDCResponseAction { public void setPromptLookupStrategy(@Nonnull final Function<ProfileRequestContext, Prompt> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); promptLookupStrategy = Constraint.isNotNull(strategy, "PromptLookupStrategy lo...
### Question: OIDCClientInformationEncryptionParametersResolver extends BasicEncryptionParametersResolver { @Override @Nullable public EncryptionParameters resolveSingle(@Nonnull final CriteriaSet criteria) throws ResolverException { Constraint.isNotNull(criteria, "CriteriaSet was null"); Constraint.isNotNull(criteria....
### Question: InitializeAuthenticationContext extends AbstractOIDCAuthenticationRequestAction { public void setLoginHintLookupStrategy(@Nonnull final Function<ProfileRequestContext, String> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); loginHintLookupStrategy = Constraint.isNotNu...
### Question: InitializeAuthenticationContext extends AbstractOIDCAuthenticationRequestAction { public void setPromptLookupStrategy(@Nonnull final Function<ProfileRequestContext, Prompt> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); promptLookupStrategy = Constraint.isNotNull(str...
### Question: InitializeAuthenticationContext extends AbstractOIDCAuthenticationRequestAction { public void setMaxAgeLookupStrategy(@Nonnull final Function<ProfileRequestContext, Long> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); maxAgeLookupStrategy = Constraint.isNotNull(strat...
### Question: EncryptProcessedToken extends AbstractOIDCResponseAction { public void setEncryptionContextLookupStrategy( @Nonnull final Function<ProfileRequestContext, EncryptionContext> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); encryptionContextLookupStrategy = Constraint.is...
### Question: SetTokenDeliveryAttributesFromTokenToResponseContext extends AbstractOIDCResponseAction { public void setDeliveryClaimsLookupStrategy(@Nonnull final Function<ProfileRequestContext, ClaimsSet> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); deliveryClaimsLookupStrategy...
### Question: SetTokenDeliveryAttributesFromTokenToResponseContext extends AbstractOIDCResponseAction { public void setIDTokenDeliveryClaimsLookupStrategy( @Nullable final Function<ProfileRequestContext, ClaimsSet> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); idTokenDeliveryClai...
### Question: SetTokenDeliveryAttributesFromTokenToResponseContext extends AbstractOIDCResponseAction { public void setUserinfoDeliveryClaimsLookupStrategy( @Nullable final Function<ProfileRequestContext, ClaimsSet> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); userinfoDeliveryCl...
### Question: InitializeUnverifiedRelyingPartyContext extends AbstractProfileAction { public void setRelyingPartyContextCreationStrategy( @Nonnull final Function<ProfileRequestContext, RelyingPartyContext> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); relyingPartyContextCreationS...
### Question: PopulateOIDCEncryptionParameters extends AbstractProfileAction { public void setConfigurationLookupStrategy( @Nonnull final Function<ProfileRequestContext, List<EncryptionConfiguration>> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); configurationLookupStrategy = Con...
### Question: PopulateOIDCEncryptionParameters extends AbstractProfileAction { public void setEncryptionContextLookupStrategy( @Nonnull final Function<ProfileRequestContext, EncryptionContext> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); encryptionContextLookupStrategy = Constra...
### Question: PopulateOIDCEncryptionParameters extends AbstractProfileAction { public void setOIDCMetadataContextContextLookupStrategy( @Nonnull final Function<ProfileRequestContext, OIDCMetadataContext> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); oidcMetadataContextLookupStrat...
### Question: PopulateOIDCEncryptionParameters extends AbstractProfileAction { public void setEncryptionParametersResolver(@Nonnull final EncryptionParametersResolver newResolver) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); encParamsresolver = Constraint.isNotNull(newResolver, "Encryptio...
### Question: InitializeRelyingPartyContext extends AbstractProfileAction { public void setOidcMetadataContextLookupStrategy( @Nonnull final Function<ProfileRequestContext, OIDCMetadataContext> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); oidcMetadataContextLookupStrategy = Cons...
### Question: InitializeRelyingPartyContext extends AbstractProfileAction { public void setClientIDLookupStrategy(@Nonnull final Function<MessageContext, ClientID> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); clientIDLookupStrategy = Constraint.isNotNull(strategy, "ClientIDLooku...
### Question: InitializeRelyingPartyContext extends AbstractProfileAction { public void setRelyingPartyContextCreationStrategy( @Nonnull final Function<ProfileRequestContext, RelyingPartyContext> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); relyingPartyContextCreationStrategy = ...
### Question: FormOutboundDiscoveryResponse extends AbstractProfileAction { public void setMetadataResolver(final ProviderMetadataResolver resolver) { metadataResolver = Constraint.isNotNull(resolver, "The metadata resolver cannot be null!"); } FormOutboundDiscoveryResponse(); void setMetadataResolver(final ProviderMet...
### Question: CheckRedirectURIs extends AbstractProfileAction { protected boolean checkForbiddenHostname(final Set<URI> redirectURIs, final String hostname) { for (final URI redirectUri : redirectURIs) { if (hostname.equalsIgnoreCase(redirectUri.getHost())) { log.trace("{} Found forbidden {} as the hostname in the redi...
### Question: ValidateAccessToken extends AbstractOIDCUserInfoValidationResponseAction { public void setRevocationCache(@Nonnull final RevocationCache cache) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); revocationCache = Constraint.isNotNull(cache, "ReplayCache cannot be null"); } Validat...
### Question: OIDCClientInformationSignatureSigningParametersResolver extends BasicSignatureSigningParametersResolver { @Nullable public SignatureSigningParameters resolveSingle(@Nonnull final CriteriaSet criteria) throws ResolverException { Constraint.isNotNull(criteria, "CriteriaSet was null"); Constraint.isNotNull(c...
### Question: AddScopeToClientMetadata extends AbstractOIDCClientMetadataPopulationAction { public void setDefaultScope(final Scope scope) { defaultScope = Constraint.isNotNull(scope, "The default scope cannot be null"); } AddScopeToClientMetadata(); void setDefaultScope(final Scope scope); Scope getDefaultScope(); }#...
### Question: AddScopeToClientMetadata extends AbstractOIDCClientMetadataPopulationAction { public Scope getDefaultScope() { return defaultScope; } AddScopeToClientMetadata(); void setDefaultScope(final Scope scope); Scope getDefaultScope(); }### Answer: @Test public void testNullScope() throws ComponentInitialization...
### Question: AddUserInfoShell extends AbstractOIDCResponseAction { public void setIssuerLookupStrategy(@Nonnull final Function<ProfileRequestContext, String> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); issuerLookupStrategy = Constraint.isNotNull(strategy, "IssuerLookupStrategy...
### Question: AddUserInfoShell extends AbstractOIDCResponseAction { public void setRelyingPartyContextLookupStrategy( @Nonnull final Function<ProfileRequestContext, RelyingPartyContext> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); relyingPartyContextLookupStrategy = Constraint.i...
### Question: AddUserInfoShell extends AbstractOIDCResponseAction { public void setUserInfoSigningAlgLookupStrategy(@Nonnull final Function<ProfileRequestContext, JWSAlgorithm> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); userInfoSigAlgStrategy = Constraint.isNotNull(strategy, "...
### Question: ValidateGrant extends AbstractOIDCTokenResponseAction { public void setReplayCache(@Nonnull final ReplayCache cache) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); replayCache = Constraint.isNotNull(cache, "ReplayCache cannot be null"); } ValidateGrant(@Nonnull @ParameterName(...
### Question: ValidateGrant extends AbstractOIDCTokenResponseAction { public void setRevocationCache(@Nonnull final RevocationCache cache) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); revocationCache = Constraint.isNotNull(cache, "ReplayCache cannot be null"); } ValidateGrant(@Nonnull @Pa...
### Question: SetSubjectToResponseContext extends AbstractOIDCResponseAction { public void setSubjectLookupStrategy(@Nonnull final Function<ProfileRequestContext, String> strategy) { ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this); subjectLookupStrategy = Constraint.isNotNull(strategy, "Subject...
### Question: OIDCScopedStringAttributeEncoder extends AbstractOIDCAttributeEncoder { @SuppressWarnings("rawtypes") @Override public JSONObject encode(IdPAttribute idpAttribute) throws AttributeEncodingException { Constraint.isNotNull(idpAttribute, "Attribute to encode cannot be null"); Constraint.isNotNull(scopeDelimi...
### Question: RefreshTokenClaimsSet extends TokenClaimsSet { public static RefreshTokenClaimsSet parse(String refreshTokenClaimsSet) throws ParseException { JWTClaimsSet atClaimsSet = JWTClaimsSet.parse(refreshTokenClaimsSet); verifyParsedClaims(VALUE_TYPE_RF, atClaimsSet); return new RefreshTokenClaimsSet(atClaimsSet)...
### Question: ChaosMonkeyScheduler { public void reloadConfig() { String cronExpression = config.getRuntimeAssaultCronExpression(); boolean active = !"OFF".equals(cronExpression); if (currentTask != null) { Logger.info("Cancelling previous task"); currentTask.cancel(); currentTask = null; } if (active) { CronTask task ...
### Question: LatencyAssault implements ChaosMonkeyRequestAssault { @Override public void attack() { Logger.debug("Chaos Monkey - timeout"); atomicTimeoutGauge.set(determineLatency()); if (metricEventPublisher != null) { metricEventPublisher.publishMetricEvent(MetricType.LATENCY_ASSAULT); metricEventPublisher.publishMe...
### Question: KillAppAssault implements ChaosMonkeyRuntimeAssault, ApplicationContextAware { @Override public void attack() { try { Logger.info("Chaos Monkey - I am killing your Application!"); if (metricEventPublisher != null) { metricEventPublisher.publishMetricEvent(MetricType.KILLAPP_ASSAULT); } int exit = SpringAp...
### Question: GreetingService { public String greet() { return "Greetings from the server side!"; } GreetingService( HelloRepo helloRepo, HelloRepoSearchAndSorting repoSearchAndSorting, HelloRepoJpa helloRepoJpa, HelloRepoAnnotation helloRepoAnnotation); String greet(); String greetFromRepo(); S...
### Question: GreetingService { public String greetFromRepo() { Hello databaseSide = helloRepo.save(new Hello(0, "Greetings from the database side")); return databaseSide.getMessage(); } GreetingService( HelloRepo helloRepo, HelloRepoSearchAndSorting repoSearchAndSorting, HelloRepoJpa helloRepoJpa, ...
### Question: GreetingService { public String greetFromRepoPagingSorting() { Hello databaseSide = repoSearchAndSorting.save( new Hello(0, "Greetings from the paging and sorting database side")); Optional<Hello> byId = repoSearchAndSorting.findById(databaseSide.getId()); return byId.orElse(new Hello(-99, "not found")).g...
### Question: GreetingService { public String greetFromRepoJpa() { Hello databaseSide = helloRepoJpa.save(new Hello(0, "Greetings from the paging and sorting database side")); Optional<Hello> byId = helloRepoJpa.findById(databaseSide.getId()); return byId.orElse(new Hello(-99, "not found")).getMessage(); } GreetingServ...
### Question: GreetingService { public String greetFromRepoAnnotation() { Hello databaseSide = helloRepoAnnotation.save( new Hello(0, "Greetings from the paging and sorting database side")); Optional<Hello> byId = helloRepoAnnotation.findById(databaseSide.getId()); return byId.orElse(new Hello(-99, "not found")).getMes...
### Question: ExponentialMovingAverage { public static long predictNext(TreeMap<Integer, Long> laps) { float smoothing = (((float) 2) / (laps.size() + 1)); long previousEMA = laps.get(laps.firstKey()); Set<Integer> keys = laps.keySet(); for (Iterator<Integer> i = keys.iterator(); i.hasNext();) { Integer key = i.next();...
### Question: MyService { @GET @Path("/helloworld") public String helloWorld() { return "Hello World!"; } @GET @Path("/helloworld") String helloWorld(); @GET @Path("/friends/{name}") Response getFriends(@PathParam("name") String name, @Context GraphDatabaseService db); @POST @Path("/permissions") Response permissions(...
### Question: MyService { @GET @Path("/friends/{name}") public Response getFriends(@PathParam("name") String name, @Context GraphDatabaseService db) throws IOException { ExecutionEngine executionEngine = new ExecutionEngine(db); ExecutionResult result = executionEngine.execute("START person=node:Users(unique_id={n}) MA...
### Question: InstructionLoader { void loadInstruction() { bannerComponentTree.loadInstruction(textView); } InstructionLoader(TextView textView, @NonNull BannerText bannerText); InstructionLoader(TextView textView, BannerComponentTree bannerComponentTree); }### Answer: @Test public void loadInstruction() { TextView...
### Question: MapFpsDelegate implements OnTrackingModeChangedListener, OnTrackingModeTransitionListener { @Override public void onTransitionFinished(int trackingMode) { updateCameraTracking(trackingMode); } MapFpsDelegate(MapView mapView, MapBatteryMonitor batteryMonitor); @Override void onTrackingModeChanged(int track...
### Question: MapFpsDelegate implements OnTrackingModeChangedListener, OnTrackingModeTransitionListener { @Override public void onTransitionCancelled(int trackingMode) { updateCameraTracking(trackingMode); } MapFpsDelegate(MapView mapView, MapBatteryMonitor batteryMonitor); @Override void onTrackingModeChanged(int trac...
### Question: MapFpsDelegate implements OnTrackingModeChangedListener, OnTrackingModeTransitionListener { void updateEnabled(boolean isEnabled) { this.isEnabled = isEnabled; resetMaxFps(!isEnabled); } MapFpsDelegate(MapView mapView, MapBatteryMonitor batteryMonitor); @Override void onTrackingModeChanged(int trackingMod...
### Question: MapWayNameChangedListener implements OnWayNameChangedListener { @Override public void onWayNameChanged(@NonNull String wayName) { for (OnWayNameChangedListener listener : listeners) { listener.onWayNameChanged(wayName); } } MapWayNameChangedListener(List<OnWayNameChangedListener> listeners); @Override voi...
### Question: MapPaddingAdjustor { void adjustLocationIconWith(@NonNull int[] customPadding) { this.customPadding = customPadding; updatePaddingWith(customPadding); } MapPaddingAdjustor(@NonNull MapView mapView, MapboxMap mapboxMap); MapPaddingAdjustor(MapboxMap mapboxMap, int[] defaultPadding); static final int BOT...
### Question: MapPaddingAdjustor { boolean isUsingDefault() { return customPadding == null; } MapPaddingAdjustor(@NonNull MapView mapView, MapboxMap mapboxMap); MapPaddingAdjustor(MapboxMap mapboxMap, int[] defaultPadding); static final int BOTTOMSHEET_PADDING_MULTIPLIER_PORTRAIT; static final int BOTTOMSHEET_PADDIN...
### Question: MapPaddingAdjustor { void updatePaddingWith(int[] padding) { mapboxMap.setPadding(padding[0], padding[1], padding[2], padding[3]); } MapPaddingAdjustor(@NonNull MapView mapView, MapboxMap mapboxMap); MapPaddingAdjustor(MapboxMap mapboxMap, int[] defaultPadding); static final int BOTTOMSHEET_PADDING_MUL...
### Question: MapPaddingAdjustor { @NonNull int[] retrieveCurrentPadding() { return mapboxMap.getPadding(); } MapPaddingAdjustor(@NonNull MapView mapView, MapboxMap mapboxMap); MapPaddingAdjustor(MapboxMap mapboxMap, int[] defaultPadding); static final int BOTTOMSHEET_PADDING_MULTIPLIER_PORTRAIT; static final int BO...
### Question: WaynameFeatureFinder { @NonNull List<Feature> queryRenderedFeatures(@NonNull PointF point, String[] layerIds) { return mapboxMap.queryRenderedFeatures(point, layerIds); } WaynameFeatureFinder(MapboxMap mapboxMap); }### Answer: @Test public void queryRenderedFeatures_mapboxMapIsCalled() { MapboxMap mapbo...
### Question: NavigationSymbolManager { void addDestinationMarkerFor(@NonNull Point position) { if (destinationSymbol != null) { symbolManager.delete(destinationSymbol); markersSymbols.remove(destinationSymbol.getId()); } SymbolOptions options = createSymbolOptionsFor(position); destinationSymbol = createSymbolFrom(opt...
### Question: NavigationSymbolManager { Symbol addCustomSymbolFor(@NonNull SymbolOptions options) { return createSymbolFrom(options); } NavigationSymbolManager(@NonNull SymbolManager symbolManager); }### Answer: @Test public void addCustomSymbolFor_symbolManagerCreatesSymbol() { Symbol symbol = buildSymbolWith(DEFAUL...
### Question: WaynameFeatureFilter { @Nullable Point findPointFromCurrentPoint(@Nullable Point currentPoint, @NonNull LineString lineString) { List<Point> lineStringCoordinates = lineString.coordinates(); int coordinateSize = lineStringCoordinates.size(); if (coordinateSize < TWO_POINTS) { return null; } Point lastLine...
### Question: LocationFpsDelegate implements MapboxMap.OnCameraIdleListener { void onStart() { mapboxMap.addOnCameraIdleListener(this); } LocationFpsDelegate(@NonNull MapboxMap mapboxMap, @NonNull LocationComponent locationComponent); @Override void onCameraIdle(); }### Answer: @Test public void onStart_idleListenerAd...
### Question: LocationFpsDelegate implements MapboxMap.OnCameraIdleListener { void onStop() { mapboxMap.removeOnCameraIdleListener(this); } LocationFpsDelegate(@NonNull MapboxMap mapboxMap, @NonNull LocationComponent locationComponent); @Override void onCameraIdle(); }### Answer: @Test public void onStop_idleListenerR...
### Question: LocationFpsDelegate implements MapboxMap.OnCameraIdleListener { void updateEnabled(boolean isEnabled) { this.isEnabled = isEnabled; resetMaxFps(); } LocationFpsDelegate(@NonNull MapboxMap mapboxMap, @NonNull LocationComponent locationComponent); @Override void onCameraIdle(); }### Answer: @Test public vo...
### Question: MapWayName { void updateWayNameWithPoint(PointF point) { if (!isAutoQueryEnabled) { return; } List<Feature> roadLabelFeatures = findRoadLabelFeatures(point); boolean invalidLabelFeatures = roadLabelFeatures.isEmpty(); if (invalidLabelFeatures) { return; } executeFeatureFilterTask(roadLabelFeatures); } Map...
### Question: NavigationViewSubscriber implements LifecycleObserver { @OnLifecycleEvent(Lifecycle.Event.ON_DESTROY) void unsubscribe() { navigationViewModel.retrieveRoute().removeObservers(lifecycleOwner); navigationViewModel.retrieveDestination().removeObservers(lifecycleOwner); navigationViewModel.retrieveNavigationL...
### Question: NavigationOnCameraTrackingChangedListener implements OnCameraTrackingChangedListener { @Override public void onCameraTrackingDismissed() { if (summaryBehavior.getState() != BottomSheetBehavior.STATE_HIDDEN) { navigationPresenter.onCameraTrackingDismissed(); } } NavigationOnCameraTrackingChangedListener(Na...
### Question: AbbreviationCreator extends NodeCreator<AbbreviationCreator.AbbreviationNode, AbbreviationVerifier> { @Override void preProcess(@NonNull TextView textView, @NonNull List<BannerComponentNode> bannerComponentNodes) { String text = abbreviateBannerText(textView, bannerComponentNodes); textView.setText(text);...
### Question: AbbreviationCreator extends NodeCreator<AbbreviationCreator.AbbreviationNode, AbbreviationVerifier> { @NonNull @Override AbbreviationNode setupNode(@NonNull BannerComponents components, int index, int startIndex, String modifier) { addPriorityInfo(components, index); return new AbbreviationNode(components...
### Question: NavigationPresenter { void onRouteOverviewClick() { view.setWayNameActive(false); view.setWayNameVisibility(false); view.updateCameraRouteOverview(); view.showRecenterBtn(); } NavigationPresenter(NavigationContract.View view); }### Answer: @Test public void onRouteOverviewButtonClick_cameraIsAdjustedToR...
### Question: BannerComponentTree { void loadInstruction(TextView textView) { for (NodeCreator nodeCreator : nodeCreators) { nodeCreator.preProcess(textView, bannerComponentNodes); } for (NodeCreator nodeCreator : nodeCreators) { nodeCreator.postProcess(textView, bannerComponentNodes); } } BannerComponentTree(@NonNull ...
### Question: NavigationPresenter { void onRecenterClick() { view.setSummaryBehaviorHideable(false); view.setSummaryBehaviorState(BottomSheetBehavior.STATE_EXPANDED); view.setWayNameActive(true); if (!TextUtils.isEmpty(view.retrieveWayNameText())) { view.setWayNameVisibility(true); } view.resetCameraPosition(); view.hi...
### Question: NavigationPresenter { void onWayNameChanged(@NonNull String wayName) { if (TextUtils.isEmpty(wayName) || view.isSummaryBottomSheetHidden()) { view.setWayNameActive(false); view.setWayNameVisibility(false); return; } view.updateWayNameView(wayName); view.setWayNameActive(true); view.setWayNameVisibility(tr...
### Question: NavigationPresenter { void onNavigationStopped() { view.setWayNameActive(false); view.setWayNameVisibility(false); } NavigationPresenter(NavigationContract.View view); }### Answer: @Test public void onNavigationStopped_mapWayNameIsHidden() { NavigationContract.View view = mock(NavigationContract.View.cl...
### Question: NavigationPresenter { void onRouteUpdate(DirectionsRoute directionsRoute) { view.drawRoute(directionsRoute); if (resumeState && view.isRecenterButtonVisible()) { view.updateCameraRouteOverview(); } else { view.startCamera(directionsRoute); } } NavigationPresenter(NavigationContract.View view); }### Answ...