FallbackMethod fallbackMethod = MethodProvider.getInstance().getFallbackMethod(obj.getClass(), batchCommandMethod); if (fallbackMethod.isPresent()) { fallbackMethod.validateReturnType(batchCommandMethod); builder .fallbackMethod(fallbackMethod.getMethod())
@UseDataProvider("success") public void testValidateCorrectFallbackReturnType(Method commandMethod, Method fallbackMethod) { new FallbackMethod(fallbackMethod).validateReturnType(commandMethod); }
private static MetaHolder.Builder setFallbackMethod(MetaHolder.Builder builder, Class<?> declaringClass, Method commandMethod) { FallbackMethod fallbackMethod = MethodProvider.getInstance().getFallbackMethod(declaringClass, commandMethod); if (fallbackMethod.isPresent()) { fallbackMethod.validateReturnType(commandMethod); builder .fallbackMethod(fallbackMethod.getMethod()) .fallbackExecutionType(ExecutionType.getExecutionType(fallbackMethod.getMethod().getReturnType())); } return builder; }
validateReturnType(commandMethod, method); validateReturnType(commandMethod, method); throw new FallbackDefinitionException(createErrorMsg(commandMethod, method, "fallback cannot return Observable if command isn't observable.")); validateReturnType(commandMethod, method);
@Test(expected = FallbackDefinitionException.class) @UseDataProvider("fail") public void testValidateBadFallbackReturnType(Method commandMethod, Method fallbackMethod) { new FallbackMethod(fallbackMethod).validateReturnType(commandMethod); }
fallbackMethod.validateReturnType(metaHolder.getMethod()); CommandAction fallbackAction = null; if (fallbackMethod.isPresent()) {
FallbackMethod fallbackMethod = MethodProvider.getInstance().getFallbackMethod(obj.getClass(), batchCommandMethod); if (fallbackMethod.isPresent()) { fallbackMethod.validateReturnType(batchCommandMethod); builder .fallbackMethod(fallbackMethod.getMethod())
private static MetaHolder.Builder setFallbackMethod(MetaHolder.Builder builder, Class<?> declaringClass, Method commandMethod) { FallbackMethod fallbackMethod = MethodProvider.getInstance().getFallbackMethod(declaringClass, commandMethod); if (fallbackMethod.isPresent()) { fallbackMethod.validateReturnType(commandMethod); builder .fallbackMethod(fallbackMethod.getMethod()) .fallbackExecutionType(ExecutionType.getExecutionType(fallbackMethod.getMethod().getReturnType())); } return builder; }
validateReturnType(commandMethod, method); validateReturnType(commandMethod, method); throw new FallbackDefinitionException(createErrorMsg(commandMethod, method, "fallback cannot return Observable if command isn't observable.")); validateReturnType(commandMethod, method);
fallbackMethod.validateReturnType(metaHolder.getMethod()); CommandAction fallbackAction = null; if (fallbackMethod.isPresent()) {