Initial project snapshot
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
package cluster
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestMeshLatestObservationKeySeparatesRouteHealthByRoute(t *testing.T) {
|
||||
key := meshLatestObservationKey(json.RawMessage(`{
|
||||
"observation_type":"synthetic_route_health",
|
||||
"route_id":"route-1"
|
||||
}`))
|
||||
if key != "synthetic_route_health:route-1" {
|
||||
t.Fatalf("key = %q", key)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMeshLatestObservationKeySeparatesConnectionManagerMode(t *testing.T) {
|
||||
key := meshLatestObservationKey(json.RawMessage(`{
|
||||
"observation_type":"peer_connection_manager",
|
||||
"transport_mode":"relay_control",
|
||||
"relay_node_id":"node-r"
|
||||
}`))
|
||||
if key != "peer_connection_manager:relay_control:node-r" {
|
||||
t.Fatalf("key = %q", key)
|
||||
}
|
||||
}
|
||||
|
||||
func TestMeshLatestObservationKeyDefaults(t *testing.T) {
|
||||
key := meshLatestObservationKey(json.RawMessage(`{}`))
|
||||
if key != "default" {
|
||||
t.Fatalf("key = %q", key)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user