@Test public void testCanHandleNameTrueIfMatches() { TestIntentHandler underTest = new TestIntentHandler(mapper); when(mockInput.getRequestEnvelope()).thenReturn(RequestEnvelope.builder() .withRequest(IntentRequest.builder() .withIntent(com.amazon.ask.model.Intent.builder() .withName("TestIntent") .withSlots(Collections.emptyMap()) .build()) .build()) .build()); assertTrue(underTest.canHandle(mockInput)); }
@Override public boolean canHandle(HandlerInput input) { if (input.getRequestEnvelope().getRequest() instanceof IntentRequest) { IntentRequest request = (IntentRequest) input.getRequestEnvelope().getRequest(); return request.getIntent().getName().equals(intentName); } return false; }
IntentRequestHandler implements RequestHandler { @Override public boolean canHandle(HandlerInput input) { if (input.getRequestEnvelope().getRequest() instanceof IntentRequest) { IntentRequest request = (IntentRequest) input.getRequestEnvelope().getRequest(); return request.getIntent().getName().equals(intentName); } return false; } }
IntentRequestHandler implements RequestHandler { @Override public boolean canHandle(HandlerInput input) { if (input.getRequestEnvelope().getRequest() instanceof IntentRequest) { IntentRequest request = (IntentRequest) input.getRequestEnvelope().getRequest(); return request.getIntent().getName().equals(intentName); } return false; } IntentRequestHandler(Class<T> intentClass, IntentMapper intentMapper);  IntentRequestHandler(Class<T> intentClass, IntentReader<T> intentReader); }
IntentRequestHandler implements RequestHandler { @Override public boolean canHandle(HandlerInput input) { if (input.getRequestEnvelope().getRequest() instanceof IntentRequest) { IntentRequest request = (IntentRequest) input.getRequestEnvelope().getRequest(); return request.getIntent().getName().equals(intentName); } return false; } IntentRequestHandler(Class<T> intentClass, IntentMapper intentMapper);  IntentRequestHandler(Class<T> intentClass, IntentReader<T> intentReader); @Override boolean canHandle(HandlerInput input); @Override Optional<Response> handle(HandlerInput input); }
IntentRequestHandler implements RequestHandler { @Override public boolean canHandle(HandlerInput input) { if (input.getRequestEnvelope().getRequest() instanceof IntentRequest) { IntentRequest request = (IntentRequest) input.getRequestEnvelope().getRequest(); return request.getIntent().getName().equals(intentName); } return false; } IntentRequestHandler(Class<T> intentClass, IntentMapper intentMapper);  IntentRequestHandler(Class<T> intentClass, IntentReader<T> intentReader); @Override boolean canHandle(HandlerInput input); @Override Optional<Response> handle(HandlerInput input);  }