blob: 0a05ff312797bb3c2e13a830aca2c877b18b938b [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
khenaidoo106c61a2021-08-11 18:05:46 -040023 vgrpc "github.com/opencord/voltha-lib-go/v7/pkg/grpc"
khenaidoodc2116e2021-10-19 17:33:19 -040024 ia "github.com/opencord/voltha-protos/v5/go/inter_adapter"
khenaidooefff76e2021-12-15 16:51:30 -050025 "github.com/opencord/voltha-protos/v5/go/onu_inter_adapter_service"
khenaidoo106c61a2021-08-11 18:05:46 -040026 "google.golang.org/grpc"
bseeniva0b9cbcb2026-02-12 19:11:11 +053027 "google.golang.org/protobuf/types/known/emptypb"
khenaidoo106c61a2021-08-11 18:05:46 -040028)
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
bseeniva0b9cbcb2026-02-12 19:11:11 +053042func (mos *MockOnuInterAdapterService) OnuIndication(ctx context.Context, in *ia.OnuIndicationMessage, opts ...grpc.CallOption) (*emptypb.Empty, error) {
43 return &emptypb.Empty{}, nil
khenaidoo106c61a2021-08-11 18:05:46 -040044}
45
46// OmciResponse implements mock OmciResponse
bseeniva0b9cbcb2026-02-12 19:11:11 +053047func (mos *MockOnuInterAdapterService) OmciResponse(ctx context.Context, in *ia.OmciMessage, opts ...grpc.CallOption) (*emptypb.Empty, error) {
48 return &emptypb.Empty{}, nil
khenaidoo106c61a2021-08-11 18:05:46 -040049}
50
51// DownloadTechProfile implements mock DownloadTechProfile
bseeniva0b9cbcb2026-02-12 19:11:11 +053052func (mos *MockOnuInterAdapterService) DownloadTechProfile(ctx context.Context, in *ia.TechProfileDownloadMessage, opts ...grpc.CallOption) (*emptypb.Empty, error) {
53 return &emptypb.Empty{}, nil
khenaidoo106c61a2021-08-11 18:05:46 -040054}
55
56// DeleteGemPort implements mock DeleteGemPort
bseeniva0b9cbcb2026-02-12 19:11:11 +053057func (mos *MockOnuInterAdapterService) DeleteGemPort(ctx context.Context, in *ia.DeleteGemPortMessage, opts ...grpc.CallOption) (*emptypb.Empty, error) {
58 return &emptypb.Empty{}, nil
khenaidoo106c61a2021-08-11 18:05:46 -040059}
60
61// DeleteTCont implements mock DeleteTCont
bseeniva0b9cbcb2026-02-12 19:11:11 +053062func (mos *MockOnuInterAdapterService) DeleteTCont(ctx context.Context, in *ia.DeleteTcontMessage, opts ...grpc.CallOption) (*emptypb.Empty, error) {
63 return &emptypb.Empty{}, nil
khenaidoo106c61a2021-08-11 18:05:46 -040064}
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}