Documentation ¶
Index ¶
- Constants
- Variables
- func GetHandlerByPathAndMethod(t *testing.T, handlers []obsidian.Handler, path string, ...) obsidian.Handler
- func JSONMarshaler(v interface{}) encoding.BinaryMarshaler
- func RunTest(t *testing.T, tst Testcase) (int, string, error)
- func RunUnitTest(t *testing.T, e *echo.Echo, test Test)
- func SendHttpRequest(method, url, payload string) (int, string, error)
- func StartObsidian(t *testing.T) int
- type Test
- type Testcase
Constants ¶
View Source
const TEST_ADMIN_OPERATOR_ID = "Obsidian_Unit_Test_Admin_Operator"
Variables ¶
View Source
var TestOperatorSerialNumber string
Functions ¶
func GetHandlerByPathAndMethod ¶
func GetHandlerByPathAndMethod(t *testing.T, handlers []obsidian.Handler, path string, method obsidian.HttpMethod) obsidian.Handler
GetHandlerByPathAndMethod fetches the first obsidian.Handler that matches the given path and method from a list of handlers. If no such handler exists, it will fail.
func JSONMarshaler ¶
func JSONMarshaler(v interface{}) encoding.BinaryMarshaler
func RunUnitTest ¶
RunUnitTest runs a test case using the given Echo instance. This function does not start an obsidian server..
func SendHttpRequest ¶
SendHttpRequest is a wrapper to util.SendHttpRequest with extra test Admin Certificate HTTP Header which is needed to pass access control midleware
func StartObsidian ¶
Types ¶
type Test ¶
type Test struct { Method string URL string Payload encoding.BinaryMarshaler Handler echo.HandlerFunc ParamNames []string ParamValues []string ExpectedStatus int ExpectedResult encoding.BinaryMarshaler ExpectedError string }
Click to show internal directories.
Click to hide internal directories.