Package io.specto.hoverfly.junit.core
Interface SimulationSource
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface SimulationSourceInterface for reading simulation source as a String
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description static SimulationSourceclasspath(java.lang.String classpath)Creates a simulation from the classpathstatic SimulationSourcedefaultPath(java.lang.String pathString)Creates a simulation from the file located in default hoverfly resource path which is relative to src/test/resources/hoverflystatic SimulationSourcedsl(StubServiceBuilder... stubServiceBuilder)Creates a simulation from the dsl You can pass in multipleStubServiceBuilderto simulate services with different base urlsstatic SimulationSourceempty()Creates no simulationstatic SimulationSourcefile(java.nio.file.Path path)Creates a simulation from a filejava.lang.StringgetSimulation()static SimulationSourcesimulation(Simulation simulation)Creates a simulation from aSimulationobjectstatic SimulationSourceurl(java.lang.String url)Creates a simulation from a URL stringstatic SimulationSourceurl(java.net.URL url)Creates a simulation from a URL
-
-
-
Method Detail
-
url
static SimulationSource url(java.net.URL url)
Creates a simulation from a URL- Parameters:
url- the url of the simulation- Returns:
- the resource
-
url
static SimulationSource url(java.lang.String url)
Creates a simulation from a URL string- Parameters:
url- the url of the simulation- Returns:
- the resource
-
classpath
static SimulationSource classpath(java.lang.String classpath)
Creates a simulation from the classpath- Parameters:
classpath- the classpath of the simulation- Returns:
- the resource
-
defaultPath
static SimulationSource defaultPath(java.lang.String pathString)
Creates a simulation from the file located in default hoverfly resource path which is relative to src/test/resources/hoverfly- Parameters:
pathString- path string relative to the default hoverfly resource path- Returns:
- the resource
-
file
static SimulationSource file(java.nio.file.Path path)
Creates a simulation from a file- Parameters:
path- the file path of the simulation- Returns:
- the resource
-
dsl
static SimulationSource dsl(StubServiceBuilder... stubServiceBuilder)
Creates a simulation from the dsl You can pass in multipleStubServiceBuilderto simulate services with different base urls- Parameters:
stubServiceBuilder- the fluent builder forRequestResponsePair- Returns:
- the resource
- See Also:
HoverflyDsl
-
simulation
static SimulationSource simulation(Simulation simulation)
Creates a simulation from aSimulationobject- Parameters:
simulation- the simulation- Returns:
- the simulation
-
empty
static SimulationSource empty()
Creates no simulation- Returns:
- an empty simulation
-
getSimulation
java.lang.String getSimulation()
-
-