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 | "github.com/opencord/voltha-protos/v5/go/health" |
| 26 | ia "github.com/opencord/voltha-protos/v5/go/inter_adapter" |
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 { |
| 32 | cc, _ := vgrpc.NewClient("mock-endpoint", nil) |
| 33 | cc.SetService(srv) |
| 34 | return cc |
| 35 | } |
| 36 | |
| 37 | // MockOnuInterAdapterService represents a child adapter mock service |
| 38 | type MockOnuInterAdapterService struct { |
| 39 | } |
| 40 | |
| 41 | // GetHealthStatus implements mock GetHealthStatus |
khenaidoo | dc2116e | 2021-10-19 17:33:19 -0400 | [diff] [blame] | 42 | func (mos MockOnuInterAdapterService) GetHealthStatus(ctx context.Context, in *empty.Empty, opts ...grpc.CallOption) (*health.HealthStatus, error) { |
| 43 | return &health.HealthStatus{State: health.HealthStatus_HEALTHY}, nil |
khenaidoo | 106c61a | 2021-08-11 18:05:46 -0400 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | // OnuIndication implements mock OnuIndication |
khenaidoo | dc2116e | 2021-10-19 17:33:19 -0400 | [diff] [blame] | 47 | 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] | 48 | return &empty.Empty{}, nil |
| 49 | } |
| 50 | |
| 51 | // OmciResponse implements mock OmciResponse |
khenaidoo | dc2116e | 2021-10-19 17:33:19 -0400 | [diff] [blame] | 52 | 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] | 53 | return &empty.Empty{}, nil |
| 54 | } |
| 55 | |
| 56 | // DownloadTechProfile implements mock DownloadTechProfile |
khenaidoo | dc2116e | 2021-10-19 17:33:19 -0400 | [diff] [blame] | 57 | 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] | 58 | return &empty.Empty{}, nil |
| 59 | } |
| 60 | |
| 61 | // DeleteGemPort implements mock DeleteGemPort |
khenaidoo | dc2116e | 2021-10-19 17:33:19 -0400 | [diff] [blame] | 62 | 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] | 63 | return &empty.Empty{}, nil |
| 64 | } |
| 65 | |
| 66 | // DeleteTCont implements mock DeleteTCont |
khenaidoo | dc2116e | 2021-10-19 17:33:19 -0400 | [diff] [blame] | 67 | 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] | 68 | return &empty.Empty{}, nil |
| 69 | } |