// Test ServiceInfo JSON marshaling func TestJsonServiceInfo(t *testing.T) { info := core.ServerInfo{ Version: "1.2.3", Timestamp: "2015-10-22T14:15:16.999", WebsocketUrl: "ws://devicehive.com"} testCheckJson(t, info, `{"apiVersion":"1.2.3","serverTimestamp":"2015-10-22T14:15:16.999","webSocketServerUrl":"ws://devicehive.com"}`) info.WebsocketUrl = "" info.RestUrl = "https://devicehive.com" testCheckJson(t, info, `{"apiVersion":"1.2.3","serverTimestamp":"2015-10-22T14:15:16.999","restServerUrl":"https://devicehive.com"}`) }