@@ -45,7 +45,7 @@ void matchesTrivialCases() {
45
45
void matchesAdditiveOnlyChanges () {
46
46
actual .getSpec ().getTemplate ().getMetadata ().getLabels ().put ("new-key" , "val" );
47
47
assertThat (matcher .match (actual , null , context ).matched ())
48
- .withFailMessage ("Additive changes should be ok " )
48
+ .withFailMessage ("Additive changes should be not cause a mismatch by default " )
49
49
.isTrue ();
50
50
}
51
51
@@ -54,44 +54,44 @@ void matchesWithStrongSpecEquality() {
54
54
actual .getSpec ().getTemplate ().getMetadata ().getLabels ().put ("new-key" , "val" );
55
55
assertThat (GenericKubernetesResourceMatcher
56
56
.match (dependentResource , actual , null , context , true , true ).matched ())
57
- .withFailMessage ("Strong equality does not ignore additive changes on spec " )
57
+ .withFailMessage ("Adding values should fail matching when strong equality is required " )
58
58
.isFalse ();
59
59
}
60
60
61
61
@ Test
62
- void notMatchesRemovedValues () {
62
+ void doesNotMatchRemovedValues () {
63
63
actual = createDeployment ();
64
64
assertThat (matcher .match (actual , createPrimary ("removed" ), context ).matched ())
65
- .withFailMessage ("Removed value should not be ok " )
65
+ .withFailMessage ("Removing values in metadata should lead to a mismatch " )
66
66
.isFalse ();
67
67
}
68
68
69
69
@ Test
70
- void notMatchesChangedValues () {
70
+ void doesNotMatchChangedValues () {
71
71
actual = createDeployment ();
72
72
actual .getSpec ().setReplicas (2 );
73
73
assertThat (matcher .match (actual , null , context ).matched ())
74
- .withFailMessage ("Changed values are not ok " )
74
+ .withFailMessage ("Should not have matched because values have changed " )
75
75
.isFalse ();
76
76
}
77
77
78
78
@ Test
79
- void notMatchesIgnoredPaths () {
79
+ void doesNotMatchIgnoredPaths () {
80
80
actual = createDeployment ();
81
81
actual .getSpec ().setReplicas (2 );
82
82
assertThat (GenericKubernetesResourceMatcher
83
83
.match (dependentResource , actual , null , context , false , "/spec/replicas" ).matched ())
84
- .withFailMessage ("Ignored paths are not matched " )
84
+ .withFailMessage ("Should not have compared ignored paths " )
85
85
.isTrue ();
86
86
}
87
87
88
88
@ Test
89
89
void ignoresWholeSubPath () {
90
90
actual = createDeployment ();
91
- actual .getSpec ().getTemplate ().getMetadata ().getLabels ().put ("additionak -key" , "val" );
91
+ actual .getSpec ().getTemplate ().getMetadata ().getLabels ().put ("additional -key" , "val" );
92
92
assertThat (GenericKubernetesResourceMatcher
93
93
.match (dependentResource , actual , null , context , false , "/spec/template" ).matched ())
94
- .withFailMessage ("Ignored sub-paths are not matched " )
94
+ .withFailMessage ("Should match when only changes impact ignored sub-paths " )
95
95
.isTrue ();
96
96
}
97
97
@@ -114,7 +114,7 @@ void matchesMetadata() {
114
114
115
115
assertThat (GenericKubernetesResourceMatcher
116
116
.match (dependentResource , actual , null , context , true , false ).matched ())
117
- .withFailMessage ("Non strong equality on labels and annotations " )
117
+ .withFailMessage ("Should match when strong equality is not considered and only additive changes are made " )
118
118
.isTrue ();
119
119
120
120
}
0 commit comments