@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 (input.requestTypeEquals(IntentRequest.class) && input.parameterTypeEquals(Intent.class)) { return Optional.of(((IntentRequest) input.unwrapRequest()).getIntent()) ; } return Optional.empty(); }
IntentArgumentResolver implements ArgumentResolver { @Override public Optional<Object> resolve(ArgumentResolverContext input) { if (input.requestTypeEquals(IntentRequest.class) && input.parameterTypeEquals(Intent.class)) { return Optional.of(((IntentRequest) input.unwrapRequest()).getIntent()) ; } return Optional.empty(); } }
IntentArgumentResolver implements ArgumentResolver { @Override public Optional<Object> resolve(ArgumentResolverContext input) { if (input.requestTypeEquals(IntentRequest.class) && input.parameterTypeEquals(Intent.class)) { return Optional.of(((IntentRequest) input.unwrapRequest()).getIntent()) ; } return Optional.empty(); }  }
IntentArgumentResolver implements ArgumentResolver { @Override public Optional<Object> resolve(ArgumentResolverContext input) { if (input.requestTypeEquals(IntentRequest.class) && input.parameterTypeEquals(Intent.class)) { return Optional.of(((IntentRequest) input.unwrapRequest()).getIntent()) ; } return Optional.empty(); }  @Override Optional<Object> resolve(ArgumentResolverContext input); }
IntentArgumentResolver implements ArgumentResolver { @Override public Optional<Object> resolve(ArgumentResolverContext input) { if (input.requestTypeEquals(IntentRequest.class) && input.parameterTypeEquals(Intent.class)) { return Optional.of(((IntentRequest) input.unwrapRequest()).getIntent()) ; } return Optional.empty(); }  @Override Optional<Object> resolve(ArgumentResolverContext input);  }