@Test public void callUsesRequestReply() { function.callAsync(new TestInput("test")).join(); verify(client).invoke(requestArgument.capture()); assertThat( requestArgument.getValue().invocationType(), equalTo(InvocationType.RequestResponse.toString())); }
/** * Use this in place of valueOf to convert the raw string returned by the service into the enum value. * * @param value * real value * @return InvocationType corresponding to the value */ public static InvocationType fromValue(String value) { if (value == null) { return null; } return Stream.of(InvocationType.values()).filter(e -> e.toString().equals(value)).findFirst() .orElse(UNKNOWN_TO_SDK_VERSION); }
/** * Use this in place of {@link #values()} to return a {@link Set} of all values known to the SDK. This will return * all known enum values except {@link #UNKNOWN_TO_SDK_VERSION}. * * @return a {@link Set} of known {@link InvocationType}s */ public static Set<InvocationType> knownValues() { return Stream.of(values()).filter(v -> v != UNKNOWN_TO_SDK_VERSION).collect(toSet()); } }
return InvocationType.fromValue(invocationType);
/** * Use this in place of valueOf to convert the raw string returned by the service into the enum value. * * @param value * real value * @return InvocationType corresponding to the value */ public static InvocationType fromValue(String value) { if (value == null) { return null; } return Stream.of(InvocationType.values()).filter(e -> e.toString().equals(value)).findFirst() .orElse(UNKNOWN_TO_SDK_VERSION); }
/** * Use this in place of {@link #values()} to return a {@link Set} of all values known to the SDK. This will return * all known enum values except {@link #UNKNOWN_TO_SDK_VERSION}. * * @return a {@link Set} of known {@link InvocationType}s */ public static Set<InvocationType> knownValues() { return Stream.of(values()).filter(v -> v != UNKNOWN_TO_SDK_VERSION).collect(toSet()); } }
return InvocationType.fromValue(invocationType);
@Test public void triggerUsesEventInvocation() { function.triggerAsync(new TestInput("test")).join(); verify(client).invoke(requestArgument.capture()); assertThat( requestArgument.getValue().invocationType(), equalTo(InvocationType.Event.toString())); }
@Override public final Builder invocationType(InvocationType invocationType) { this.invocationType(invocationType.toString()); return this; }
@Override public final Builder invocationType(InvocationType invocationType) { this.invocationType(invocationType.toString()); return this; }