27 lines
439 B
Go
27 lines
439 B
Go
package tests
|
|
|
|
import (
|
|
"net/http"
|
|
"testing"
|
|
)
|
|
|
|
type aliasPayload struct {
|
|
Id int64 `json:"id"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
var aliases []aliasPayload
|
|
|
|
func Test_04_GetAliases(t *testing.T) {
|
|
resp, err := client.R().
|
|
SetResult(&aliases).
|
|
Get("/api/aliases")
|
|
if err != nil || resp.StatusCode() != http.StatusOK {
|
|
t.Logf("%+v", resp)
|
|
t.Fatal("failed to get aliases")
|
|
}
|
|
if len(aliases) == 0 {
|
|
t.Fatal("no aliases")
|
|
}
|
|
}
|