@Test
public void testInvokeTimeout() throws Exception {

   MethodConfig methodConfig = MethodConfig.createBuilder(SERVICE_NAME, BEAN_NAME + ":" + FIELD_NAME)
                                           .hystrixActive(true)
                                           .commandProperty(CommandProperties.EXECUTION_TIMEOUT_ENABLED, Boolean.TRUE.toString())
                                           .build();
   ServiceConfig serviceConfig = new ServiceConfig(methodConfig);
   HystrixMethodHandler hystrixMethodHandler = new HystrixMethodHandler(parentMethodHandler, serviceConfig);
   Method method = UnstableMicroservice.class.getMethod("timeout");
   Mockito.when(parentMethodHandler.invoke(method)).thenAnswer(a -> method.invoke(UnstableMicroservice.class));
   assertThatThrownBy(() -> hystrixMethodHandler.invoke(method))
         .isInstanceOf(HystrixRuntimeException.class)
         .hasMessageContaining("timed-out");
}