Search in sources :

Example 1 with SpeechletRequestEnvelope

use of com.amazon.speech.json.SpeechletRequestEnvelope in project amos-ss17-alexa by c-i-ber.

the class AmosAlexaSpeechletTest method getEnvelope.

private SpeechletRequestEnvelope<IntentRequest> getEnvelope(String intent, String... slots) throws IOException, NoSuchFieldException, IllegalAccessException {
    SpeechletRequestEnvelope<IntentRequest> envelope = (SpeechletRequestEnvelope<IntentRequest>) SpeechletRequestEnvelope.fromJson(buildJson(intent, slots));
    // Set session via reflection
    Field f1 = envelope.getClass().getDeclaredField("session");
    f1.setAccessible(true);
    f1.set(envelope, session);
    return envelope;
}
Also used : Field(java.lang.reflect.Field) IntentRequest(com.amazon.speech.speechlet.IntentRequest) SpeechletRequestEnvelope(com.amazon.speech.json.SpeechletRequestEnvelope)

Aggregations

SpeechletRequestEnvelope (com.amazon.speech.json.SpeechletRequestEnvelope)1 IntentRequest (com.amazon.speech.speechlet.IntentRequest)1 Field (java.lang.reflect.Field)1