blob: ee740e82a0e6d3c3a828c91de32258d2f9c054f7 [file] [log] [blame]
khenaidoo106c61a2021-08-11 18:05:46 -04001/*
Joey Armstrong11f5a572024-01-12 19:11:32 -05002 * Copyright 2021-2024 Open Networking Foundation (ONF) and the ONF Contributors
khenaidoo106c61a2021-08-11 18:05:46 -04003
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7
8 * http://www.apache.org/licenses/LICENSE-2.0
9
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Joey Armstrong3f0e2422023-07-05 18:25:41 -040017// Package mocks provides the mocks for openolt-adapter.
khenaidoo106c61a2021-08-11 18:05:46 -040018package mocks
19
20import (
21 "context"
22
23 "github.com/golang/protobuf/ptypes/empty"
24 vgrpc "github.com/opencord/voltha-lib-go/v7/pkg/grpc"
khenaidoodc2116e2021-10-19 17:33:19 -040025 ia "github.com/opencord/voltha-protos/v5/go/inter_adapter"
khenaidooefff76e2021-12-15 16:51:30 -050026 "github.com/opencord/voltha-protos/v5/go/onu_inter_adapter_service"
khenaidoo106c61a2021-08-11 18:05:46 -040027 "google.golang.org/grpc"
28)
29
30// NewMockChildAdapterClient create a mock child adapter client
31func NewMockChildAdapterClient(srv *MockOnuInterAdapterService) *vgrpc.Client {
khenaidooefff76e2021-12-15 16:51:30 -050032 cc, _ := vgrpc.NewClient("mock-child-endpoint", "mock-server-endpoint", "OnuInterAdapterService", nil)
khenaidoo106c61a2021-08-11 18:05:46 -040033 cc.SetService(srv)
34 return cc
35}
36
37// MockOnuInterAdapterService represents a child adapter mock service
38type MockOnuInterAdapterService struct {
39}
40
khenaidoo106c61a2021-08-11 18:05:46 -040041// OnuIndication implements mock OnuIndication
khenaidoodc2116e2021-10-19 17:33:19 -040042func (mos *MockOnuInterAdapterService) OnuIndication(ctx context.Context, in *ia.OnuIndicationMessage, opts ...grpc.CallOption) (*empty.Empty, error) {
khenaidoo106c61a2021-08-11 18:05:46 -040043 return &empty.Empty{}, nil
44}
45
46// OmciResponse implements mock OmciResponse
khenaidoodc2116e2021-10-19 17:33:19 -040047func (mos *MockOnuInterAdapterService) OmciResponse(ctx context.Context, in *ia.OmciMessage, opts ...grpc.CallOption) (*empty.Empty, error) {
khenaidoo106c61a2021-08-11 18:05:46 -040048 return &empty.Empty{}, nil
49}
50
51// DownloadTechProfile implements mock DownloadTechProfile
khenaidoodc2116e2021-10-19 17:33:19 -040052func (mos *MockOnuInterAdapterService) DownloadTechProfile(ctx context.Context, in *ia.TechProfileDownloadMessage, opts ...grpc.CallOption) (*empty.Empty, error) {
khenaidoo106c61a2021-08-11 18:05:46 -040053 return &empty.Empty{}, nil
54}
55
56// DeleteGemPort implements mock DeleteGemPort
khenaidoodc2116e2021-10-19 17:33:19 -040057func (mos *MockOnuInterAdapterService) DeleteGemPort(ctx context.Context, in *ia.DeleteGemPortMessage, opts ...grpc.CallOption) (*empty.Empty, error) {
khenaidoo106c61a2021-08-11 18:05:46 -040058 return &empty.Empty{}, nil
59}
60
61// DeleteTCont implements mock DeleteTCont
khenaidoodc2116e2021-10-19 17:33:19 -040062func (mos *MockOnuInterAdapterService) DeleteTCont(ctx context.Context, in *ia.DeleteTcontMessage, opts ...grpc.CallOption) (*empty.Empty, error) {
khenaidoo106c61a2021-08-11 18:05:46 -040063 return &empty.Empty{}, nil
64}
khenaidooefff76e2021-12-15 16:51:30 -050065
66// GetHealthStatus implements mock GetHealthStatus
67func (mos MockOnuInterAdapterService) GetHealthStatus(ctx context.Context, opts ...grpc.CallOption) (onu_inter_adapter_service.OnuInterAdapterService_GetHealthStatusServer, error) {
68 return nil, nil
69}