-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_test.go
52 lines (45 loc) · 950 Bytes
/
main_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
package main
import (
"atlas-rest-golang/confluence/serv"
"encoding/base64"
"fmt"
"log"
"testing"
)
const (
confUrl = "http://localhost:8510"
user = "admin"
)
func TestCreatePage(t *testing.T) {
pageService := serv.PageService{}
tok := base64.StdEncoding.EncodeToString([]byte("admin:admin"))
pageService.CreateContent(
confUrl,
tok,
"page",
"DEV",
"98371",
"GO page 1",
"asdasdsad")
}
func TestGetPage(t *testing.T) {
//
pageService := serv.PageService{}
tok := base64.StdEncoding.EncodeToString([]byte("admin:admin"))
page := pageService.GetPage(confUrl, tok, "98371")
log.Println(page.Body.Storage.Value)
}
func TestCreateNpages(t *testing.T) {
pageService := serv.PageService{}
tok := base64.StdEncoding.EncodeToString([]byte("admin:admin"))
for i := 2; i < 20; i++ {
pageService.CreateContent(
confUrl,
tok,
"page",
"DEV",
"98371",
fmt.Sprintf("GO page %d", i),
"asdasdsad")
}
}