| // Copyright 2015 The Vanadium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style |
| // license that can be found in the LICENSE file. |
| "v.io/v23/services/application" |
| "v.io/x/ref/services/binary/tidy/binaryd" |
| "v.io/x/ref/services/internal/servicetest" |
| type mockAppdInvoker struct { |
| binaryd.MockBinarydInvoker |
| type MatchStimulus struct { |
| type MatchResult struct { |
| func (mdi *mockAppdInvoker) Match(ctx *context.T, _ rpc.ServerCall, profiles []string) (application.Envelope, error) { |
| ir := mdi.Tape.Record(MatchStimulus{"Match", mdi.Suffix, profiles}) |
| func (mdi *mockAppdInvoker) TidyNow(ctx *context.T, _ rpc.ServerCall) error { |
| return mdi.SimpleCore("TidyNow", "TidyNow") |
| func NewDispatcher(t *testing.T, tape *servicetest.Tape) rpc.Dispatcher { |
| return &dispatcher{tape: tape, t: t} |
| func (d *dispatcher) Lookup(p *context.T, suffix string) (interface{}, security.Authorizer, error) { |
| return &mockAppdInvoker{binaryd.NewMockBinarydInvoker(suffix, d.tape, d.t)}, nil, nil |