Class GrpcAssertions
- java.lang.Object
-
- cloud.filibuster.junit.assertions.protocols.GenericAssertions
-
- cloud.filibuster.junit.assertions.protocols.GrpcAssertions
-
public class GrpcAssertions extends GenericAssertions
-
-
Constructor Summary
Constructors Constructor Description GrpcAssertions()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
tryGrpcAndCatchGrpcExceptions(java.lang.Runnable block, org.junit.jupiter.api.function.ThrowingConsumer<java.lang.Throwable> catchBlock)
Execute a test and catch GRPC exceptions.static boolean
wasFaultInjectedOnMethod(io.grpc.MethodDescriptor method)
Returns true if a fault was injected on a GRPC method.static boolean
wasFaultInjectedOnRequest(com.google.protobuf.GeneratedMessage request)
Returns true if a fault was injected on a GRPC request.static boolean
wasFaultInjectedOnRequest(com.google.protobuf.GeneratedMessageV3 request)
Returns true if a fault was injected on a GRPC request.static boolean
wasFaultInjectedOnService(java.lang.String serviceName)
Returns true if a fault was injected on a GRPC service.-
Methods inherited from class cloud.filibuster.junit.assertions.protocols.GenericAssertions
wasFaultInjected, wasFaultInjectedHelper, wasFaultInjectedOnJavaClassAndMethod, wasFaultInjectedOnJavaClassAndMethod
-
-
-
-
Method Detail
-
tryGrpcAndCatchGrpcExceptions
public static void tryGrpcAndCatchGrpcExceptions(java.lang.Runnable block, org.junit.jupiter.api.function.ThrowingConsumer<java.lang.Throwable> catchBlock) throws java.lang.Throwable
Execute a test and catch GRPC exceptions.- Parameters:
block
- block to execute containing test.catchBlock
- assertion block triggered, if and only if, GRPC exception is thrown- Throws:
java.lang.Throwable
- rethrown exceptions generated by either the @{block} or @{catchBlock}
-
wasFaultInjectedOnService
public static boolean wasFaultInjectedOnService(java.lang.String serviceName)
Returns true if a fault was injected on a GRPC service.- Parameters:
serviceName
- GRPC fully-qualified service name including namespace.- Returns:
- if a fault was injected
-
wasFaultInjectedOnMethod
public static boolean wasFaultInjectedOnMethod(io.grpc.MethodDescriptor method)
Returns true if a fault was injected on a GRPC method.- Parameters:
method
- GRPC method descriptor- Returns:
- if a fault was injected.
-
wasFaultInjectedOnRequest
public static boolean wasFaultInjectedOnRequest(com.google.protobuf.GeneratedMessage request)
Returns true if a fault was injected on a GRPC request.- Parameters:
request
- GRPC message- Returns:
- if a fault was injected.
-
wasFaultInjectedOnRequest
public static boolean wasFaultInjectedOnRequest(com.google.protobuf.GeneratedMessageV3 request)
Returns true if a fault was injected on a GRPC request.- Parameters:
request
- GRPC message- Returns:
- if a fault was injected.
-
-