forked from ravendb/ravendb-go-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathget_tcp_info_test.go
33 lines (27 loc) · 887 Bytes
/
get_tcp_info_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
package tests
import (
"testing"
ravendb "github.com/ravendb/ravendb-go-client"
"github.com/stretchr/testify/assert"
)
func getTcpInfoTestCanGetTcpInfo(t *testing.T, driver *RavenTestDriver) {
store := driver.getDocumentStoreMust(t)
defer store.Close()
command := ravendb.NewGetTcpInfoCommand("test", "")
err := store.GetRequestExecutor("").ExecuteCommand(command, nil)
assert.NoError(t, err)
result := command.Result
assert.NotNil(t, result)
assert.Nil(t, result.Certificate)
// Note: in Java this tests for non-nil but Port is not sent
// in Json, so don't quite understand that. Unless Java check
// is bogus
assert.Equal(t, 0, result.Port)
assert.NotEmpty(t, result.URL)
}
func TestGetTcpInfo(t *testing.T) {
driver := createTestDriver(t)
destroy := func() { destroyDriver(t, driver) }
defer recoverTest(t, destroy)
getTcpInfoTestCanGetTcpInfo(t, driver)
}