Skip to content
Snippets Groups Projects
Commit 34b9efcf authored by thijsheijden's avatar thijsheijden
Browse files

Fixed unit test nil pointer error in mockconvertquery

parent 72b14376
No related branches found
No related tags found
No related merge requests found
...@@ -17,11 +17,12 @@ func NewService() *Service { ...@@ -17,11 +17,12 @@ func NewService() *Service {
// ConvertQuery returns a hard coded string message (mock) // ConvertQuery returns a hard coded string message (mock)
func (s *Service) ConvertQuery(jsonMsg *[]byte) (*string, *string, error) { func (s *Service) ConvertQuery(jsonMsg *[]byte) (*string, *string, error) {
mockQuery := "Query converted" mockQuery := "Query converted"
mockDatabaseName := "test-database"
if !s.throwError { if !s.throwError {
return &mockQuery, nil, nil return &mockQuery, &mockDatabaseName, nil
} }
return nil, nil, errors.New("Failed to convert query") return nil, &mockDatabaseName, errors.New("Failed to convert query")
} }
// ToggleError decides whether the convert function throws an error // ToggleError decides whether the convert function throws an error
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment