khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2021-present Open Networking Foundation |
| 3 | |
| 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 | |
| 17 | //Package mocks provides the mocks for openolt-adapter. |
| 18 | package mocks |
| 19 | |
| 20 | import ( |
| 21 | "context" |
| 22 | |
| 23 | "github.com/golang/protobuf/ptypes/empty" |
| 24 | vgrpc "github.com/opencord/voltha-lib-go/v7/pkg/grpc" |
khenaidoo | dc2116e | 2021-10-19 17:33:19 -0400 | [diff] [blame] | 25 | ia "github.com/opencord/voltha-protos/v5/go/inter_adapter" |
khenaidoo | efff76e | 2021-12-15 16:51:30 -0500 | [diff] [blame] | 26 | "github.com/opencord/voltha-protos/v5/go/onu_inter_adapter_service" |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame] | 27 | "google.golang.org/grpc" |
| 28 | ) |
| 29 | |
| 30 | // NewMockChildAdapterClient create a mock child adapter client |
| 31 | func NewMockChildAdapterClient(srv *MockOnuInterAdapterService) *vgrpc.Client { |
khenaidoo | efff76e | 2021-12-15 16:51:30 -0500 | [diff] [blame] | 32 | cc, _ := vgrpc.NewClient("mock-child-endpoint", "mock-server-endpoint", "OnuInterAdapterService", nil) |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame] | 33 | cc.SetService(srv) |
| 34 | return cc |
| 35 | } |
| 36 | |
| 37 | // MockOnuInterAdapterService represents a child adapter mock service |
| 38 | type MockOnuInterAdapterService struct { |
| 39 | } |
| 40 | |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame] | 41 | // OnuIndication implements mock OnuIndication |
khenaidoo | dc2116e | 2021-10-19 17:33:19 -0400 | [diff] [blame] | 42 | func (mos *MockOnuInterAdapterService) OnuIndication(ctx context.Context, in *ia.OnuIndicationMessage, opts ...grpc.CallOption) (*empty.Empty, error) { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame] | 43 | return &empty.Empty{}, nil |
| 44 | } |
| 45 | |
| 46 | // OmciResponse implements mock OmciResponse |
khenaidoo | dc2116e | 2021-10-19 17:33:19 -0400 | [diff] [blame] | 47 | func (mos *MockOnuInterAdapterService) OmciResponse(ctx context.Context, in *ia.OmciMessage, opts ...grpc.CallOption) (*empty.Empty, error) { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame] | 48 | return &empty.Empty{}, nil |
| 49 | } |
| 50 | |
| 51 | // DownloadTechProfile implements mock DownloadTechProfile |
khenaidoo | dc2116e | 2021-10-19 17:33:19 -0400 | [diff] [blame] | 52 | func (mos *MockOnuInterAdapterService) DownloadTechProfile(ctx context.Context, in *ia.TechProfileDownloadMessage, opts ...grpc.CallOption) (*empty.Empty, error) { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame] | 53 | return &empty.Empty{}, nil |
| 54 | } |
| 55 | |
| 56 | // DeleteGemPort implements mock DeleteGemPort |
khenaidoo | dc2116e | 2021-10-19 17:33:19 -0400 | [diff] [blame] | 57 | func (mos *MockOnuInterAdapterService) DeleteGemPort(ctx context.Context, in *ia.DeleteGemPortMessage, opts ...grpc.CallOption) (*empty.Empty, error) { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame] | 58 | return &empty.Empty{}, nil |
| 59 | } |
| 60 | |
| 61 | // DeleteTCont implements mock DeleteTCont |
khenaidoo | dc2116e | 2021-10-19 17:33:19 -0400 | [diff] [blame] | 62 | func (mos *MockOnuInterAdapterService) DeleteTCont(ctx context.Context, in *ia.DeleteTcontMessage, opts ...grpc.CallOption) (*empty.Empty, error) { |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame] | 63 | return &empty.Empty{}, nil |
| 64 | } |
khenaidoo | efff76e | 2021-12-15 16:51:30 -0500 | [diff] [blame] | 65 | |
| 66 | // GetHealthStatus implements mock GetHealthStatus |
| 67 | func (mos MockOnuInterAdapterService) GetHealthStatus(ctx context.Context, opts ...grpc.CallOption) (onu_inter_adapter_service.OnuInterAdapterService_GetHealthStatusServer, error) { |
| 68 | return nil, nil |
| 69 | } |