Skip to content

Update collection_service_test.go #4906

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions go/pkg/sysdb/grpc/collection_service_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -761,6 +761,31 @@ func (suite *CollectionServiceTestSuite) TestFork() {
suite.Error(err)
}

func (suite *CollectionServiceTestSuite) TestCheckCollectionsResponsePopulation() {
// Simulate input data
request := &coordinatorpb.CheckCollectionsRequest{
// Add necessary fields based on your service's requirements
}

// Call the service method
response, err := suite.s.CheckCollections(context.Background(), request)

// Assert that no error occurred
suite.NoError(err)

// Assert that the Collections array in the response is not nil
suite.NotNil(response.Collections, "Collections array should not be nil.")

// Assert that the Collections array contains at least one item
suite.Greater(len(response.Collections), 0, "Collections array should not be empty.")

// Validate the individual items in the Collections array
for _, collection := range response.Collections {
suite.NotEmpty(collection.Id, "Collection ID should not be empty.")
suite.NotEmpty(collection.Name, "Collection Name should not be empty.")
}
}

func TestCollectionServiceTestSuite(t *testing.T) {
testSuite := new(CollectionServiceTestSuite)
suite.Run(t, testSuite)
Expand Down
Loading