From aa9177933f954c5057c252d42623fafc14d55a14 Mon Sep 17 00:00:00 2001 From: elsapet Date: Mon, 30 Jan 2023 17:58:24 +0200 Subject: [PATCH] fix: fix schema test --- pkg/classification/schema/schema_test.go | 46 +++++++++++------------- 1 file changed, 20 insertions(+), 26 deletions(-) diff --git a/pkg/classification/schema/schema_test.go b/pkg/classification/schema/schema_test.go index 652b43f3a..237f916be 100644 --- a/pkg/classification/schema/schema_test.go +++ b/pkg/classification/schema/schema_test.go @@ -12,12 +12,6 @@ import ( ) func TestSchemaObjectClassification(t *testing.T) { - knownObjectDataType := db.DataType{ - Name: "Unique Identifier", - CategoryUUID: "14124881-6b92-4fc5-8005-ea7c1c09592e", - UUID: "12d44ae0-1df7-4faf-9fb1-b46cc4b4dce9", - } - defaultSubjectName := "User" tests := []struct { Name string Input schema.ClassificationRequest @@ -97,8 +91,8 @@ func TestSchemaObjectClassification(t *testing.T) { }, Want: schema.Classification{ Name: "user", - DataType: &knownObjectDataType, - SubjectName: &defaultSubjectName, + DataType: nil, + SubjectName: nil, Decision: classify.ClassificationDecision{ State: classify.Invalid, Reason: "valid_object_with_invalid_properties", @@ -127,8 +121,8 @@ func TestSchemaObjectClassification(t *testing.T) { }, Want: schema.Classification{ Name: "user", - DataType: &knownObjectDataType, - SubjectName: &defaultSubjectName, + DataType: nil, + SubjectName: nil, Decision: classify.ClassificationDecision{ State: classify.Valid, Reason: "valid_object_with_valid_properties", @@ -161,8 +155,8 @@ func TestSchemaObjectClassification(t *testing.T) { }, Want: schema.Classification{ Name: "seller fiscal information", - DataType: &knownObjectDataType, - SubjectName: &defaultSubjectName, + DataType: nil, + SubjectName: nil, Decision: classify.ClassificationDecision{ State: classify.Valid, Reason: "valid_object_with_valid_properties", @@ -199,8 +193,8 @@ func TestSchemaObjectClassification(t *testing.T) { }, Want: schema.Classification{ Name: "seller fiscal information", - DataType: &knownObjectDataType, - SubjectName: &defaultSubjectName, + DataType: nil, + SubjectName: nil, Decision: classify.ClassificationDecision{ State: classify.Invalid, Reason: "valid_object_with_invalid_properties", @@ -225,8 +219,8 @@ func TestSchemaObjectClassification(t *testing.T) { }, Want: schema.Classification{ Name: "applicant", - DataType: &knownObjectDataType, - SubjectName: &defaultSubjectName, + DataType: nil, + SubjectName: nil, Decision: classify.ClassificationDecision{ State: classify.Valid, Reason: "valid_object_with_valid_properties", @@ -251,8 +245,8 @@ func TestSchemaObjectClassification(t *testing.T) { }, Want: schema.Classification{ Name: "bank accounts", - SubjectName: &defaultSubjectName, - DataType: &knownObjectDataType, + DataType: nil, + SubjectName: nil, Decision: classify.ClassificationDecision{ State: classify.Valid, Reason: "valid_object_with_valid_properties", @@ -277,8 +271,8 @@ func TestSchemaObjectClassification(t *testing.T) { }, Want: schema.Classification{ Name: "bank accounts", - SubjectName: &defaultSubjectName, - DataType: &knownObjectDataType, + SubjectName: nil, + DataType: nil, Decision: classify.ClassificationDecision{ State: classify.Invalid, Reason: "valid_object_with_invalid_properties", @@ -303,8 +297,8 @@ func TestSchemaObjectClassification(t *testing.T) { }, Want: schema.Classification{ Name: "patients", - SubjectName: &defaultSubjectName, - DataType: &knownObjectDataType, + SubjectName: nil, + DataType: nil, Decision: classify.ClassificationDecision{ State: classify.Invalid, Reason: "valid_object_with_invalid_properties", @@ -329,7 +323,7 @@ func TestSchemaObjectClassification(t *testing.T) { }, Want: schema.Classification{ Name: "accounts", - DataType: &knownObjectDataType, + DataType: nil, Decision: classify.ClassificationDecision{ State: classify.Valid, Reason: "valid_object_with_valid_properties", @@ -354,7 +348,7 @@ func TestSchemaObjectClassification(t *testing.T) { }, Want: schema.Classification{ Name: "accounts", - DataType: &knownObjectDataType, + DataType: nil, Decision: classify.ClassificationDecision{ State: classify.Invalid, Reason: "valid_object_with_invalid_properties", @@ -379,7 +373,7 @@ func TestSchemaObjectClassification(t *testing.T) { }, Want: schema.Classification{ Name: "accounts", - DataType: &knownObjectDataType, + DataType: nil, Decision: classify.ClassificationDecision{ State: classify.Invalid, Reason: "valid_object_with_invalid_properties", @@ -404,7 +398,7 @@ func TestSchemaObjectClassification(t *testing.T) { }, Want: schema.Classification{ Name: "accounts", - DataType: &knownObjectDataType, + DataType: nil, Decision: classify.ClassificationDecision{ State: classify.Potential, Reason: "valid_object_with_invalid_properties",