3131 * {@link Changes} assertions example.
3232 *
3333 * @author Régis Pouiller
34+ * @author Julien Roy
3435 */
3536public class ChangesAssertionExamples extends AbstractAssertionsExamples {
3637
@@ -39,7 +40,7 @@ public class ChangesAssertionExamples extends AbstractAssertionsExamples {
3940 */
4041 @ Test
4142 public void basic_changes_assertion_examples () throws SQLException {
42- Changes changes = new Changes ( dataSource );
43+ Changes changes = assertConnection . changes (). build ( );
4344 changes .setStartPointNow ();
4445 makeChangesInTheData ();
4546 changes .setEndPointNow ();
@@ -58,7 +59,7 @@ public void basic_changes_assertion_examples() throws SQLException {
5859 */
5960 @ Test
6061 public void basic_change_assertion_examples () throws SQLException {
61- Changes changes = new Changes ( dataSource );
62+ Changes changes = assertConnection . changes (). build ( );
6263 changes .setStartPointNow ();
6364 makeChangesInTheData ();
6465 changes .setEndPointNow ();
@@ -92,7 +93,7 @@ public void basic_change_assertion_examples() throws SQLException {
9293 */
9394 @ Test
9495 public void basic_row_assertion_examples () throws SQLException , ParseException {
95- Changes changes = new Changes ( dataSource );
96+ Changes changes = assertConnection . changes (). build ( );
9697 changes .setStartPointNow ();
9798 makeChangesInTheData ();
9899 changes .setEndPointNow ();
@@ -128,7 +129,7 @@ public void basic_row_assertion_examples() throws SQLException, ParseException {
128129 */
129130 @ Test
130131 public void basic_column_assertion_examples () throws SQLException {
131- Changes changes = new Changes ( dataSource );
132+ Changes changes = assertConnection . changes (). build ( );
132133 changes .setStartPointNow ();
133134 makeChangesInTheData ();
134135 changes .setEndPointNow ();
@@ -166,7 +167,7 @@ public void basic_column_assertion_examples() throws SQLException {
166167 */
167168 @ Test
168169 public void basic_value_assertion_examples () throws SQLException , ParseException {
169- Changes changes = new Changes ( dataSource );
170+ Changes changes = assertConnection . changes (). build ( );
170171 changes .setStartPointNow ();
171172 makeChangesInTheData ();
172173 changes .setEndPointNow ();
@@ -193,8 +194,7 @@ public void basic_value_assertion_examples() throws SQLException, ParseException
193194 */
194195 @ Test
195196 public void changes_about_table_assertion_examples () throws SQLException {
196- Table table = new Table (dataSource , "members" );
197- Changes changes = new Changes (table );
197+ Changes changes = assertConnection .changes ().table ("members" ).build ();
198198 changes .setStartPointNow ();
199199 makeChangesInTheData ();
200200 changes .setEndPointNow ();
@@ -211,8 +211,7 @@ public void changes_about_table_assertion_examples() throws SQLException {
211211 */
212212 @ Test
213213 public void changes_about_request_assertion_examples () throws SQLException {
214- Request request = new Request (dataSource , "select title from albums" );
215- Changes changes = new Changes (request );
214+ Changes changes = assertConnection .changes ().request ("select title from albums" ).build ();
216215 changes .setStartPointNow ();
217216 makeChangesInTheData ();
218217 changes .setEndPointNow ();
@@ -227,7 +226,7 @@ public void changes_about_request_assertion_examples() throws SQLException {
227226 */
228227 @ Test
229228 public void changetype_assertion_examples () throws SQLException {
230- Changes changes = new Changes ( dataSource );
229+ Changes changes = assertConnection . changes (). build ( );
231230 changes .setStartPointNow ();
232231 makeChangesInTheData ();
233232 changes .setEndPointNow ();
@@ -243,7 +242,7 @@ public void changetype_assertion_examples() throws SQLException {
243242 */
244243 @ Test
245244 public void datatype_isontable_assertion_examples () throws SQLException {
246- Changes changes = new Changes ( dataSource );
245+ Changes changes = assertConnection . changes (). build ( );
247246 changes .setStartPointNow ();
248247 makeChangesInTheData ();
249248 changes .setEndPointNow ();
@@ -258,9 +257,8 @@ public void datatype_isontable_assertion_examples() throws SQLException {
258257 * This example shows a simple case of test on data type for change on a request.
259258 */
260259 @ Test
261- public void datatype_isonrequest_assertion_examples () throws SQLException {
262- Request request = new Request (dataSource , "select title from albums" );
263- Changes changes = new Changes (request );
260+ public void datatype_is_on_request_assertion_examples () throws SQLException {
261+ Changes changes = assertConnection .changes ().request ("select title from albums" ).build ();
264262 changes .setStartPointNow ();
265263 makeChangesInTheData ();
266264 changes .setEndPointNow ();
@@ -274,7 +272,7 @@ public void datatype_isonrequest_assertion_examples() throws SQLException {
274272 */
275273 @ Test
276274 public void column_equality_assertion_examples () throws SQLException {
277- Changes changes = new Changes ( dataSource );
275+ Changes changes = assertConnection . changes (). build ( );
278276 changes .setStartPointNow ();
279277 makeChangesInTheData ();
280278 changes .setEndPointNow ();
@@ -304,8 +302,8 @@ public void column_equality_assertion_examples() throws SQLException {
304302 */
305303 @ Test
306304 public void changes_number_assertion_examples () throws SQLException {
307- Changes changesDataSource = new Changes ( dataSource ).setStartPointNow ();
308- Changes changesRequest = new Changes ( new Request ( dataSource , "select title from albums" ));
305+ Changes changesDataSource = assertConnection . changes (). build ( ).setStartPointNow ();
306+ Changes changesRequest = assertConnection . changes (). request ( "select title from albums" ). build ( );
309307 changesRequest .setStartPointNow ();
310308 makeChangesInTheData ();
311309 changesDataSource .setEndPointNow ();
@@ -320,7 +318,7 @@ public void changes_number_assertion_examples() throws SQLException {
320318 */
321319 @ Test
322320 public void columns_number_assertion_examples () throws SQLException {
323- Changes changes = new Changes ( dataSource ).setStartPointNow ();
321+ Changes changes = assertConnection . changes (). build ( ).setStartPointNow ();
324322 makeChangesInTheData ();
325323 changes .setEndPointNow ();
326324
@@ -339,7 +337,7 @@ public void columns_number_assertion_examples() throws SQLException {
339337 */
340338 @ Test
341339 public void primary_keys_assertion_examples () throws SQLException {
342- Changes changes = new Changes ( dataSource ).setStartPointNow ();
340+ Changes changes = assertConnection . changes (). build ( ).setStartPointNow ();
343341 makeChangesInTheData ();
344342 changes .setEndPointNow ();
345343
@@ -354,7 +352,7 @@ public void primary_keys_assertion_examples() throws SQLException {
354352 */
355353 @ Test
356354 public void modified_columns_assertion_examples () throws SQLException {
357- Changes changes = new Changes ( dataSource ).setStartPointNow ();
355+ Changes changes = assertConnection . changes (). build ( ).setStartPointNow ();
358356 makeChangesInTheData ();
359357 changes .setEndPointNow ();
360358
@@ -378,7 +376,7 @@ public void modified_columns_assertion_examples() throws SQLException {
378376 */
379377 @ Test
380378 public void column_type_assertion_examples () throws SQLException {
381- Changes changes = new Changes ( dataSource );
379+ Changes changes = assertConnection . changes (). build ( );
382380 changes .setStartPointNow ();
383381 makeChangesInTheData ();
384382 changes .setEndPointNow ();
@@ -408,7 +406,7 @@ public void column_type_assertion_examples() throws SQLException {
408406 */
409407 @ Test
410408 public void modified_column_assertion_examples () throws SQLException {
411- Changes changes = new Changes ( dataSource );
409+ Changes changes = assertConnection . changes (). build ( );
412410 changes .setStartPointNow ();
413411 makeChangesInTheData ();
414412 changes .setEndPointNow ();
@@ -442,7 +440,7 @@ public void modified_column_assertion_examples() throws SQLException {
442440 */
443441 @ Test
444442 public void column_name_assertion_examples () throws SQLException {
445- Changes changes = new Changes ( dataSource );
443+ Changes changes = assertConnection . changes (). build ( );
446444 changes .setStartPointNow ();
447445 makeChangesInTheData ();
448446 changes .setEndPointNow ();
@@ -483,7 +481,7 @@ public void column_name_assertion_examples() throws SQLException {
483481 */
484482 @ Test
485483 public void row_existence_assertion_examples () throws SQLException {
486- Changes changes = new Changes ( dataSource ).setStartPointNow ();
484+ Changes changes = assertConnection . changes (). build ( ).setStartPointNow ();
487485 makeChangesInTheData ();
488486 changes .setEndPointNow ();
489487
@@ -504,7 +502,7 @@ public void row_existence_assertion_examples() throws SQLException {
504502 */
505503 @ Test
506504 public void row_equality_assertion_examples () throws SQLException {
507- Changes changes = new Changes ( dataSource ).setStartPointNow ();
505+ Changes changes = assertConnection . changes (). build ( ).setStartPointNow ();
508506 makeChangesInTheData ();
509507 changes .setEndPointNow ();
510508
@@ -523,7 +521,7 @@ public void row_equality_assertion_examples() throws SQLException {
523521 */
524522 @ Test
525523 public void value_equality_assertion_examples () throws SQLException {
526- Changes changes = new Changes ( dataSource ).setStartPointNow ();
524+ Changes changes = assertConnection . changes (). build ( ).setStartPointNow ();
527525 makeChangesInTheData ();
528526 changes .setEndPointNow ();
529527
@@ -601,7 +599,7 @@ public void value_equality_assertion_examples() throws SQLException {
601599 */
602600 @ Test
603601 public void value_non_equality_assertion_examples () throws SQLException {
604- Changes changes = new Changes ( dataSource ).setStartPointNow ();
602+ Changes changes = assertConnection . changes (). build ( ).setStartPointNow ();
605603 makeChangesInTheData ();
606604 changes .setEndPointNow ();
607605
@@ -679,7 +677,7 @@ public void value_non_equality_assertion_examples() throws SQLException {
679677 */
680678 @ Test
681679 public void value_type_assertion_examples () throws SQLException {
682- Changes changes = new Changes ( dataSource ).setStartPointNow ();
680+ Changes changes = assertConnection . changes (). build ( ).setStartPointNow ();
683681 makeChangesInTheData ();
684682 changes .setEndPointNow ();
685683
@@ -757,7 +755,7 @@ public void value_type_assertion_examples() throws SQLException {
757755 */
758756 @ Test
759757 public void value_nullity_assertion_examples () throws SQLException {
760- Changes changes = new Changes ( dataSource ).setStartPointNow ();
758+ Changes changes = assertConnection . changes (). build ( ).setStartPointNow ();
761759 makeChangesInTheData ();
762760 changes .setEndPointNow ();
763761
@@ -842,7 +840,7 @@ public void value_nullity_assertion_examples() throws SQLException {
842840 */
843841 @ Test
844842 public void value_comparison_assertion_examples () throws SQLException {
845- Changes changes = new Changes ( dataSource ).setStartPointNow ();
843+ Changes changes = assertConnection . changes (). build ( ).setStartPointNow ();
846844 makeChangesInTheData ();
847845 changes .setEndPointNow ();
848846
@@ -936,7 +934,7 @@ public void value_comparison_assertion_examples() throws SQLException {
936934 */
937935 @ Test
938936 public void value_chronology_assertion_examples () throws SQLException {
939- Changes changes = new Changes ( dataSource ).setStartPointNow ();
937+ Changes changes = assertConnection . changes (). build ( ).setStartPointNow ();
940938 makeChangesInTheData ();
941939 changes .setEndPointNow ();
942940
0 commit comments