Example #1
0
// Ensure the store returns an error when removing an instance from a non-existent service.
func TestStore_RemoveInstance_ErrNotFound(t *testing.T) {
	s := MustOpenStore()
	defer s.Close()
	if err := s.RemoveInstance("no_such_service", "inst0"); !server.IsNotFound(err) {
		t.Fatalf("unexpected error: %s", err)
	}
}
Example #2
0
// Ensure the store can add instances to a service.
func TestStore_AddInstance_ErrNotFound(t *testing.T) {
	s := MustOpenStore()
	defer s.Close()
	if err := s.AddInstance("no_such_service", &discoverd.Instance{ID: "inst0"}); !server.IsNotFound(err) {
		t.Fatalf("unexpected error: %s", err)
	}
}
Example #3
0
// Ensure the store returns an error when setting metadata for a non-existent service.
func TestStore_SetServiceMeta_ErrNotFound(t *testing.T) {
	s := MustOpenStore()
	defer s.Close()
	if err := s.SetServiceMeta("service0", &discoverd.ServiceMeta{Data: []byte(`"foo"`), Index: 0}); !server.IsNotFound(err) {
		t.Fatalf("unexpected error: %s", err)
	}
}