7777import static org .assertj .core .api .InstanceOfAssertFactories .LONG_PREDICATE ;
7878import static org .assertj .core .api .InstanceOfAssertFactories .LONG_STREAM ;
7979import static org .assertj .core .api .InstanceOfAssertFactories .MAP ;
80+ import static org .assertj .core .api .InstanceOfAssertFactories .MATCHER ;
8081import static org .assertj .core .api .InstanceOfAssertFactories .OFFSET_DATE_TIME ;
8182import static org .assertj .core .api .InstanceOfAssertFactories .OFFSET_TIME ;
8283import static org .assertj .core .api .InstanceOfAssertFactories .OPTIONAL ;
99100import static org .assertj .core .api .InstanceOfAssertFactories .URL_TYPE ;
100101import static org .assertj .core .api .InstanceOfAssertFactories .ZONED_DATE_TIME ;
101102import static org .assertj .core .api .InstanceOfAssertFactories .array ;
103+ import static org .assertj .core .api .InstanceOfAssertFactories .array2D ;
102104import static org .assertj .core .api .InstanceOfAssertFactories .atomicIntegerFieldUpdater ;
103105import static org .assertj .core .api .InstanceOfAssertFactories .atomicLongFieldUpdater ;
104106import static org .assertj .core .api .InstanceOfAssertFactories .atomicMarkableReference ;
121123import static org .assertj .core .api .InstanceOfAssertFactories .throwable ;
122124import static org .assertj .core .api .InstanceOfAssertFactories .type ;
123125import static org .assertj .core .test .Maps .mapOf ;
124- import static org .assertj .core .util .Lists .list ;
125126import static org .mockito .Mockito .mock ;
126127
127128import java .io .ByteArrayInputStream ;
168169import java .util .function .IntPredicate ;
169170import java .util .function .LongPredicate ;
170171import java .util .function .Predicate ;
172+ import java .util .regex .Pattern ;
171173import java .util .stream .DoubleStream ;
172174import java .util .stream .IntStream ;
173175import java .util .stream .LongStream ;
174176import java .util .stream .Stream ;
175177
178+ import org .assertj .core .util .Lists ;
176179import org .assertj .core .util .Strings ;
177180import org .junit .jupiter .api .Test ;
178181
@@ -321,6 +324,16 @@ void optional_long_factory_should_allow_optional_long_assertions() {
321324 result .isPresent ();
322325 }
323326
327+ @ Test
328+ void matcher_factory_should_allow_matcher_assertions () {
329+ // GIVEN
330+ Object value = Pattern .compile ("a*" ).matcher ("aaa" );
331+ // WHEN
332+ MatcherAssert result = assertThat (value ).asInstanceOf (MATCHER );
333+ // THEN
334+ result .matches ();
335+ }
336+
324337 @ Test
325338 void big_decimal_factory_should_allow_big_decimal_assertions () {
326339 // GIVEN
@@ -641,6 +654,16 @@ void array_factory_should_allow_array_assertions() {
641654 result .containsExactly (0 , "" );
642655 }
643656
657+ @ Test
658+ void array_typed_factory_should_allow_array_typed_assertions () {
659+ // GIVEN
660+ Object value = new Integer [] { 0 , 1 };
661+ // WHEN
662+ ObjectArrayAssert <Integer > result = assertThat (value ).asInstanceOf (array (Integer [].class ));
663+ // THEN
664+ result .containsExactly (0 , 1 );
665+ }
666+
644667 @ Test
645668 void array_2d_factory_should_allow_2d_array_assertions () {
646669 // GIVEN
@@ -652,13 +675,13 @@ void array_2d_factory_should_allow_2d_array_assertions() {
652675 }
653676
654677 @ Test
655- void array_typed_factory_should_allow_array_typed_assertions () {
678+ void array_2d_typed_factory_should_allow_2d_array_typed_assertions () {
656679 // GIVEN
657- Object value = new Integer [] { 0 , 1 };
680+ Object value = new Integer [][] { { 0 , 1 }, { 2 , 3 } };
658681 // WHEN
659- ObjectArrayAssert <Integer > result = assertThat (value ).asInstanceOf (array (Integer [].class ));
682+ Object2DArrayAssert <Integer > result = assertThat (value ).asInstanceOf (array2D (Integer [] [].class ));
660683 // THEN
661- result .containsExactly ( 0 , 1 );
684+ result .hasDimensions ( 2 , 2 );
662685 }
663686
664687 @ Test
@@ -1055,7 +1078,7 @@ void string_factory_should_allow_string_assertions() {
10551078 @ Test
10561079 void iterable_factory_should_allow_iterable_assertions () {
10571080 // GIVEN
1058- Object value = list ("Homer" , "Marge" , "Bart" , "Lisa" , "Maggie" );
1081+ Object value = Lists . list ("Homer" , "Marge" , "Bart" , "Lisa" , "Maggie" );
10591082 // WHEN
10601083 IterableAssert <Object > result = assertThat (value ).asInstanceOf (ITERABLE );
10611084 // THEN
@@ -1065,7 +1088,7 @@ void iterable_factory_should_allow_iterable_assertions() {
10651088 @ Test
10661089 void iterable_typed_factory_should_allow_iterable_typed_assertions () {
10671090 // GIVEN
1068- Object value = list ("Homer" , "Marge" , "Bart" , "Lisa" , "Maggie" );
1091+ Object value = Lists . list ("Homer" , "Marge" , "Bart" , "Lisa" , "Maggie" );
10691092 // WHEN
10701093 IterableAssert <String > result = assertThat (value ).asInstanceOf (iterable (String .class ));
10711094 // THEN
@@ -1075,7 +1098,7 @@ void iterable_typed_factory_should_allow_iterable_typed_assertions() {
10751098 @ Test
10761099 void iterator_factory_should_allow_iterator_assertions () {
10771100 // GIVEN
1078- Object value = list ("Homer" , "Marge" , "Bart" , "Lisa" , "Maggie" ).iterator ();
1101+ Object value = Lists . list ("Homer" , "Marge" , "Bart" , "Lisa" , "Maggie" ).iterator ();
10791102 // WHEN
10801103 IteratorAssert <Object > result = assertThat (value ).asInstanceOf (ITERATOR );
10811104 // THEN
@@ -1085,7 +1108,7 @@ void iterator_factory_should_allow_iterator_assertions() {
10851108 @ Test
10861109 void iterator_typed_factory_should_allow_iterator_typed_assertions () {
10871110 // GIVEN
1088- Object value = list ("Homer" , "Marge" , "Bart" , "Lisa" , "Maggie" ).iterator ();
1111+ Object value = Lists . list ("Homer" , "Marge" , "Bart" , "Lisa" , "Maggie" ).iterator ();
10891112 // WHEN
10901113 IteratorAssert <String > result = assertThat (value ).asInstanceOf (iterator (String .class ));
10911114 // THEN
@@ -1095,7 +1118,7 @@ void iterator_typed_factory_should_allow_iterator_typed_assertions() {
10951118 @ Test
10961119 void collection_factory_should_allow_collection_assertions () {
10971120 // GIVEN
1098- Object value = list ("Homer" , "Marge" , "Bart" , "Lisa" , "Maggie" );
1121+ Object value = Lists . list ("Homer" , "Marge" , "Bart" , "Lisa" , "Maggie" );
10991122 // WHEN
11001123 AbstractCollectionAssert <?, Collection <?>, Object , ObjectAssert <Object >> result = assertThat (value ).asInstanceOf (COLLECTION );
11011124 // THEN
@@ -1105,7 +1128,7 @@ void collection_factory_should_allow_collection_assertions() {
11051128 @ Test
11061129 void collection_typed_factory_should_allow_collection_typed_assertions () {
11071130 // GIVEN
1108- Object value = list ("Homer" , "Marge" , "Bart" , "Lisa" , "Maggie" );
1131+ Object value = Lists . list ("Homer" , "Marge" , "Bart" , "Lisa" , "Maggie" );
11091132 // WHEN
11101133 AbstractCollectionAssert <?, Collection <? extends String >, String , ObjectAssert <String >> result = assertThat (value ).asInstanceOf (collection (String .class ));
11111134 // THEN
@@ -1115,7 +1138,7 @@ void collection_typed_factory_should_allow_collection_typed_assertions() {
11151138 @ Test
11161139 void list_factory_should_allow_list_assertions () {
11171140 // GIVEN
1118- Object value = list ("Homer" , "Marge" , "Bart" , "Lisa" , "Maggie" );
1141+ Object value = Lists . list ("Homer" , "Marge" , "Bart" , "Lisa" , "Maggie" );
11191142 // WHEN
11201143 ListAssert <Object > result = assertThat (value ).asInstanceOf (LIST );
11211144 // THEN
@@ -1125,7 +1148,7 @@ void list_factory_should_allow_list_assertions() {
11251148 @ Test
11261149 void list_typed_factory_should_allow_typed_list_assertions () {
11271150 // GIVEN
1128- Object value = list ("Homer" , "Marge" , "Bart" , "Lisa" , "Maggie" );
1151+ Object value = Lists . list ("Homer" , "Marge" , "Bart" , "Lisa" , "Maggie" );
11291152 // WHEN
11301153 ListAssert <String > result = assertThat (value ).asInstanceOf (list (String .class ));
11311154 // THEN
0 commit comments