Skip to content
Snippets Groups Projects
Commit 06ff65cd authored by thijsheijden's avatar thijsheijden
Browse files

Updated mock query converter

parent 9ee791a5
No related branches found
No related tags found
No related merge requests found
package aql package aql
import "errors" import (
"errors"
"git.science.uu.nl/datastrophe/query-conversion/entity"
)
// A MockService implements the query convert usecase interface (mock) // A MockService implements the query convert usecase interface (mock)
type MockService struct { type MockService struct {
...@@ -15,14 +19,13 @@ func NewMockService() *MockService { ...@@ -15,14 +19,13 @@ func NewMockService() *MockService {
} }
// ConvertQuery returns a hard coded string message (mock) // ConvertQuery returns a hard coded string message (mock)
func (s *MockService) ConvertQuery(jsonMsg *[]byte) (*string, *string, error) { func (s *MockService) ConvertQuery(JSONQuery *entity.IncomingQueryJSON) (*string, error) {
mockQuery := "Query converted" mockQuery := "Query converted"
mockDatabaseName := "test-database"
if !s.throwError { if !s.throwError {
return &mockQuery, &mockDatabaseName, nil return &mockQuery, nil
} }
return nil, &mockDatabaseName, errors.New("Failed to convert query") return nil, 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