Skip to content

Commit

Permalink
refactor(inventory): rename to InventoryService
Browse files Browse the repository at this point in the history
Signed-off-by: Artsiom Koltun <[email protected]>
  • Loading branch information
artek-koltun committed Oct 25, 2023
1 parent 143a635 commit 997f80e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions inventory/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import (
)

// PbInvClientGetter defines the function type used to retrieve an inventory protobuf client
type PbInvClientGetter func(c grpc.ClientConnInterface) pb.InventorySvcClient
type PbInvClientGetter func(c grpc.ClientConnInterface) pb.InventoryServiceClient

type invClientImpl struct {
getInvClient PbInvClientGetter
Expand All @@ -35,7 +35,7 @@ func New(addr string) (InvClient, error) {
}

// Default is to use the OPI grpc client and the pb client generated from the protobuf spec
return NewWithArgs(c, pb.NewInventorySvcClient)
return NewWithArgs(c, pb.NewInventoryServiceClient)
}

// NewWithArgs creates an inventory client for use with OPI server using the given gRPC client and the given function for
Expand Down
4 changes: 2 additions & 2 deletions inventory/client_suite_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ func TestInventory(t *testing.T) {

func testCloser() {}

func getterWithResponse(_ grpc.ClientConnInterface) pb.InventorySvcClient {
func getterWithResponse(_ grpc.ClientConnInterface) pb.InventoryServiceClient {
mockPb := mocks.NewInventorySvcClient(GinkgoT())
mockPb.EXPECT().GetInventory(mock.Anything, mock.Anything).
Return(getTestInvResponse(), nil).Once()
return mockPb
}

func getterWithError(_ grpc.ClientConnInterface) pb.InventorySvcClient {
func getterWithError(_ grpc.ClientConnInterface) pb.InventoryServiceClient {
mockPb := mocks.NewInventorySvcClient(GinkgoT())
mockPb.EXPECT().GetInventory(mock.Anything, mock.Anything).
Return(nil, errors.New("error getting inventory")).Once()
Expand Down
4 changes: 2 additions & 2 deletions inventory/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ var _ = Describe("Inventory", func() {

Context("and the getter is valid", func() {
BeforeEach(func() {
g = func(c grpc.ClientConnInterface) pb.InventorySvcClient {
g = func(c grpc.ClientConnInterface) pb.InventoryServiceClient {
return &mocks.InventorySvcClient{}
}
c, err = inventory.NewWithArgs(m, g)
Expand Down Expand Up @@ -101,7 +101,7 @@ var _ = Describe("Inventory", func() {

Context("and the getter is valid", func() {
BeforeEach(func() {
g = func(c grpc.ClientConnInterface) pb.InventorySvcClient {
g = func(c grpc.ClientConnInterface) pb.InventoryServiceClient {
return &mocks.InventorySvcClient{}
}
c, err = inventory.NewWithArgs(m, g)
Expand Down

0 comments on commit 997f80e

Please sign in to comment.