Skip to content

Commit

Permalink
Unit test LicenseInfo#toMap
Browse files Browse the repository at this point in the history
  • Loading branch information
thbkrkr committed Dec 17, 2019
1 parent 2054563 commit f8b86bf
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions pkg/license/license_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.

package license

import (
"testing"

"github.com/stretchr/testify/assert"
)

func TestToMap(t *testing.T) {
i := LicensingInfo{}
data, err := i.toMap()
assert.NoError(t, err)
assert.Equal(t, 4, len(data))
assert.Equal(t, "", data["eck_license_level"])

i = LicensingInfo{EckLicenseLevel: "basic"}
data, err = i.toMap()
assert.NoError(t, err)
assert.Equal(t, 4, len(data))
assert.Equal(t, "basic", data["eck_license_level"])
}

0 comments on commit f8b86bf

Please sign in to comment.