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;
}
Aggregations