From 65453c487a20f21bbf8e9d74c9f3b9ae950656e0 Mon Sep 17 00:00:00 2001 From: Christopher Meiklejohn Date: Wed, 5 Jul 2023 14:45:02 -0400 Subject: [PATCH] Switch to helper. --- .../junit/statem/FilibusterGrpcTest.java | 36 +------------------ 1 file changed, 1 insertion(+), 35 deletions(-) diff --git a/src/main/java/cloud/filibuster/junit/statem/FilibusterGrpcTest.java b/src/main/java/cloud/filibuster/junit/statem/FilibusterGrpcTest.java index 0620246fe..ef6e2d95e 100644 --- a/src/main/java/cloud/filibuster/junit/statem/FilibusterGrpcTest.java +++ b/src/main/java/cloud/filibuster/junit/statem/FilibusterGrpcTest.java @@ -95,41 +95,7 @@ default void execute() { shouldRunAssertionBlock = false; } } else { - // Single fault. - // - // See if we have special error handling for this fault, then bypass the existing assertion block - // in favor of the fault-specific assertion block. - // - if (argsKey != null && modifiedAssertionsByRequest.containsKey(methodKey + argsKey)) { - try { - modifiedAssertionsByRequest.get(methodKey + argsKey).run(); - } catch (Throwable t) { - throw new FilibusterGrpcTestRuntimeException( - "Assertions in onFaultOnRequest(" + methodKey + ", ReqT, Runnable) failed.", - "Please adjust assertions in onFaultOnRequest(" + methodKey + ", " + argsKey.replaceAll("\\n", "") + ", Runnable) so that test passes.", - t); - } - - shouldRunAssertionBlock = false; - } else if (modifiedAssertionsByMethod.containsKey(methodKey)) { - try { - modifiedAssertionsByMethod.get(methodKey).run(); - } catch (Throwable t) { - throw new FilibusterGrpcTestRuntimeException( - "Assertions in onFaultOnMethod(" + methodKey + ", Runnable) failed.", - "Please adjust assertions in onFaultOnMethod(" + methodKey + ", Runnable) so that test passes.", - t); - } - shouldRunAssertionBlock = false; - } else { - if (!methodsWithNoFaultImpact.contains(methodKey)) { - throw new FilibusterGrpcTestRuntimeException( - "Test injected a fault, but no specification of failure behavior present.", - "Please use onFaultOnMethod(MethodDescriptor, Runnable), onFaultOnRequest(MethodDescriptor, ReqT, Runnable), or onFaultOnMethodHasNoEffect(MethodDescriptor) to specify assertions under fault."); - } - - // Otherwise, pass through and run normal assertion blcok. - } + shouldRunAssertionBlock = performSingleFaultChecking(methodKey, argsKey); } }