summaryrefslogtreecommitdiffhomepage
path: root/pkg/server/server_test.go
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-10-27 21:43:01 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2018-10-28 21:36:37 +0900
commit5d7ecf5a9e68bcd1a71bc6468e0075f1f9d028ba (patch)
treee2573a7156d685732720bfb74e7e4220ab13e533 /pkg/server/server_test.go
parentd032c3153e72ab3c01355a20098ac1b68d26cba5 (diff)
move NewAPIPolicyAssignmentFromTableStruct() from server/
The table is an internal package so it should not be exported. NewAPIPolicyAssignmentFromTableStruct() is approprate for table/. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Diffstat (limited to 'pkg/server/server_test.go')
-rw-r--r--pkg/server/server_test.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/pkg/server/server_test.go b/pkg/server/server_test.go
index 079f452c..8d17c03d 100644
--- a/pkg/server/server_test.go
+++ b/pkg/server/server_test.go
@@ -48,19 +48,19 @@ func TestModPolicyAssign(t *testing.T) {
assert.Nil(err)
defer s.StopBgp(context.Background(), &api.StopBgpRequest{})
- err = s.AddPolicy(context.Background(), &api.AddPolicyRequest{Policy: NewAPIPolicyFromTableStruct(&table.Policy{Name: "p1"})})
+ err = s.AddPolicy(context.Background(), &api.AddPolicyRequest{Policy: table.NewAPIPolicyFromTableStruct(&table.Policy{Name: "p1"})})
assert.Nil(err)
- err = s.AddPolicy(context.Background(), &api.AddPolicyRequest{Policy: NewAPIPolicyFromTableStruct(&table.Policy{Name: "p2"})})
+ err = s.AddPolicy(context.Background(), &api.AddPolicyRequest{Policy: table.NewAPIPolicyFromTableStruct(&table.Policy{Name: "p2"})})
assert.Nil(err)
- err = s.AddPolicy(context.Background(), &api.AddPolicyRequest{Policy: NewAPIPolicyFromTableStruct(&table.Policy{Name: "p3"})})
+ err = s.AddPolicy(context.Background(), &api.AddPolicyRequest{Policy: table.NewAPIPolicyFromTableStruct(&table.Policy{Name: "p3"})})
assert.Nil(err)
f := func(l []*config.PolicyDefinition) *api.PolicyAssignment {
pl := make([]*api.Policy, 0, len(l))
for _, d := range l {
- pl = append(pl, toPolicyApi(d))
+ pl = append(pl, table.ToPolicyApi(d))
}
return &api.PolicyAssignment{
Policies: pl,
@@ -132,7 +132,7 @@ func TestListPolicyAssignment(t *testing.T) {
assert.Nil(err)
err = s.AddPolicy(context.Background(),
- &api.AddPolicyRequest{Policy: NewAPIPolicyFromTableStruct(&table.Policy{Name: fmt.Sprintf("p%d", i)})})
+ &api.AddPolicyRequest{Policy: table.NewAPIPolicyFromTableStruct(&table.Policy{Name: fmt.Sprintf("p%d", i)})})
assert.Nil(err)
pa := &api.PolicyAssignment{