Merged in feature/testquery (pull request #39)
Test Query * depstextandclean * startedcleaningresult * resulttidyup * roundone * cleaning * unsyncedquery * startedtestsandsimplification * api * querytests * resultprocessortests * unittests * cleanup
This commit is contained in:
@@ -2,7 +2,7 @@ package queryservice
|
||||
|
||||
import (
|
||||
"queryorchestration/internal/query"
|
||||
queryprocessor "queryorchestration/internal/query/processor"
|
||||
resultprocessor "queryorchestration/internal/query/result/processor"
|
||||
"testing"
|
||||
|
||||
"github.com/google/uuid"
|
||||
@@ -15,7 +15,7 @@ func TestParseQueries(t *testing.T) {
|
||||
in := []*query.Query{
|
||||
{
|
||||
ID: uuid.New(),
|
||||
Type: queryprocessor.TypeContextFull,
|
||||
Type: resultprocessor.TypeContextFull,
|
||||
ActiveVersion: 1,
|
||||
LatestVersion: 2,
|
||||
RequiredQueryIDs: &[]uuid.UUID{
|
||||
@@ -45,7 +45,7 @@ func TestParseQuery(t *testing.T) {
|
||||
cfg := "hey"
|
||||
in := &query.Query{
|
||||
ID: uuid.New(),
|
||||
Type: queryprocessor.TypeContextFull,
|
||||
Type: resultprocessor.TypeContextFull,
|
||||
ActiveVersion: 1,
|
||||
LatestVersion: 2,
|
||||
RequiredQueryIDs: &[]uuid.UUID{
|
||||
@@ -71,7 +71,7 @@ func TestParseQuery(t *testing.T) {
|
||||
func TestParseQueryMinimal(t *testing.T) {
|
||||
in := &query.Query{
|
||||
ID: uuid.New(),
|
||||
Type: queryprocessor.TypeContextFull,
|
||||
Type: resultprocessor.TypeContextFull,
|
||||
ActiveVersion: 1,
|
||||
LatestVersion: 2,
|
||||
}
|
||||
@@ -87,26 +87,26 @@ func TestParseQueryMinimal(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestParseQueryType(t *testing.T) {
|
||||
qt, err := parseQueryType(queryprocessor.TypeContextFull)
|
||||
qt, err := parseQueryType(resultprocessor.TypeContextFull)
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, CONTEXTFULL, qt)
|
||||
|
||||
qt, err = parseQueryType(queryprocessor.TypeJsonExtractor)
|
||||
qt, err = parseQueryType(resultprocessor.TypeJsonExtractor)
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, JSONEXTRACTOR, qt)
|
||||
|
||||
_, err = parseQueryType(queryprocessor.Type(-1))
|
||||
_, err = parseQueryType(resultprocessor.Type(-1))
|
||||
assert.NotNil(t, err)
|
||||
}
|
||||
|
||||
func TestParseSpecQueryType(t *testing.T) {
|
||||
qt, err := parseSpecQueryType(CONTEXTFULL)
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, queryprocessor.Type(queryprocessor.TypeContextFull), qt)
|
||||
assert.Equal(t, resultprocessor.Type(resultprocessor.TypeContextFull), qt)
|
||||
|
||||
qt, err = parseSpecQueryType(JSONEXTRACTOR)
|
||||
assert.Nil(t, err)
|
||||
assert.Equal(t, queryprocessor.Type(queryprocessor.TypeJsonExtractor), qt)
|
||||
assert.Equal(t, resultprocessor.Type(resultprocessor.TypeJsonExtractor), qt)
|
||||
|
||||
_, err = parseSpecQueryType("invalid")
|
||||
assert.NotNil(t, err)
|
||||
|
||||
Reference in New Issue
Block a user