@Test public void testDoesntSupport() throws NoSuchMethodException { MethodParameter methodParameter = new MethodParameter( this.getClass().getMethod("testSupportAndResolve"), 0, Object.class, MethodParameter.EMPTY_ANNOTATIONS ); RequestEnvelope envelope = Utils.buildSimpleEnvelope("intent"); ArgumentResolverContext input = new ArgumentResolverContext(mockSkillContext, methodParameter, HandlerInput.builder().withRequestEnvelope(envelope).build()); assertFalse(resolver.resolve(input).isPresent()); }
@Override public Optional<Object> resolve(ArgumentResolverContext input) { if (Request.class.isAssignableFrom(input.getMethodParameter().getType()) && (input.parameterTypeEquals(input.unwrapRequest().getClass()))) { return Optional.of(input.getHandlerInput().getRequestEnvelope().getRequest()); } return Optional.empty(); }
RequestArgumentResolver implements ArgumentResolver { @Override public Optional<Object> resolve(ArgumentResolverContext input) { if (Request.class.isAssignableFrom(input.getMethodParameter().getType()) && (input.parameterTypeEquals(input.unwrapRequest().getClass()))) { return Optional.of(input.getHandlerInput().getRequestEnvelope().getRequest()); } return Optional.empty(); } }
RequestArgumentResolver implements ArgumentResolver { @Override public Optional<Object> resolve(ArgumentResolverContext input) { if (Request.class.isAssignableFrom(input.getMethodParameter().getType()) && (input.parameterTypeEquals(input.unwrapRequest().getClass()))) { return Optional.of(input.getHandlerInput().getRequestEnvelope().getRequest()); } return Optional.empty(); }  }
RequestArgumentResolver implements ArgumentResolver { @Override public Optional<Object> resolve(ArgumentResolverContext input) { if (Request.class.isAssignableFrom(input.getMethodParameter().getType()) && (input.parameterTypeEquals(input.unwrapRequest().getClass()))) { return Optional.of(input.getHandlerInput().getRequestEnvelope().getRequest()); } return Optional.empty(); }  @Override Optional<Object> resolve(ArgumentResolverContext input); }
RequestArgumentResolver implements ArgumentResolver { @Override public Optional<Object> resolve(ArgumentResolverContext input) { if (Request.class.isAssignableFrom(input.getMethodParameter().getType()) && (input.parameterTypeEquals(input.unwrapRequest().getClass()))) { return Optional.of(input.getHandlerInput().getRequestEnvelope().getRequest()); } return Optional.empty(); }  @Override Optional<Object> resolve(ArgumentResolverContext input);  }