@@ -47,24 +47,18 @@ void assertNoMissingFields(M message, Class<E> fields) {
4747 }
4848
4949 public static void assertNoMissingFields (Object message ) {
50- List <String > nullFields = getMissingFields (message .toString ());
50+ Set <String > nullFields = getMissingFields (message .toString ());
5151
52- Assert .assertArrayEquals (
53- "All fields expected to be set in the text" ,
54- new String [0 ],
55- nullFields .toArray (new String [0 ]));
52+ Assert .assertEquals ("All fields expected to be set in the text" , new HashSet <>(), nullFields );
5653 }
5754
5855 public static void assertMissingFields (Object message , Set <String > values ) {
59- List <String > nullFields = getMissingFields (message .toString ());
60- Assert .assertArrayEquals (
61- "Expected missing fields but get different" ,
62- values .toArray (new String [0 ]),
63- nullFields .toArray (new String [0 ]));
56+ Set <String > nullFields = getMissingFields (message .toString ());
57+ Assert .assertEquals ("Expected missing fields but get different" , values , nullFields );
6458 }
6559
66- private static List <String > getMissingFields (String text ) {
67- List <String > nullFields = new ArrayList <>();
60+ private static Set <String > getMissingFields (String text ) {
61+ Set <String > nullFields = new HashSet <>();
6862 // Regex to find fieldName=null
6963 Pattern pattern = Pattern .compile ("(\\ w+)=null" );
7064 Matcher matcher = pattern .matcher (text );
0 commit comments