Skip to content

Commit

Permalink
fix: fix schema test
Browse files Browse the repository at this point in the history
  • Loading branch information
elsapet committed Jan 31, 2023
1 parent 01ff8d6 commit aa91779
Showing 1 changed file with 20 additions and 26 deletions.
46 changes: 20 additions & 26 deletions pkg/classification/schema/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit aa91779

Please sign in to comment.