2222import java .util .Calendar ;
2323import java .util .Date ;
2424
25- import org .junit .Before ;
26- import org .junit .Test ;
25+ import org .junit .jupiter . api . BeforeEach ;
26+ import org .junit .jupiter . api . Test ;
2727
28- import static org .junit .Assert .assertEquals ;
29- import static org .junit .Assert .assertFalse ;
30- import static org .junit .Assert .assertNotEquals ;
31- import static org .junit .Assert .assertNotNull ;
32- import static org .junit .Assert .assertTrue ;
28+ import static org .junit .jupiter . api . Assertions .assertEquals ;
29+ import static org .junit .jupiter . api . Assertions .assertFalse ;
30+ import static org .junit .jupiter . api . Assertions .assertNotEquals ;
31+ import static org .junit .jupiter . api . Assertions .assertNotNull ;
32+ import static org .junit .jupiter . api . Assertions .assertTrue ;
3333
3434/**
3535 * Tests for the {@link ChangeSet}class
3636 *
3737 * @author dion
3838 *
3939 */
40- public class ChangeSetTest {
40+ class ChangeSetTest {
4141 /**
4242 * the {@link ChangeSet} used for testing
4343 */
@@ -46,8 +46,8 @@ public class ChangeSetTest {
4646 /**
4747 * Initialize per test data
4848 */
49- @ Before
50- public void setUp () {
49+ @ BeforeEach
50+ void setUp () {
5151 instance = createInstance ();
5252 }
5353
@@ -64,10 +64,10 @@ private static ChangeSet createInstance() {
6464 * Test of addFile methods: using ChangeFile
6565 */
6666 @ Test
67- public void testAddFileWithFile () {
67+ void testAddFileWithFile () {
6868 ChangeFile file = new ChangeFile ("maven:dummy" );
6969 instance .addFile (file );
70- assertTrue ("File name not found in list" , instance .toString ().indexOf ("maven:dummy" ) != -1 );
70+ assertTrue (instance .toString ().indexOf ("maven:dummy" ) != -1 , "File name not found in list" );
7171
7272 assertTrue (instance .containsFilename ("maven:" ));
7373 assertTrue (instance .containsFilename (":dummy" ));
@@ -80,93 +80,93 @@ public void testAddFileWithFile() {
8080 * Test of toString method
8181 */
8282 @ Test
83- public void testToString () {
83+ void testToString () {
8484 // dion, Mon Apr 01 00:00:00 EST 2002, comment
8585 String value = instance .toString ();
86- assertTrue ("author not found in string" , value .indexOf ("dion" ) != -1 );
87- assertTrue ("comment not found in string" , value .indexOf ("comment" ) != -1 );
88- assertTrue ("date not found in string" , value .indexOf ("Mon Apr 01" ) != -1 );
86+ assertTrue (value .indexOf ("dion" ) != -1 , "author not found in string" );
87+ assertTrue (value .indexOf ("comment" ) != -1 , "comment not found in string" );
88+ assertTrue (value .indexOf ("Mon Apr 01" ) != -1 , "date not found in string" );
8989 }
9090
9191 /**
9292 * Test of getAuthor method
9393 */
9494 @ Test
95- public void testGetAuthor () {
96- assertEquals ("Author value not retrieved correctly" , "dion" , instance . getAuthor () );
95+ void testGetAuthor () {
96+ assertEquals ("dion" , instance . getAuthor (), " Author value not retrieved correctly" );
9797 }
9898
9999 /**
100100 * Test of setAuthor method
101101 */
102102 @ Test
103- public void testSetAuthor () {
103+ void testSetAuthor () {
104104 instance .setAuthor ("maven:dion" );
105- assertEquals ("Author not set correctly" , " maven:dion" , instance .getAuthor ());
105+ assertEquals ("maven:dion" , instance .getAuthor (), "Author not set correctly" );
106106 }
107107
108108 /**
109109 * Test of getComment method
110110 */
111111 @ Test
112- public void testGetComment () {
113- assertEquals ("Comment value not retrieved correctly" , "comment" , instance . getComment () );
112+ void testGetComment () {
113+ assertEquals ("comment" , instance . getComment (), " Comment value not retrieved correctly" );
114114 }
115115
116116 /**
117117 * Test of setComment method
118118 */
119119 @ Test
120- public void testSetComment () {
120+ void testSetComment () {
121121 instance .setComment ("maven:comment" );
122- assertEquals ("Comment not set correctly" , " maven:comment" , instance .getComment ());
122+ assertEquals ("maven:comment" , instance .getComment (), "Comment not set correctly" );
123123 }
124124
125125 /**
126126 * Test of getDate method
127127 */
128128 @ Test
129- public void testGetDate () {
130- assertEquals ("Date value not retrieved correctly" , getDate (2002 , 3 , 1 ), instance .getDate ());
129+ void testGetDate () {
130+ assertEquals (getDate (2002 , 3 , 1 ), instance .getDate (), "Date value not retrieved correctly" );
131131 }
132132
133133 /**
134134 * Test of setDate method with Date object
135135 */
136136 @ Test
137- public void testSetDate () {
137+ void testSetDate () {
138138 Calendar cal = Calendar .getInstance ();
139139 Date date = cal .getTime ();
140140 instance .setDate (date );
141- assertEquals ("Date value not set correctly" , date , instance . getDate () );
141+ assertEquals (date , instance . getDate (), "Date value not set correctly" );
142142 }
143143
144144 /**
145145 * Test of setDate method with String
146146 */
147147 @ Test
148- public void testSetDateFromString () {
148+ void testSetDateFromString () {
149149 instance .setDate ("2002/03/04 00:00:00" );
150- assertEquals ("Date value not set correctly from a string" , getDate (2002 , 2 , 4 ), instance .getDate ());
150+ assertEquals (getDate (2002 , 2 , 4 ), instance .getDate (), "Date value not set correctly from a string" );
151151 }
152152
153153 /**
154154 * Test of getDateFormatted method
155155 */
156156 @ Test
157- public void testGetDateFormatted () {
158- assertEquals ("Date not formatted correctly" , " 2002-04-01" , instance .getDateFormatted ());
157+ void testGetDateFormatted () {
158+ assertEquals ("2002-04-01" , instance .getDateFormatted (), "Date not formatted correctly" );
159159 }
160160
161161 /**
162162 * Test of getDateFormatted method
163163 */
164164 @ Test
165- public void testGetTimeFormatted () {
166- assertEquals ("Time not formatted correctly" , " 00:00:00" , instance .getTimeFormatted ());
165+ void testGetTimeFormatted () {
166+ assertEquals ("00:00:00" , instance .getTimeFormatted (), "Time not formatted correctly" );
167167 }
168168
169- public static Date getDate (int year , int month , int day ) {
169+ static Date getDate (int year , int month , int day ) {
170170 Calendar cal = Calendar .getInstance ();
171171
172172 cal .set (year , month , day , 0 , 0 , 0 );
@@ -176,7 +176,7 @@ public static Date getDate(int year, int month, int day) {
176176 }
177177
178178 @ Test
179- public void testEscapeValue () {
179+ void testEscapeValue () {
180180 assertEquals ("" , ChangeSet .escapeValue ("" ));
181181 assertEquals ("'" , ChangeSet .escapeValue ("'" ));
182182 assertEquals ("a" , ChangeSet .escapeValue ("a" ));
@@ -188,7 +188,7 @@ public void testEscapeValue() {
188188 }
189189
190190 @ Test
191- public void testEquals () {
191+ void testEquals () {
192192 ChangeSet instance2 = createInstance ();
193193 assertEquals (instance , instance2 );
194194
@@ -200,7 +200,7 @@ public void testEquals() {
200200 }
201201
202202 @ Test
203- public void testHashCode () {
203+ void testHashCode () {
204204 int hashCode1 = instance .hashCode ();
205205 instance .setAuthor ("anotherAuthor" );
206206
@@ -210,7 +210,7 @@ public void testHashCode() {
210210 }
211211
212212 @ Test
213- public void testToXml () {
213+ void testToXml () {
214214 String sXml = instance .toXML ();
215215 assertNotNull (sXml );
216216
@@ -219,7 +219,7 @@ public void testToXml() {
219219 }
220220
221221 @ Test
222- public void testToXmlWithFiles () {
222+ void testToXmlWithFiles () {
223223 instance .addFile (new ChangeFile ("maven1:dummy" ));
224224 instance .addFile (new ChangeFile ("maven2:dummy2" ));
225225
0 commit comments