Class AbstractOpa
- java.lang.Object
-
- org.sdase.commons.server.opa.testing.AbstractOpa
-
- Direct Known Subclasses:
OpaClassExtension
public abstract class AbstractOpa extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
AbstractOpa.AllowBuilder
static interface
AbstractOpa.BuildBuilder
static interface
AbstractOpa.FinalBuilder
static interface
AbstractOpa.RequestExtraBuilder
static interface
AbstractOpa.RequestMethodBuilder
static interface
AbstractOpa.RequestPathBuilder
static class
AbstractOpa.StubBuilder
-
Constructor Summary
Constructors Constructor Description AbstractOpa()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.github.tomakehurst.wiremock.matching.RequestPatternBuilder
buildRequestPattern(AbstractOpa.StubBuilder builder)
static AbstractOpa.AllowBuilder
onAnyRequest()
static AbstractOpa.RequestMethodBuilder
onRequest()
Create a builder to match a request.void
verify(int count, java.lang.String httpMethod, java.lang.String path)
Verify if the policy was called for the method/pathvoid
verify(int count, AbstractOpa.AllowBuilder allowBuilder)
-
-
-
Method Detail
-
onRequest
public static AbstractOpa.RequestMethodBuilder onRequest()
Create a builder to match a request.- Returns:
- the builder
-
onAnyRequest
public static AbstractOpa.AllowBuilder onAnyRequest()
-
verify
public void verify(int count, java.lang.String httpMethod, java.lang.String path)
Verify if the policy was called for the method/pathPlease prefer to use
verify(count, onRequest().withHttpMethod(httpMethod).withPath(path))
instead.- Parameters:
count
- the expected count of callshttpMethod
- the HTTP method to checkpath
- the path to check
-
verify
public void verify(int count, AbstractOpa.AllowBuilder allowBuilder)
-
buildRequestPattern
public com.github.tomakehurst.wiremock.matching.RequestPatternBuilder buildRequestPattern(AbstractOpa.StubBuilder builder)
-
-