篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了java 第一次创建Alexa Skill - Test Intent Snippet相关的知识,希望对你有一定的参考价值。
/**
* Basic implementation of a JUnit test to test an intent. The response of the intent is specified in a JSON file.
*/
@Test
public void testGetPetLocationIntent() throws Exception {
SpeechletResponse speechletResponse = SpeechletResponseTestUtils.getSpeechletResponse("where_is_my_dog.json");
PlainTextOutputSpeech outputSpeech = (PlainTextOutputSpeech)speechletResponse.getOutputSpeech();
assertNotNull(outputSpeech);
assertEquals("Your dog Bello is ...", outputSpeech.getText());
assertEquals("Your pets location", speechletResponse.getCard().getTitle());
}
以上是关于java 第一次创建Alexa Skill - Test Intent Snippet的主要内容,如果未能解决你的问题,请参考以下文章