diff --git a/internal/test/mock/discoverer_client_mock.go b/internal/test/mock/client/discoverer_client_mock.go similarity index 98% rename from internal/test/mock/discoverer_client_mock.go rename to internal/test/mock/client/discoverer_client_mock.go index 09df7f6a4a..3b368eacbe 100644 --- a/internal/test/mock/discoverer_client_mock.go +++ b/internal/test/mock/client/discoverer_client_mock.go @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -package mock +package client import ( "context" diff --git a/internal/test/mock/grpc_client_mock.go b/internal/test/mock/grpc/grpc_client_mock.go similarity index 99% rename from internal/test/mock/grpc_client_mock.go rename to internal/test/mock/grpc/grpc_client_mock.go index d8fa64cd36..926bbf8c61 100644 --- a/internal/test/mock/grpc_client_mock.go +++ b/internal/test/mock/grpc/grpc_client_mock.go @@ -11,7 +11,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -package mock +package grpc import ( "context" diff --git a/pkg/index/job/save/service/indexer_test.go b/pkg/index/job/save/service/indexer_test.go index 69e381ca31..d2341d43b4 100644 --- a/pkg/index/job/save/service/indexer_test.go +++ b/pkg/index/job/save/service/indexer_test.go @@ -24,7 +24,8 @@ import ( "github.com/vdaas/vald/internal/net/grpc/codes" "github.com/vdaas/vald/internal/net/grpc/status" "github.com/vdaas/vald/internal/test/goleak" - "github.com/vdaas/vald/internal/test/mock" + clientmock "github.com/vdaas/vald/internal/test/mock/client" + grpcmock "github.com/vdaas/vald/internal/test/mock/grpc" ) func Test_index_Start(t *testing.T) { @@ -67,12 +68,12 @@ func Test_index_Start(t *testing.T) { }, fields: fields{ - client: &mock.DiscovererClientMock{ + client: &clientmock.DiscovererClientMock{ GetAddrsFunc: func(_ context.Context) []string { return addrs }, GetClientFunc: func() grpc.Client { - return &mock.GRPCClientMock{ + return &grpcmock.GRPCClientMock{ OrderedRangeConcurrentFunc: func(_ context.Context, _ []string, _ int, _ func(_ context.Context, _ string, _ *grpc.ClientConn, _ ...grpc.CallOption) error, ) error { @@ -94,12 +95,12 @@ func Test_index_Start(t *testing.T) { ctx: context.Background(), }, fields: fields{ - client: &mock.DiscovererClientMock{ + client: &clientmock.DiscovererClientMock{ GetAddrsFunc: func(_ context.Context) []string { return addrs }, GetClientFunc: func() grpc.Client { - return &mock.GRPCClientMock{ + return &grpcmock.GRPCClientMock{ OrderedRangeConcurrentFunc: func(_ context.Context, _ []string, _ int, _ func(_ context.Context, _ string, _ *grpc.ClientConn, _ ...grpc.CallOption) error, ) error { @@ -129,12 +130,12 @@ func Test_index_Start(t *testing.T) { }, fields: fields{ - client: &mock.DiscovererClientMock{ + client: &clientmock.DiscovererClientMock{ GetAddrsFunc: func(_ context.Context) []string { return addrs }, GetClientFunc: func() grpc.Client { - return &mock.GRPCClientMock{ + return &grpcmock.GRPCClientMock{ OrderedRangeConcurrentFunc: func(_ context.Context, _ []string, _ int, _ func(_ context.Context, _ string, _ *grpc.ClientConn, _ ...grpc.CallOption) error, ) error { @@ -163,7 +164,7 @@ func Test_index_Start(t *testing.T) { ctx: context.Background(), }, fields: fields{ - client: &mock.DiscovererClientMock{ + client: &clientmock.DiscovererClientMock{ GetAddrsFunc: func(_ context.Context) []string { // NOTE: This function returns nil, meaning that the targetAddrs stored in the field are invalid values. return nil