-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathassertj-db-features-highlight.html
1217 lines (1170 loc) · 82.4 KB
/
assertj-db-features-highlight.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="AssertJ site">
<meta name="author" content="Joel Costigliola">
<title>AssertJ / Fluent assertions for java</title>
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="http://fonts.googleapis.com/css?family=Inconsolata|Source+Code+Pro|Open+Sans|Ubuntu|Varela+Round|Karla">
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="font-awesome/css/font-awesome.min.css" rel="stylesheet">
<script src="highlight/highlight.pack.js"></script>
<link rel="stylesheet" href="highlight/styles/railscasts.css">
<script>hljs.initHighlightingOnLoad();</script>
<link href="css/assertj.min.css" rel="stylesheet">
<link rel="shortcut icon" href="favicon.png" />
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<!-- You'll want to use a responsive image option so this logo looks good on devices - I recommend using something like retina.js (do a quick Google search for it and you'll find it) -->
<a class="navbar-brand" href="index.html">AssertJ</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav navbar-right">
<li><a href="assertj-core-quick-start.html">Quick start</a></li>
<li><a href="assertj-news.html">News</a></li>
<li><a href="assertj-core.html">Core</a></li>
<li><a href="assertj-assertions-generator.html">Assertions generator</a></li>
<li><a href="assertj-guava.html">Guava</a></li>
<li><a href="assertj-joda-time.html">Joda-Time</a></li>
<li><a href="assertj-db.html">DB</a></li>
<li><a href="assertj-neo4j.html">Neo4j</a></li>
<li><a href="assertj-swing.html">Swing</a></li>
<li><a href="assertj-help.html">Help</a></li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">
<div class="col-md-2 assertj-sidebar-menu">
<div class="bs-sidebar hidden-print affix-top" role="complementary">
<ul class="bs-sidenav nav ">
<li class="sidenav-header"></li>
<li><a href="assertj-db.html">Overview</a></li>
<li><a href="assertj-db.html#quickstart">Quick start</a></li>
<li><a href="assertj-db-news.html">News & releases</a></li>
<li><a href="assertj-db-concepts.html">Concepts</a></li>
<li><a href="assertj-db-features-highlight.html">Features highlight</a></li>
<li><a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/index.html" target="_blank">Javadoc</a></li>
<li><a href="assertj-db.html#mailing-list">Mailing list</a></li>
<li><a href="assertj-db.html#code">Code & issues <i class="fa fa-github"></i></a></li>
<li><a href="assertj-db.html#contributing">Contributing</a></li>
</ul>
</div>
</div>
<div class="col-lg-10 col-md-10 col-sm-10 text-left" >
<h1 class="page-header">AssertJ-DB features highlight</h1>
<h2 style="color:darkblue;font-style: italic;"><u>AssertJ-DB site has moved to <a href="https://assertj.github.io/doc/#assertj-db">https://assertj.github.io/doc/</a></u></h2>
<p>Before reading this page, it is recommended to be familiar with the <a href="assertj-db-concepts.html">concepts of AssertJ-DB</a>.</p>
<p>The purpose of this page is to show the different features of AssertJ-DB.</p>
<ul>
<li><a href="#navigation">Navigation</a>
<ul>
<li><a href="#tableorrequestasroot">With a Table or a Request as root</a>
<ul>
<li><a href="#tableorrequesttorow">To a Row</a></li>
<li><a href="#tableorrequesttocolumn">To a Column</a></li>
<li><a href="#tableorrequesttovalue">To a Value</a></li>
</ul>
</li>
<li><a href="#changesasroot">With Changes as root</a>
<ul>
<li><a href="#changestochanges">To Changes</a></li>
<li><a href="#changestochange">To a Change</a></li>
<li><a href="#changestorow">To a Row</a></li>
<li><a href="#changestocolumn">To a Column</a></li>
<li><a href="#changestovalue">To a Value</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#assertions">Assertions</a>
<ul>
<li><a href="#onchangetype">On the type of change</a>
</li>
<li><a href="#oncolumnequality">On the equality with the values of a column</a>
<ul>
<li><a href="#oncolumnequality-boolean">With Boolean</a></li>
<li><a href="#oncolumnequality-bytes">With Bytes</a></li>
<li><a href="#oncolumnequality-number">With Number</a></li>
<li><a href="#oncolumnequality-date">With Date</a></li>
<li><a href="#oncolumnequality-time">With Time</a></li>
<li><a href="#oncolumnequality-datetime">With Date/Time</a></li>
<li><a href="#oncolumnequality-string">With String</a></li>
<li><a href="#oncolumnequality-uuid">With UUID</a> <small><i>(since <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a>)</i></small></li>
<li><a href="#oncolumnequality-character">With Character</a> <small><i>(since <a href="assertj-db-news.html#assertj-db-1.2.0">1.2.0</a>)</i></small></li>
</ul>
</li>
<li><a href="#oncolumnname">On the name of a column</a>
</li>
<li><a href="#oncolumnnullity">On the nullity of the values of a column</a>
</li>
<li><a href="#onrownullity">On the nullity of the values of a row</a> <small><i>(since <a href="assertj-db-news.html#assertj-db-1.2.0">1.2.0</a>)</i></small>
</li>
<li><a href="#oncolumntype">On the type of column</a>
</li>
<li><a href="#oncolumnclass">On the class of column</a> <small><i>(since <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a>)</i></small>
</li>
<li><a href="#oncolumncontent">On the content of column</a> <small><i>(since <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a>)</i></small>
</li>
<li><a href="#ondatatype">On the type of data</a>
</li>
<li><a href="#onmodifiedcolumns">On the modified columns in a change</a> <small><i>(modified in <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a>)</i></small>
</li>
<li><a href="#onnumberchanges">On the number of changes</a> <small><i>(modified in <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a>)</i></small>
</li>
<li><a href="#onnumbercolumns">On the number of columns</a> <small><i>(modified in <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a>)</i></small>
</li>
<li><a href="#onnumberrows">On the number of rows</a> <small><i>(modified in <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a> and <a href="assertj-db-news.html#assertj-db-1.2.0">1.2.0</a>)</i></small>
</li>
<li><a href="#onprimarykeys">On the primary keys</a>
</li>
<li><a href="#onrowequality">On the equality with the values of a row</a>
</li>
<li><a href="#onrowexistence">On the existence of a row in a change</a>
</li>
<li><a href="#onvaluechronology">On the chronology of a value</a>
</li>
<li><a href="#onvaluecomparison">On the comparison with a value</a>
</li>
<li><a href="#onvaluecloseness">On the closeness of a value</a> <small><i>(since <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a>)</i></small>
</li>
<li><a href="#onvaluequality">On the equality with a value</a>
<ul>
<li><a href="#onvaluequality-boolean">With Boolean</a></li>
<li><a href="#onvaluequality-bytes">With Bytes</a></li>
<li><a href="#onvaluequality-number">With Number</a></li>
<li><a href="#onvaluequality-date">With Date</a></li>
<li><a href="#onvaluequality-time">With Time</a></li>
<li><a href="#onvaluequality-datetime">With Date/Time</a></li>
<li><a href="#onvaluequality-string">With String</a></li>
<li><a href="#onvaluequality-uuid">With UUID</a> <small><i>(since <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a>)</i></small></li>
<li><a href="#onvaluequality-character">With Character</a> <small><i>(since <a href="assertj-db-news.html#assertj-db-1.2.0">1.2.0</a>)</i></small></li>
</ul>
</li>
<li><a href="#onvaluenonquality">On the non equality with a value</a>
<ul>
<li><a href="#onvaluenonquality-boolean">With Boolean</a></li>
<li><a href="#onvaluenonquality-bytes">With Bytes</a></li>
<li><a href="#onvaluenonquality-number">With Number</a></li>
<li><a href="#onvaluenonquality-date">With Date</a></li>
<li><a href="#onvaluenonquality-time">With Time</a></li>
<li><a href="#onvaluenonquality-datetime">With Date/Time</a></li>
<li><a href="#onvaluenonquality-string">With String</a></li>
<li><a href="#onvaluenonquality-uuid">With UUID</a> <small><i>(since <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a>)</i></small></li>
<li><a href="#onvaluenonquality-character">With Character</a> <small><i>(since <a href="assertj-db-news.html#assertj-db-1.2.0">1.2.0</a>)</i></small></li>
</ul>
</li>
<li><a href="#onvaluenullity">On the nullity of a value</a>
</li>
<li><a href="#onvaluetype">On the type of a value</a>
</li>
<li><a href="#onvalueclass">On the class of a value</a> <small><i>(since <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a>)</i></small>
</li>
</ul>
</li>
</ul>
<h3 class="page-header" ><span id="navigation"></span>Navigation</h3>
<h4 class="page-header" ><span id="tableorrequestasroot"></span>With a Table or a Request as root</h4>
<p>As shown in the <a href="assertj-db-concepts.html#tableorrequestasroot">concepts</a> (to easily understand this chapter it is important to know the concepts of assertj-db),
the <code class="java">assertThat(...)</code> static method is used
to begin an assertion
on a <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/type/Table.html">Table</a>
or on a <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/type/Request.html">Request</a>.
</p>
<p>The navigation from a table or from a request are similar, so in most of the examples below a table will be used :</p>
<pre><code class="java">assertThat(tableOrRequest)...</code></pre>
<p>If there is a difference if will be specified.</p>
<p>All the navigation methods work from an <i>origin</i> point.
That means that if the method is executed from another point,
it is like the execution is from the point of view of the <i>origin</i>.
</p>
<p>There are some recurring points in the different navigation methods :
</p>
<ul>
<li>a method without parameter which allows to navigate on the next element after the element reached on the last call
(if it is the first call, navigate to the first element)
</li>
<li>a method with an <code class="java">int</code> parameter (an index) which allows to navigate on the element which is
at the corresponding index
</li>
<li>a method with an <code class="java">String</code> parameter (a column name) which allows to navigate on the element corresponding
at the column name
</li>
</ul>
<h5 class="page-header" ><span id="tableorrequesttorow"></span>To a Row</h5>
<p>These methods are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/navigation/ToRow.html">ToRow</a> interface.</p>
<p>The <code class="java">row()</code> method allows to navigate to the next row after the row reached on the last call.</p>
<pre><code class="java">// If it is the first call, navigate to the first row
assertThat(tableOrRequest).row()...
// It is possible to chain the calls to navigate to the next row
// after the first row (so the second row)
assertThat(tableOrRequest).row().row()...</code></pre>
<p>The <code class="java">row(int index)</code> method with <code class="java">index</code> as parameter
allows to navigate to the row corresponding to row at the index.</p>
<pre><code class="java">// Navigate to the row at index 2
assertThat(tableOrRequest).row(2)...
// It is possible to chain the calls to navigate to another row.
// Here row at index 6
assertThat(tableOrRequest).row(2).row(6)...
// It is possible to combine the calls to navigate to the next row
// after the row at index 2. Here row at index 3
assertThat(tableOrRequest).row(2).row()...</code></pre>
<p>This picture shows from where it is possible to navigate to a row.</p>
<p align="center">
<img src="images/db-navigation-with-table-or-request-to-row.png" />
</p>
<p>The <i>origin</i> point of the <code class="java">row(...)</code> methods</code> is the Table or the Request.
So if the method is executed from a row, from a column or from a value
it is like if the method was executed from the Table or the Request.
</p>
<p>When the position is on a row, it is possible to return to the <i>origin</i>.
</p>
<pre><code class="java">// Return to the table from a row of a table
assertThat(table).row().returnToTable()...
// Return to the request from a row of a request
assertThat(request).row().returnToRequest()...</code></pre>
<p>That also means that the two navigations below are equivalent.
</p>
<pre><code class="java">// Navigate to the first row
// Return to the table from this row
// Navigate to the next row
assertThat(table).row().returnToTable().row()...
// The same thing is done but the return to the table is implicit
assertThat(table).row().row()...</code></pre>
<h5 class="page-header" ><span id="tableorrequesttocolumn"></span>To a Column</h5>
<p>These methods are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/navigation/ToColumn.html">ToColumn</a> interface.</p>
<p>The <code class="java">column()</code> method allows to navigate to the next column after the column reached on the last call.</p>
<pre><code class="java">// If it is the first call, navigate to the first column
assertThat(tableOrRequest).column()...
// It is possible to chain the calls to navigate to the next column
// after the first column (so the second column)
assertThat(tableOrRequest).column().column()...</code></pre>
<p>The <code class="java">column(int index)</code> method with <code class="java">index</code> as parameter
allows to navigate to the column corresponding to column at the index.</p>
<pre><code class="java">// Navigate to the column at index 2
assertThat(tableOrRequest).column(2)...
// It is possible to chain the calls to navigate to another column.
// Here column at index 6
assertThat(tableOrRequest).column(2).column(6)...
// It is possible to combine the calls to navigate to the next column
// after the column at index 2. Here column at index 3
assertThat(tableOrRequest).column(2).column()...
// It is possible to combine the calls with other navigation methods
// Here first column
assertThat(tableOrRequest).row(2).column()...
// Here column at index 3
assertThat(tableOrRequest).row(2).column(3)...
// Here column at index 4 because the origin remember last navigation to a column
assertThat(tableOrRequest).column(3).row(2).column()...</code></pre>
<p>The <code class="java">column(String columnName)</code> method with <code class="java">columnName</code> as parameter
allows to navigate to the column corresponding to the column with the column name.</p>
<pre><code class="java">// Navigate to the column with the name "SURNAME"
assertThat(tableOrRequest).column("surname")...
// Like for the other methods, it is possible to chain the calls
assertThat(tableOrRequest).column("surname").column().column(6).column("id")...</code></pre>
<p>This picture shows from where it is possible to navigate to a column.</p>
<p align="center">
<img src="images/db-navigation-with-table-or-request-to-column.png" />
</p>
<p>The <i>origin</i> point of the <code class="java">column(...)</code> methods</code> is the Table or the Request.
So if the method is executed from a row, from a column or from a value
it is like if the method was executed from the Table or The Request.
</p>
<p>When the position is on a column, it is possible to return to the <i>origin</i>.
</p>
<pre><code class="java">// Return to the table from a column of a table
assertThat(table).column().returnToTable()...
// Return to the request from a column of a request
assertThat(request).column().returnToRequest()...</code></pre>
<p>That also means that the two navigations below are equivalent.
</p>
<pre><code class="java">// Navigate to the first column
// Return to the table from this column
// Navigate to the next column
assertThat(table).column().returnToTable().column()...
// The same thing is done but the return to the table is implicit
assertThat(table).column().column()...</code></pre>
<h5 class="page-header" ><span id="tableorrequesttovalue"></span>To a Value</h5>
<p>These methods are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/navigation/ToValue.html">ToValue</a>
and the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/navigation/ToValueFromRow.html">ToValueFromRow</a> interfaces.</p>
<p>The <code class="java">value()</code> method allows to navigate to the next value after the value reached on the last call.</p>
<pre><code class="java">// If it is the first call, navigate to the first value
assertThat(tableOrRequest).row().value()...
// It is possible to chain the calls to navigate to the next value
// after the first value (so the second value)
assertThat(tableOrRequest).column().value().value()...</code></pre>
<p>The <code class="java">value(int index)</code> method with <code class="java">index</code> as parameter
allows to navigate to the value corresponding to value at the index.</p>
<pre><code class="java">// Navigate to the value at index 2
assertThat(tableOrRequest).column().value(2)...
// It is possible to chain the calls to navigate to another value.
// Here value at index 6
assertThat(tableOrRequest).row(4).value(2).value(6)...
// It is possible to combine the calls to navigate to the next value
// after the value at index 2. Here value at index 3
assertThat(tableOrRequest).column(4).value(2).value()...
// Here value at index 4 because the origin remember last navigation to a column
assertThat(tableOrRequest).column().value(3).row(2).column(0).value()...</code></pre>
<p>The <code class="java">value(String columnName)</code> method with <code class="java">columnName</code> as parameter (only available from a row)
allows to navigate to the value of the column corresponding to the column with the column name.</p>
<pre><code class="java">// Navigate to the value of the column with the name "SURNAME"
assertThat(tableOrRequest).row().value("surname")...
// Like for the other methods, it is possible to chain the calls
assertThat(tableOrRequest).row().value("surname").value().value(6).value("id")...</code></pre>
<p>This picture shows from where it is possible to navigate to a value.</p>
<p align="center">
<img src="images/db-navigation-with-table-or-request-to-value.png" />
</p>
<p>The <i>origin</i> point of the <code class="java">value(...)</code> methods</code> is the Row or the Column.
So if the method is executed from a value
it is like if the method was executed from the Row or The Column.
</p>
<p>When the position is on a value, it is possible to return to the <i>origin</i>.
</p>
<pre><code class="java">// Return to the column from a value
assertThat(table).column().value().returnToColumn()...
// Return to the row from a value
assertThat(request).row().value().returnToRow()...</code></pre>
<p>That also means that the two navigations below are equivalent.
</p>
<pre><code class="java">// Navigate to the first column
// Navigate to the first value
// Return to the column from this value
// Navigate to the next value
assertThat(table).column().value().returnToColumn().value()...
// The same thing is done but the return to the column is implicit
assertThat(table).column().value().value()...</code></pre>
<h4 class="page-header" ><span id="changesasroot"></span>With Changes as root</h4>
<h5 class="page-header" ><span id="changestochanges"></span>To Changes</h5>
<p>These methods are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/navigation/ToChanges.html">ToChanges</a> interface.</p>
<p>The <code class="java">ofCreation()</code> method allows to navigate to the changes of creation.</p>
<pre><code class="java">// Navigate to the changes of creation
assertThat(changes).ofCreation()...</code></pre>
<p>The <code class="java">ofCreationOnTable()</code> method with <code class="java">tableName</code> as parameter
allows to navigate to the changes of creation of a table.</p>
<pre><code class="java">// Navigate to the changes of creation on the "members" table
assertThat(changes).ofCreationOnTable("members")...</code></pre>
<p>The <code class="java">ofCreation()</code> method allows to navigate to the changes of modification.</p>
<pre><code class="java">// Navigate to the changes of modification
assertThat(changes).ofModification()...</code></pre>
<p>The <code class="java">ofModificationOnTable()</code> method with <code class="java">tableName</code> as parameter
allows to navigate to the changes of modification of a table.</p>
<pre><code class="java">// Navigate to the changes of modification on the "members" table
assertThat(changes).ofModificationOnTable("members")...</code></pre>
<p>The <code class="java">ofCreation()</code> method allows to navigate to the changes of deletion.</p>
<pre><code class="java">// Navigate to the changes of deletion
assertThat(changes).ofDeletion()...</code></pre>
<p>The <code class="java">ofDeletionOnTable()</code> method with <code class="java">tableName</code> as parameter
allows to navigate to the changes of deletion of a table.</p>
<pre><code class="java">// Navigate to the changes of deletion on the "members" table
assertThat(changes).ofDeletionOnTable("members")...</code></pre>
<p>The <code class="java">onTable(String tableName)</code> method with <code class="java">tableName</code> as parameter
allows to navigate to the changes of a table.</p>
<pre><code class="java">// Navigate to all the changes on the "members" table
assertThat(changes).onTable("members")...</code></pre>
<p>The <code class="java">ofAll()</code> method allows to navigate to all the changes.</p>
<pre><code class="java">// Navigate to all the changes
assertThat(changes).ofAll()...
// The navigation can be chained
assertThat(changes).ofCreation().ofAll()...</code></pre>
<p>This picture shows from where it is possible to navigate to changes.</p>
<p align="center">
<img src="images/db-navigation-with-changes-to-changes.png" />
</p>
<p>The <i>origin</i> point of these methods is the Changes.
So if the method is executed from a change, a column, a row or a value
it is like if the method was executed from the Changes.
</p>
<h5 class="page-header" ><span id="changestochange"></span>To a Change</h5>
<p>These methods are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/navigation/ToChange.html">ToChange</a> interface.</p>
<p>The <code class="java">change()</code> method allows to navigate to the next change after the change reached on the last call.</p>
<pre><code class="java">// If it is the first call, navigate to the first change
assertThat(changes).change()...
// It is possible to chain the calls to navigate to the next change
// after the first change (so the second change)
assertThat(changes).change().change()...</code></pre>
<p>The <code class="java">change(int index)</code> method with <code class="java">index</code> as parameter
allows to navigate to the change corresponding to change at the index.</p>
<pre><code class="java">// Navigate to the change at index 2
assertThat(changes).change().change(2)...
// It is possible to chain the calls to navigate to another change.
// Here change at index 7
assertThat(changes).change(6).change()...</code></pre>
<p>The <code class="java">changeOnTable(String tableName)</code> method with <code class="java">tableName</code> as parameter
allows to navigate to the next change corresponding to the table name after the change corresponding to the table name reached on the last call.</p>
<pre><code class="java">// If it is the first call, navigate to the first change on "members" table
assertThat(changes).changeOnTable("members")...
// It is possible to chain the calls to navigate to the next change on the "members" table
// after the first change on the "members" table (so the second change)
assertThat(changes).changeOnTable("members").changeOnTable("members")...</code></pre>
<p>The <code class="java">changeOnTable(String tableName, int index)</code> method with <code class="java">tableName</code> and <code class="java">index</code> as parameters
allows to navigate to the change corresponding to change on the table name at the index.</p>
<pre><code class="java">// Navigate to the change at index 2 of "members" table
assertThat(changes).changeOnTable("members").changeOnTable("members", 2)...
// It is possible to chain the calls to navigate to another change.
// Here change at index 7 of "members" table
assertThat(changes).changeOnTable("members", 6).changeOnTable("members")...</code></pre>
<p>There are 12 other methods which are derived from the 4 methods above :</p>
<ul>
<li><code class="java">changeOfCreation()</code>, <code class="java">changeOfModification()</code> and <code class="java">changeOfDeletion()</code>
methods which allows to navigate to the next change of creation, modification and deletion like <code class="java">change()</code> method
<pre><code class="java">// If it is the first call, navigate to the first change of creation
assertThat(changes).changeOfCreation()...
// Navigate to the the first change of creation
// and after the second change of creation
assertThat(changes).changeOfCreation().changeOfCreation()...</code></pre>
</li>
<li><code class="java">changeOfCreation(int index)</code>, <code class="java">changeOfModification(int index)</code> and <code class="java">changeOfDeletion(int index)</code>
methods with <code class="java">index</code> as parameter which allows to navigate to the change of creation, modification and deletion corresponding to change of creation, modification and deletion at the index like <code class="java">change(int index)</code> method
<pre><code class="java">// Navigate to the change of modification at index 2
assertThat(changes).changeOfModification()
.changeOfModification(2)...
// It is possible to chain the calls
// to navigate to another change of modification.
// Here change of modification at index 5
assertThat(changes).changeOfModification(4)
.changeOfModification()...</code></pre>
</li>
<li><code class="java">changeOfCreationOnTable(String tableName)</code>, <code class="java">changeOfModificationOnTable(String tableName)</code> and <code class="java">changeOfDeletionOnTable(String tableName)</code>
methods with <code class="java">tableName</code> as parameter which allows to navigate to the next change of creation, modification and deletion corresponding to the table name like <code class="java">changeOnTable(String tableName)</code> method
<pre><code class="java">// If it is the first call, navigate
// to the first change of creation on "members" table
assertThat(changes).changeOfCreationOnTable("members")...
// It is possible to chain the calls to navigate
// to the next change of creation on the "members" table
// after the first change of creation on the "members" table
// (so the second change of creation)
assertThat(changes).changeOfCreationOnTable("members")
.changeOfCreationOnTable("members")...</code></pre>
</li>
<li><code class="java">changeOfCreationOnTable(String tableName, int index)</code>, <code class="java">changeOfModificationOnTable(String tableName, int index)</code> and <code class="java">changeOfDeletionOnTable(String tableName, int index)</code>
methods with <code class="java">tableName</code> and <code class="java">index</code> as parameters which allows to navigate to the next change of creation, modification and deletion corresponding to the table name and index like <code class="java">changeOnTable(String tableName, int index)</code> method
<pre><code class="java">// Navigate to the change of deletion at index 2 of "members" table
assertThat(changes).changeOfDeletionOnTable("members")
.changeOfDeletionOnTable("members", 2)...
// It is possible to chain the calls
// to navigate to another change of deletion.
// Here change of deletion at index 7 of "members" table
assertThat(changes).changeOfDeletionOnTable("members", 6)
.changeOfDeletionOnTable("members")...</code></pre>
</li>
</ul>
<p>The <code class="java">changeOnTableWithPks(String tableName, Object... pksValues)</code> method
allows to navigate to the change corresponding to the table and the primary keys.</p>
<pre><code class="java">// Navigate to the change with primary key 1 of "members" table
assertThat(changes).changeOnTableWithPks("members", 1)...
// It is possible to chain the calls to navigate to the next change
// after the change with primary key 1 of "members" table
assertThat(changes).changeOnTableWithPks("members", 1).change()...</code></pre>
<p>This picture shows from where it is possible to navigate to a change.</p>
<p align="center">
<img src="images/db-navigation-with-changes-to-change.png" />
</p>
<p>The <i>origin</i> point of the <code class="java">change(...)</code> methods</code> is the current Changes
and the <i>origin</i> point of other methods is the Changes of origin.
So if the method is executed from a change, a column, a row or a value
it is like if the method was executed from these <i>origins</i>.
</p>
<p>That means there is an important difference.
</p>
<pre><code class="java">// Navigate to the changes of deletion
// Navigate to the first change of this changes of deletion
assertThat(changes).ofDeletion().change()...
// Navigate to the changes of deletion
// Navigate to the first change of this changes of creation
assertThat(changes).ofDeletion().changeOfCreation()...
// This is equivalent to
assertThat(changes).ofDeletion().ofAll().changeOfCreation()...</code></pre>
<p>When the position is on a change, it is possible to return to the <i>origin</i>.
</p>
<pre><code class="java">// Return to the change from a column
assertThat(changes).change().returnToChanges()...</code></pre>
<p>That also means that the two navigations below are equivalent.
</p>
<pre><code class="java">// Navigate to the first change
// Return to the changes
// Navigate to the next change
assertThat(changes).change().returnToChanges().change()...
// The same thing is done but the return to the changes is implicit
assertThat(changes).change().change()...</code></pre>
<h5 class="page-header" ><span id="changestorow"></span>To a Row</h5>
<p>These methods are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/navigation/ToRowFromChange.html">ToRowFromChange</a> interface.</p>
<p>The <code class="java">rowAtStartPoint()</code> and <code class="java">rowAtEndPoint()</code> methods
allows to navigate to the row at the start point and at the end point.</p>
<pre><code class="java">// Navigate to the row at the start point
assertThat(changes).change().rowAtStartPoint()...
// Navigate to the row at the end point (note that the methods can be chained)
assertThat(changes).change().rowAtStartPoint().rowAtEndPoint()...</code></pre>
<p>This picture shows from where it is possible to navigate to a row.</p>
<p align="center">
<img src="images/db-navigation-with-changes-to-row.png" />
</p>
<p>The <i>origin</i> point of the <code class="java">rowAtStartPoint()</code> and <code class="java">rowAtEndPoint()</code> methods</code> is the Change.
So if the method is executed from a row, from a column or from a value
it is like if the method was executed from the Change.
</p>
<p>When the position is on a row, it is possible to return to the <i>origin</i>.
</p>
<pre><code class="java">// Return to the change from a row
assertThat(changes).change().rowAtStartPoint().returnToChange()...</code></pre>
<p>That also means that the two navigations below are equivalent.
</p>
<pre><code class="java">// Navigate to the first change
// Navigate to the row at start point
// Return to the change from this column
// Navigate to the row at end point
assertThat(changes).change().rowAtStartPoint().returnToChange().rowAtEndPoint()...
// The same thing is done but the return to the change is implicit
assertThat(changes).change().rowAtStartPoint().rowAtEndPoint()...</code></pre>
<h5 class="page-header" ><span id="changestocolumn"></span>To a Column</h5>
<p>These methods are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/navigation/ToColumn.html">ToColumn</a>
and <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/navigation/ToColumnFromChange.html">ToColumnFromChange</a> interfaces.</p>
<p>The <code class="java">column()</code> method allows to navigate to the next column after the column reached on the last call.</p>
<pre><code class="java">// If it is the first call, navigate to the first column
assertThat(changes).change().column()...
// It is possible to chain the calls to navigate to the next column
// after the first column (so the second column)
assertThat(changes).change().column().column()...</code></pre>
<p>The <code class="java">column(int index)</code> method with <code class="java">index</code> as parameter
allows to navigate to the column corresponding to column at the index.</p>
<pre><code class="java">// Navigate to the column at index 2
assertThat(changes).change().column(2)...
// It is possible to chain the calls to navigate to another column.
// Here column at index 6
assertThat(changes).change().column(2).column(6)...
// It is possible to combine the calls to navigate to the next column
// after the column at index 2. Here column at index 3
assertThat(changes).change().column(2).column()...
// It is possible to combine the calls with other navigation methods
// Here first column
assertThat(changes).change().rowAtStartPoint().column()...
// Here column at index 3
assertThat(changes).change().rowAtEndPoint().column(3)...
// Here column at index 4 because the origin remember last navigation to a column
assertThat(changes).change().column(3).rowAtEndPoint().column()...</code></pre>
<p>The <code class="java">column(String columnName)</code> method with <code class="java">columnName</code> as parameter
allows to navigate to the column corresponding to the column with the column name.</p>
<pre><code class="java">// Navigate to the column with the name "SURNAME"
assertThat(changes).change().column("surname")...
// Like for the other methods, it is possible to chain the calls
assertThat(changes).change().column("surname").column().column(6).column("id")...</code></pre>
<p>The <code class="java">columnAmongTheModifiedOnes()</code> method
allows to navigate to the next column with modifications after the column reached on the last call.
</p>
<pre><code class="java">// If it is the first call, navigate to the first column with modifications
assertThat(changes).change().columnAmongTheModifiedOnes()...
// It is possible to chain the calls to navigate to the next column
// after the first column (so the second column with modifications)
assertThat(changes).change().columnAmongTheModifiedOnes()
.columnAmongTheModifiedOnes()...</code></pre>
<p>
The <code class="java">columnAmongTheModifiedOnes(int index)</code> method with <code class="java">index</code> as parameter
allows to navigate to the column with modifications corresponding to column at the index.
</p>
<pre><code class="java">// Navigate to the column at index 2 (the third column with modifications)
assertThat(changes).change().columnAmongTheModifiedOnes(2)...
// It is possible to chain the calls to navigate to another column.
// Here column at index 0 (the first column with modifications)
assertThat(changes).change().columnAmongTheModifiedOnes(2)
.columnAmongTheModifiedOnes(0)...</code></pre>
<p>The <code class="java">columnAmongTheModifiedOnes(String columnName)</code> method with <code class="java">columnName</code> as parameter
allows to navigate to the column with modifications corresponding to the column with the column name.</p>
<pre><code class="java">// Navigate to the column with modifications and the name "SURNAME"
assertThat(changes).change().columnAmongTheModifiedOnes("surname")...
// Like for the other methods, it is possible to chain the calls
assertThat(changes).change().column("surname").columnAmongTheModifiedOnes()
.column(6).columnAmongTheModifiedOnes("id")...</code></pre>
<p>This picture shows from where it is possible to navigate to a column.</p>
<p align="center">
<img src="images/db-navigation-with-changes-to-column.png" />
</p>
<p>The <i>origin</i> point of the <code class="java">column(...)</code> methods</code> is the Change.
So if the method is executed from a row, from a column or from a value
it is like if the method was executed from the Change.
</p>
<p>When the position is on a column, it is possible to return to the <i>origin</i>.
</p>
<pre><code class="java">// Return to the change from a column
assertThat(changes).change().column().returnToChange()...</code></pre>
<p>That also means that the two navigations below are equivalent.
</p>
<pre><code class="java">// Navigate to the first change
// Navigate to the first column
// Return to the change from this column
// Navigate to the next column
assertThat(changes).change().column().returnToChange().column()...
// The same thing is done but the return to the change is implicit
assertThat(changes).change().column().column()...</code></pre>
<h5 class="page-header" ><span id="changestovalue"></span>To a Value</h5>
<p>These methods are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/navigation/ToValue.html">ToValue</a>,
<a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/navigation/ToValueFromColumn.html">ToValueFromColumn</a>
and <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/navigation/ToValueFromRow.html">ToValueFromRow</a> interfaces.</p>
<p>This picture shows from where it is possible to navigate to a value.</p>
<p>The <code class="java">value()</code> method (only available from a row) allows to navigate to the next value after the value reached on the last call.</p>
<pre><code class="java">// If it is the first call, navigate to the first value
assertThat(changes).change().rowAtEndPoint().value()...
// It is possible to chain the calls to navigate to the next value
// after the first value (so the second value)
assertThat(changes).change().rowAtEndPoint().value().value()...</code></pre>
<p>The <code class="java">value(int index)</code> method with <code class="java">index</code> as parameter (only available from a row)
allows to navigate to the value corresponding to value at the index.</p>
<pre><code class="java">// Navigate to the value at index 2
assertThat(changes).change().rowAtEndPoint().value(2)...
// It is possible to chain the calls to navigate to another value.
// Here value at index 6
assertThat(changes).change().rowAtEndPoint().value(2).value(6)...
// It is possible to combine the calls to navigate to the next value
// after the value at index 2. Here value at index 3
assertThat(changes).change().rowAtEndPoint().value(2).value()...
// Here value at index 4 because the origin remember last navigation to the row
assertThat(changes).change().rowAtEndPoint().value(3).column(2).rowAtEndPoint().value()...</code></pre>
<p>The <code class="java">value(String columnName)</code> method with <code class="java">columnName</code> as parameter (only available from a row)
allows to navigate to the value of the column corresponding to the column with the column name.</p>
<pre><code class="java">// Navigate to the value of the column with the name "SURNAME"
assertThat(changes).change().rowAtEndPoint().value("surname")...
// Like for the other methods, it is possible to chain the calls
assertThat(changes).change().rowAtEndPoint().value("surname").value().value(6).value("id")...</code></pre>
<p>The <code class="java">valueAtStartPoint()</code> and <code class="java">valueAtEndPoint()</code> methods (only available from a column)
allows to navigate to the value at the start point and at the end point.</p>
<pre><code class="java">// Navigate to the value at the start point of the row
assertThat(changes).change().column().valueAtStartPoint()...
// Navigate to the value at the end point of the row (note that the methods can be chained)
assertThat(changes).change().column().valueAtStartPoint().valueAtEndPoint()...</code></pre>
<p>This picture shows from where it is possible to navigate to a value.</p>
<p align="center">
<img src="images/db-navigation-with-changes-to-value.png" />
</p>
<p>The <i>origin</i> point of the <code class="java">value(...)</code> methods</code> is the Row or the Column.
So if the method is executed from a value
it is like if the method was executed from the Row or The Column.
</p>
<p>When the position is on a value, it is possible to return to the <i>origin</i>.
</p>
<pre><code class="java">// Return to the column from a value
assertThat(changes).change().column().valueAtEndPoint().returnToColumn()...
// Return to the row from a value
assertThat(changes).change().rowAtEndPoint().value().returnToRow()...</code></pre>
<p>That also means that the two navigations below are equivalent.
</p>
<pre><code class="java">// Navigate to the first change
// Navigate to the row at end point
// Navigate to the first value
// Return to the column from this value
// Navigate to the next value
assertThat(changes).change().rowAtEndPoint().value().returnToRow().value()...
// The same thing is done but the return to the row is implicit
assertThat(changes).change().rowAtEndPoint().value().value()...</code></pre>
<h3 class="page-header" ><span id="assertions"></span>Assertions</h3>
<h4 class="page-header" ><span id="onchangetype">On the type of change</h4>
<p>These assertions are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnChangeType.html">AssertOnChangeType</a> interface.</p>
<p>These assertions allow to verify the type of a change (the concept of change of type is described <a href="assertj-db-concepts.html#changetype">here</a>).</p>
<pre><code class="java">// Verify that the first change is a change of creation
assertThat(changes).change().isOfType(ChangeType.CREATION);</code></pre>
<p>There are specific assertion methods for each type of change. For example, the assertion below is equivalent to the one above</p>
<pre><code class="java">assertThat(changes).change().isCreation();</code></pre>
<h4 class="page-header" ><span id="oncolumnequality">On the equality with the values of a column</h4>
<p>These assertions are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnColumnEquality.html">AssertOnColumnEquality</a>
and the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnColumnOfChangeEquality.html">AssertOnColumnOfChangeEquality</a> interfaces.</p>
<p>These assertion allow to verify the values of a column (the column of a table, of a request or of a change).</p>
<h5 class="page-header" ><span id="oncolumnequality-boolean">With Boolean</h5>
<pre><code class="java">// Verify that the values of the column "live" of the request
// was equal to true, to false and after to true
assertThat(request).column("live").hasValues(true, false, true);
// Verify that the value of the first column of the first change
// was false at start point and is true at end point
assertThat(changes).change().column().hasValues(false, true);
// Verify that the value of the third column of the first change
// is not modified and is true
assertThat(changes).change().column(2).hasValues(true);</code></pre>
<h5 class="page-header" ><span id="oncolumnequality-bytes">With Bytes</h5>
<pre><code class="java">// Get bytes from a file and from a resource in the classpath
byte[] bytesFromFile = Assertions.bytesContentOf(file);
byte[] bytesFromClassPath = Assertions.bytesContentFromClassPathOf(resource);
// Verify that the values of the second column of the request
// was equal to the bytes from the file, to null and to bytes from the resource
assertThat(request).column(1).hasValues(bytesFromFile, null, bytesFromClassPath);
// Verify that the value of the first column of the first change
// was equal to bytes from the file at start point and to bytes from the resource at end point
assertThat(changes).change().column().hasValues(bytesFromFile, bytesFromClassPath);</code></pre>
<h5 class="page-header" ><span id="oncolumnequality-number">With Number</h5>
<pre><code class="java">// Verify that the values of the first column of the table
// was equal to 5.9, 4 and 15000
assertThat(table).column().hasValues(5.9, 4, new BigInteger("15000"));
// Verify that the value of the first column of the first change
// is not modified and is equal to 5
assertThat(changes).change().column().hasValues(5);</code></pre>
<h5 class="page-header" ><span id="oncolumnequality-date">With Date</h5>
<p>This assertion use <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/type/DateValue.html">DateValue</a>
presented in <a href="assertj-db-concepts.html#datevalue-timevalue-datetimevalue">concepts</a>.</p>
<pre><code class="java">// Verify that the values of the first column of the table
// was equal to December 23rd 2007 and May 19th 1975
assertThat(table).column()
.hasValues(DateValue.of(2007, 12, 23),
DateValue.of(1975, 5, 19));
// Verify that the value of the first column of the first change
// was equal December 23rd 2007 at start point
// and is equal to May 19th 1975 at end point
assertThat(changes).change().column()
.hasValues(DateValue.parse("2007-12-23"),
DateValue.parse("1975-05-19"));</code></pre>
<h5 class="page-header" ><span id="oncolumnequality-time">With Time</h5>
<p>This assertion use <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/type/TimeValue.html">TimeValue</a>
presented in <a href="assertj-db-concepts.html#datevalue-timevalue-datetimevalue">concepts</a>.</p>
<pre><code class="java">// Verify that the values of the first column of the table
// was equal to 09:01am and 05:30:50pm
assertThat(table).column()
.hasValues(TimeValue.of(9, 1),
TimeValue.of(17, 30, 50));
// Verify that the value of the first column of the first change
// was equal to 09:01am at start point
// and is equal to 05:30:50pm at end point
assertThat(changes).change().column()
.hasValues(TimeValue.parse("09:01"),
TimeValue.parse("17:30:50"));</code></pre>
<h5 class="page-header" ><span id="oncolumnequality-datetime">With Date/Time</h5>
<p>This assertion use <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/type/DateTimeValue.html">DateTimeValue</a>
presented in <a href="assertj-db-concepts.html#datevalue-timevalue-datetimevalue">concepts</a>.</p>
<pre><code class="java">// Verify that the values of the first column of the table
// was equal to December 23rd 2007 09:01am and May 19th 1975
assertThat(table).column()
.hasValues(DateTimeValue.of(DateValue.of(2007, 12, 23),
TimeValue.parse("09:01")),
DateTimeValue.of(DateValue.of(1975, 5, 19)));
// Verify that the value of the first column of the first change
// was equal December 23rd 2007 09:01am at start point
// and is equal to May 19th 1975 at end point
assertThat(changes).change().column()
.hasValues(DateTimeValue.parse("2007-12-23T09:01"),
DateTimeValue.parse("1975-05-19"));</code></pre>
<h5 class="page-header" ><span id="oncolumnequality-string">With String</h5>
<pre><code class="java">// Verify that values are equal to texts
assertThat(table).column("name")
.hasValues("Hewson",
"Evans",
"Clayton",
"Mullen");
// Verify that the value of the column "size" of the first change of modification
// is not modified and is equal to 1.75 by parsing
assertThat(changes).changeOfModification().column("size")
.hasValues("1.75");
// Verify that values are equal to dates, times or dates/times by parsing
assertThat(table).column()
.hasValues("2007-12-23T09:01"),
"1975-05-19");</code></pre>
<h5 class="page-header" ><span id="oncolumnequality-uuid">With UUID</h5>
<p><i>Since <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a></i></p>
<pre><code class="java">// Verify that the values of the first column of the table
// was equal to 30B443AE-C0C9-4790-9BEC-CE1380808435, 0E2A1269-EFF0-4233-B87B-B53E8B6F164D
// and 2B0D1BDD-909E-4362-BA10-C930BA82718D
assertThat(table).column().hasValues(UUID.fromString("30B443AE-C0C9-4790-9BEC-CE1380808435"),
UUID.fromString("0E2A1269-EFF0-4233-B87B-B53E8B6F164D"),
UUID.fromString("2B0D1BDD-909E-4362-BA10-C930BA82718D"));
// Verify that the value of the first column of the first change
// is not modified and is equal to 399FFFCA-7874-4225-9903-E227C4E9DCC1
assertThat(changes).change()
.column().hasValues(UUID.fromString("399FFFCA-7874-4225-9903-E227C4E9DCC1"));</code></pre>
<h5 class="page-header" ><span id="oncolumnequality-character">With Character</h5>
<p><i>Since <a href="assertj-db-news.html#assertj-db-1.2.0">1.2.0</a></i></p>
<pre><code class="java">// Verify that the values of the first column of the table
// was equal to 'T', 'e', 's' and 't'
assertThat(table).column().hasValues('T', 'e', 's', 't');
// Verify that the value of the first column of the first change
// is not modified and is equal to 'T'
assertThat(changes).change().column().hasValues('T');</code></pre>
<h4 class="page-header" ><span id="oncolumnname">On the name of a column</h4>
<p>This assertion is described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnColumnName.html">AssertOnColumnName</a> interface.</p>
<p>This assertion allows to verify the name of a column (the column of a table, of a request or of a change).</p>
<pre><code class="java">// Verify that the fifth column of the table is called "firstname"
assertThat(table).column(4).hasColumnName("firstname");
// Verify that the third value of the second row of the request is in a column called "name"
assertThat(request).row(1).value(2).hasColumnName("name");
// Verify that the first column of the first change is called "id"
assertThat(changes).change().column().hasColumnName("id");</code></pre>
<h4 class="page-header" ><span id="oncolumnnullity">On the nullity of the values of a column</h4>
<p>These assertions are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnColumnNullity.html">AssertOnColumnNullity</a> interface.</p>
<p>These assertion allows to verify the nullity of the values of a column (the column of a table or of a request).</p>
<pre><code class="java">// Verify that the fifth column of the table has only null values
assertThat(table).column(4).hasOnlyNullValues();
// Verify that the column "name" has only not null values
assertThat(request).column("name").hasOnlyNotNullValues();</code></pre>
<h4 class="page-header" ><span id="onrownullity">On the nullity of the values of a row</h4>
<p><i>Since <a href="assertj-db-news.html#assertj-db-1.2.0">1.2.0</a></i></p>
<p>These assertions are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnRowNullity.html">AssertOnRowNullity</a> interface.</p>
<p>These assertion allows to verify the nullity of the values of a row (the row of a table or of a request).</p>
<pre><code class="java">// Verify that the fifth row of the table has only not null values
assertThat(table).row(4).hasOnlyNotNullValues();
// Verify that the first column has only not null values
assertThat(request).row().hasOnlyNotNullValues();</code></pre>
<h4 class="page-header" ><span id="oncolumntype">On the type of column</h4>
<p>These assertions are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnColumnType.html">AssertOnColumnType</a> interface.</p>
<p>These assertions allow to verify the type of the values of a column (a column from a table, from a request or from a change).</p>
<pre><code class="java">// Verify that the values of the column called "firstname"
// of the table are a text (null values are considered as wrong)
assertThat(table).column("firstname").isOfType(ValueType.TEXT, false);
// The same verification (with the specific method)
// on the third column of the request
assertThat(request).column(2).isText(false);
// Now the same verification again but with a lenience with null values
// (the null values are not considered as wrong)
assertThat(request).column(2).isText(true);
// Verify that the values of the first column
// of the first change is either a date or a number
assertThat(changes).change().column()
.isOfAnyOfTypes(ValueType.DATE, ValueType.NUMBER);</code></pre>
<h4 class="page-header" ><span id="oncolumnclass">On the class of column</h4>
<p><i>Since <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a></i></p>
<p>This assertion is described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnColumnClass.html">AssertOnColumnClass</a> interface.</p>
<p>This assertion allows to verify the class of the values of a column (a column from a table, from a request or from a change).</p>
<pre><code class="java">// Verify that the values of the column called "firstname"
// of the table are a String (null values are considered as wrong)
assertThat(table).column("firstname").isOfClass(String.class, false);
// Verify that the values of the first column
// of the first change is a Locale (null values are considered as right)
assertThat(changes).change().column().isOfClass(Locale.class, true);</code></pre>
<h4 class="page-header" ><span id="oncolumncontent">On the content of column</h4>
<p><i>Since <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a></i></p>
<p>These assertions are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnColumnContent.html">AssertOnColumnContent</a> interface.</p>
<p>These assertions allow to verify the content of a column (a column from a table or from a request).</p>
<pre><code class="java">// Verify that the content of the column called "name"
assertThat(table).column("name").containsValues("Hewson",
"Evans",
"Clayton",
"Mullen");
// This second assertion is equivalent because the order of the values is not important
assertThat(table).column("name").containsValues("Evans",
"Clayton",
"Hewson",
"Mullen");
</code></pre>
<h4 class="page-header" ><span id="ondatatype">On the type of data</h4>
<p>These assertions are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnDataType.html">AssertOnDataType</a> interface.</p>
<p>These assertions allow to verify the type of the date on which is a change.</p>
<pre><code class="java">// Verify that the change is on a table
assertThat(changes).change().isOnDataType(DataType.TABLE);
// The same verification (with the specific method)
assertThat(changes).change().isOnTable();
// Verify that the change is on the "members" table
assertThat(changes).change().isOnTable("members");</code></pre>
<h4 class="page-header" ><span id="onmodifiedcolumns">On the modified columns in a change</h4>
<p>These assertions are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnModifiedColumn.html">AssertOnModifiedColumn</a>
and the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnModifiedColumns.html">AssertOnModifiedColumns</a> interfaces.</p>
<p>These assertions allow to verify if a column of a change have been modified between the start point and the end point (see the <a href="assertj-db-concepts.html#changes">concept of changes</a>).</p>
<pre><code class="java">// Verify that first column of the change is not modified
// and the second column is modified
assertThat(changes).change().column().isNotModified().column().isModified();
// Verify that there are 2 modified columns in the change
assertThat(changes).change().hasNumberOfModifiedColumns(2);
// Verify that the modified column in change are at index 1 and 2
assertThat(changes).change().hasModifiedColumns(1, 2);
// Verify that the modified column in change are "name" and "firstname"
assertThat(changes).change().hasModifiedColumns("name", "firstname");</code></pre>
<p><i>Since version <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a></i>, there are new assertions which allow to compare the number of modified columns between the start point and the end point.</p>
<pre><code class="java">// Verify that the number of modified columns in the first change is more than 5
assertThat(changes).change().hasNumberOfModifiedColumnsGreaterThan(5);
// Verify that the number of modified columns in the first change is at least 5
assertThat(changes).change().hasNumberOfModifiedColumnsGreaterThanOrEqualTo(5);
// Verify that the number of modified columns in the first change is less than 6
assertThat(changes).change().hasNumberOfModifiedColumnsLessThan(6);
// Verify that the number of modified columns in the first change is at most 6
assertThat(changes).change().hasNumberOfModifiedColumnsLessThanOrEqualTo(6);</code></pre>
<h4 class="page-header" ><span id="onnumberchanges">On the number of changes</h4>
<p>This assertion is described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnNumberOfChanges.html">AssertOnNumberOfChanges</a> interface.</p>
<p>This assertion allows to verify the number of changes.</p>
<pre><code class="java">// Verify that there are 4 changes
assertThat(changes).hasNumberOfChanges(4);</code></pre>
<p><i>Since version <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a></i>, there are new assertions which allow to compare the number of changes between the start point and the end point.</p>
<pre><code class="java">// Verify that the number of changes is more than 5
assertThat(changes).hasNumberOfChangesGreaterThan(5);
// Verify that the number of changes is at least 5
assertThat(changes).hasNumberOfChangesGreaterThanOrEqualTo(5);
// Verify that the number of changes is less than 6
assertThat(changes).hasNumberOfChangesLessThan(6);
// Verify that the number of changes is at most 6
assertThat(changes).hasNumberOfChangesLessThanOrEqualTo(6);</code></pre>
<h4 class="page-header" ><span id="onnumbercolumns">On the number of columns</h4>
<p>This assertion is described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnNumberOfColumns.html">AssertOnNumberOfColumns</a> interface.</p>
<p>This assertion allows to verify the number of columns (columns from a table, from a request or from a change).</p>
<pre><code class="java">// Verify that there are 6 columns in the table
assertThat(table).hasNumberOfColumns(6);
// Verify that there are 4 columns in the change
assertThat(changes).change().hasNumberOfColumns(4);</code></pre>
<p><i>Since version <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a></i>, there are new assertions which allow to compare the number of columns.</p>
<pre><code class="java">// Verify that the number of columns is more than 5
assertThat(table).hasNumberOfColumnsGreaterThan(5);
// Verify that the number of columns is at least 5
assertThat(request).hasNumberOfColumnsGreaterThanOrEqualTo(5);
// Verify that the number of columns is less than 6
assertThat(changes).hasNumberOfColumnsLessThan(6);
// Verify that the number of columns is at most 6
assertThat(changes).hasNumberOfColumnsLessThanOrEqualTo(6);</code></pre>
<h4 class="page-header" ><span id="onnumberrows">On the number of rows</h4>
<p>This assertion is described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnNumberOfRows.html">AssertOnNumberOfRows</a> interface.</p>
<p>This assertion allows to verify the number of rows (rows from a table or from a request).</p>
<pre><code class="java">// Verify that there are 7 rows in the table
assertThat(table).hasNumberOfRows(7);</code></pre>
<p><i>Since version <a href="assertj-db-news.html#assertj-db-1.1.0">1.1.0</a></i>, there are new assertions which allow to compare the number of rows.</p>
<pre><code class="java">// Verify that the number of rows is more than 5
assertThat(table).hasNumberOfRowsGreaterThan(5);
// Verify that the number of rows is at least 5
assertThat(request).hasNumberOfRowsGreaterThanOrEqualTo(5);
// Verify that the number of rows is less than 6
assertThat(changes).hasNumberOfRowsLessThan(6);
// Verify that the number of rows is at most 6
assertThat(changes).hasNumberOfRowsLessThanOrEqualTo(6);</code></pre>
<p><i>Since version <a href="assertj-db-news.html#assertj-db-1.2.0">1.2.0</a></i>, there is a new assertion which allow to verify if rows are empty (equivalent to <code class="java">hasNumberOfRows(0)</code>).</p>
<pre><code class="java">// Verify that the table are empty
assertThat(table).isEmpty();</code></pre>
<h4 class="page-header" ><span id="onprimarykeys">On the primary keys</h4>
<p>These assertions are described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnPrimaryKey.html">AssertOnPrimaryKey</a> interface.</p>
<p>These assertions allow to verify the names and the values of the columns which compose the primary keys of the rows from a change.</p>
<pre><code class="java">// Verify that the columns of the primary keys are "id" and "name"
assertThat(changes).change().hasPksNames("id", "name");
// Verify that the values of the primary keys are 1 and "HEWSON"
assertThat(changes).change().hasPksValues(1, "HEWSON");</code></pre>
<h4 class="page-header" ><span id="onrowequality">On the equality with the values of a row</h4>
<p>This assertion is described in the <a href="https://www.javadoc.io/doc/org.assertj/assertj-db/latest/org/assertj/db/api/assertions/AssertOnRowEquality.html">AssertOnRowEquality</a> interface.</p>
<p>This assertion allow to verify the values of a row (the row of a table, of a request or of a change).</p>
<pre><code class="java">// Verify the values of the row at index 1
assertThat(table).row(1)
.hasValues(2,
"Evans",
"David Howell",
"The Edge",
DateValue.of(1961, 8, 8),
1.77);
// Verify the values of the row at end point
assertThat(changes).change().rowAtEndPoint()
.hasValues(5,
"McGuiness",
"Paul",
null,
"1951-06-17",
null);</code></pre>
<h4 class="page-header" ><span id="onrowexistence">On the existence of a row in a change</h4>