Search in sources :

Example 1 with CommunicationMode

use of io.scalecube.services.CommunicationMode in project scalecube by scalecube.

the class ReflectTest method testCommunicationMode.

/**
 * Test communication mode.
 *
 * @param methodName method name
 * @param expectedMode expected mode
 */
@ParameterizedTest
@MethodSource("argsCommunicationModeProvider")
public void testCommunicationMode(String methodName, CommunicationMode expectedMode) {
    // Given:
    Method m = Arrays.stream(TestService.class.getMethods()).filter(meth -> meth.getName().equals(methodName)).findFirst().get();
    // When:
    CommunicationMode communicationMode = Reflect.communicationMode(m);
    // Then:
    Assertions.assertEquals(expectedMode, communicationMode, "Invalid communicationMode");
}
Also used : CommunicationMode(io.scalecube.services.CommunicationMode) Method(java.lang.reflect.Method) ParameterizedTest(org.junit.jupiter.params.ParameterizedTest) MethodSource(org.junit.jupiter.params.provider.MethodSource)

Aggregations

CommunicationMode (io.scalecube.services.CommunicationMode)1 Method (java.lang.reflect.Method)1 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)1 MethodSource (org.junit.jupiter.params.provider.MethodSource)1