Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExpectChannel ¶
type ExpectChannel string
ExpectChannel defines the type of expectation
const ( HTTP ExpectChannel = "HTTP" ReadMySQL ExpectChannel = "READ_MYSQL" WriteMySQL ExpectChannel = "WRITE_MYSQL" WritePostgreSQL ExpectChannel = "WRITE_POSTGRESQL" ReadPostgreSQL ExpectChannel = "READ_POSTGRESQL" Event ExpectChannel = "EVENT" )
type ExpectStatement ¶
type ExpectStatement struct {
Channel ExpectChannel
Method string // For HTTP
URL string // For HTTP
Table string // For DB
Topic string // For Kafka
SQL string // For DB (USING_SQL)
WithFile string // For Request Payload
ReturnsFile string // For Response Payload
ReturnsEmpty bool // For DB (RETURNS EMPTY)
NoTransaction bool // For WRITE:MYSQL
Verify []VerifyRule
Negative bool // If true, this should NOT be called
BaseDir string // To resolve payload files
Headers map[string]string // For HTTP header matching
}
ExpectStatement defines an external dependency expectation
type Mock ¶
type Mock interface {
GetChannel() ExpectChannel
GetName() string
GetVerifyRules() []VerifyRule
}
Mock is the common interface for protocol-specific mocks
type ReceiveStatement ¶
type ReceiveStatement struct {
Channel ExpectChannel
Method string
Path string
WithFile string
Headers map[string]string
}
ReceiveStatement defines the trigger request
type RespondStatement ¶
RespondStatement defines the mock response for the trigger
type TestSpec ¶
type TestSpec struct {
Name string
FilePath string
BaseDir string // Directory containing the .linespec and payloads/
Receive ReceiveStatement
Expects []ExpectStatement
ExpectsNot []ExpectStatement
Respond RespondStatement
Created time.Time
}
TestSpec is the full AST for a .linespec file
type VerifyRule ¶
VerifyRule defines a SQL verification rule
Click to show internal directories.
Click to hide internal directories.