diff --git a/go.mod b/go.mod index 6fae8568ad018c2973976e83dc39c166f063114d..bfb587709d7358391f38ec6e7224427c47239781 100644 --- a/go.mod +++ b/go.mod @@ -5,3 +5,5 @@ require ( github.com/spf13/jwalterweatherman v1.1.0 gitlab.com/elixxir/primitives v0.0.0-20200731184040-494269b53b4d ) + +go 1.13 diff --git a/ndf/ndf_test.go b/ndf/ndf_test.go index 7670e3a7bf74d4f34851cb8c944039d032bb6dad..1de313401fd12b43235790326da9ede0fc0a6834 100644 --- a/ndf/ndf_test.go +++ b/ndf/ndf_test.go @@ -409,19 +409,14 @@ func TestGetNodeId(t *testing.T) { } // Happy path -func TestNode_GetGatewayId(t *testing.T) { - jsonData, _, err := DecodeNDF(ExampleNDF) - if err != nil { - t.Errorf("DecodeNDF() unexpectedly produced an error"+ - "\n\treceived: %#v\n\texpected: %#v", - err, nil) - } +func TestGetGatewayId(t *testing.T) { + gw := Gateway{make([]byte, 33), "52.41.80.104", "-----BEGIN CERT"} // Expected id, pulled from the global ExampleNDF expectedId := []byte{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0} // Fetch the id - receivedGatewayId, err := jsonData.Nodes[0].GetGatewayId() + receivedGatewayId, err := gw.GetGatewayId() if err != nil { t.Errorf("GetGatewayId() produces an error:\n%v", err) }