Skip to content

Commit 6581f84

Browse files
committed
remove values from MatchSubjectMappingsRequest
1 parent f2b7beb commit 6581f84

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

service/integration/subject_mappings_test.go

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -819,12 +819,10 @@ func (s *SubjectMappingsSuite) TestUpdateSubjectConditionSet_NonExistentId_Fails
819819
func (s *SubjectMappingsSuite) TestGetMatchedSubjectMappings_InOne() {
820820
fixtureScs := s.f.GetSubjectConditionSetKey("subject_condition_set1")
821821
externalSelectorValue := fixtureScs.Condition.SubjectSets[0].ConditionGroups[0].Conditions[0].SubjectExternalSelectorValue
822-
externalValues := fixtureScs.Condition.SubjectSets[0].ConditionGroups[0].Conditions[0].SubjectExternalValues
823822

824823
props := []*policy.SubjectProperty{
825824
{
826825
ExternalSelectorValue: externalSelectorValue,
827-
ExternalValue: externalValues[0],
828826
},
829827
}
830828

@@ -837,12 +835,10 @@ func (s *SubjectMappingsSuite) TestGetMatchedSubjectMappings_InOne() {
837835
func (s *SubjectMappingsSuite) TestGetMatchedSubjectMappings_ReturnsNotInWhenMatches() {
838836
fixtureScs := s.f.GetSubjectConditionSetKey("subject_condition_simple_not_in")
839837
externalSelectorValue := fixtureScs.Condition.SubjectSets[0].ConditionGroups[0].Conditions[0].SubjectExternalSelectorValue
840-
externalValues := fixtureScs.Condition.SubjectSets[0].ConditionGroups[0].Conditions[0].SubjectExternalValues
841838

842839
props := []*policy.SubjectProperty{
843840
{
844841
ExternalSelectorValue: externalSelectorValue,
845-
ExternalValue: externalValues[0],
846842
},
847843
}
848844

@@ -861,7 +857,6 @@ func (s *SubjectMappingsSuite) TestGetMatchedSubjectMappings_NotInOneMatch() {
861857
props := []*policy.SubjectProperty{
862858
{
863859
ExternalSelectorValue: externalSelectorValue,
864-
ExternalValue: "random_value",
865860
},
866861
}
867862

@@ -875,9 +870,7 @@ func (s *SubjectMappingsSuite) TestGetMatchedSubjectMappings_NotInOneMatch() {
875870

876871
func (s *SubjectMappingsSuite) TestGetMatchedSubjectMappings_MissingFieldInProperty_Fails() {
877872
props := []*policy.SubjectProperty{
878-
{
879-
ExternalValue: "some_value",
880-
},
873+
{},
881874
}
882875

883876
sm, err := s.db.PolicyClient.GetMatchedSubjectMappings(context.Background(), props)
@@ -908,20 +901,16 @@ func (s *SubjectMappingsSuite) TestGetMatchedSubjectMappings_NoPropertiesProvide
908901
func (s *SubjectMappingsSuite) TestGetMatchedSubjectMappings_InMultiple() {
909902
simpleScs := s.f.GetSubjectConditionSetKey("subject_condition_simple_in")
910903
simpleexternalSelectorValue := simpleScs.Condition.SubjectSets[0].ConditionGroups[0].Conditions[0].SubjectExternalSelectorValue
911-
simpleExternalValues := simpleScs.Condition.SubjectSets[0].ConditionGroups[0].Conditions[0].SubjectExternalValues
912904

913905
otherScs := s.f.GetSubjectConditionSetKey("subject_condition_set1")
914906
otherexternalSelectorValue := otherScs.Condition.SubjectSets[0].ConditionGroups[0].Conditions[0].SubjectExternalSelectorValue
915-
otherExternalValues := otherScs.Condition.SubjectSets[0].ConditionGroups[0].Conditions[0].SubjectExternalValues
916907

917908
props := []*policy.SubjectProperty{
918909
{
919910
ExternalSelectorValue: simpleexternalSelectorValue,
920-
ExternalValue: simpleExternalValues[0],
921911
},
922912
{
923913
ExternalSelectorValue: otherexternalSelectorValue,
924-
ExternalValue: otherExternalValues[0],
925914
},
926915
}
927916

@@ -965,7 +954,6 @@ func (s *SubjectMappingsSuite) TestGetMatchedSubjectMappings_DeactivatedValueNot
965954
props := []*policy.SubjectProperty{
966955
{
967956
ExternalSelectorValue: fixtureScs.Condition.SubjectSets[0].ConditionGroups[0].Conditions[0].SubjectExternalSelectorValue,
968-
ExternalValue: fixtureScs.Condition.SubjectSets[0].ConditionGroups[0].Conditions[0].SubjectExternalValues[0],
969957
},
970958
}
971959
smList, err := s.db.PolicyClient.GetMatchedSubjectMappings(context.Background(), props)
@@ -992,11 +980,9 @@ func (s *SubjectMappingsSuite) TestGetMatchedSubjectMappings_NotInMultiple() {
992980
props := []*policy.SubjectProperty{
993981
{
994982
ExternalSelectorValue: externalSelectorValue,
995-
ExternalValue: "random_value_definitely_not_in_fixtures",
996983
},
997984
{
998985
ExternalSelectorValue: otherexternalSelectorValue1,
999-
ExternalValue: "random_value_definitely_not_in_fixtures",
1000986
},
1001987
}
1002988

@@ -1026,11 +1012,9 @@ func (s *SubjectMappingsSuite) TestGetMatchedSubjectMappings_InOneAndNotInASecon
10261012
props := []*policy.SubjectProperty{
10271013
{
10281014
ExternalSelectorValue: externalSelectorValue,
1029-
ExternalValue: externalValues[0],
10301015
},
10311016
{
10321017
ExternalSelectorValue: otherexternalSelectorValue,
1033-
ExternalValue: "random_value_987654321",
10341018
},
10351019
}
10361020

@@ -1050,7 +1034,6 @@ func (s *SubjectMappingsSuite) TestGetMatchedSubjectMappings_NonExistentField_Re
10501034
props := []*policy.SubjectProperty{
10511035
{
10521036
ExternalSelectorValue: ".non_existent_field[1]",
1053-
ExternalValue: "non_existent_value",
10541037
},
10551038
}
10561039
sm, err := s.db.PolicyClient.GetMatchedSubjectMappings(context.Background(), props)

0 commit comments

Comments
 (0)