@@ -101,7 +101,8 @@ void canOnlyUsePublicConstructor() {
101101 .withMessageContaining ("Cannot create instance of class" )
102102 .havingCause ()
103103 .isInstanceOf (SpecimenException .class )
104- .withMessage ("No public constructor found" );
104+ .withMessage ("No public constructor found" )
105+ .withNoCause ();
105106 }
106107
107108 @ Test
@@ -132,7 +133,12 @@ void passExceptionToFallbackWhenConstructorThrows() {
132133 assertThatExceptionOfType (SpecimenException .class )
133134 .isThrownBy (() -> sut .construct (new SpecimenType <ConstructorExceptionAndNoFactoryMethod >() {}, new CustomizationContext (List .of (), Map .of (), false )))
134135 .withMessageContaining ("Cannot create instance of class" )
135- .withCauseInstanceOf (InvocationTargetException .class );
136+ .havingCause ()
137+ .isInstanceOf (InvocationTargetException .class )
138+ .havingCause ()
139+ .isInstanceOf (IllegalArgumentException .class )
140+ .withMessage ("expected for tests" )
141+ .withNoCause ();
136142 }
137143
138144 @ Test
@@ -248,7 +254,9 @@ void shouldFailWithoutValidFactoryMethod() {
248254 var sut = new InstanceFactory (new SpecimenFactory (new Context (Configuration .configure ())));
249255
250256 assertThatExceptionOfType (SpecimenException .class )
251- .isThrownBy (() -> sut .manufacture (fromClass (FactoryMethodWithOnlyItselfAsArgument .class ), noContext (), null ));
257+ .isThrownBy (() -> sut .manufacture (fromClass (FactoryMethodWithOnlyItselfAsArgument .class ), noContext (), null ))
258+ .withMessage ("Cannot create instance of class com.github.nylle.javafixture.testobjects.factorymethod.FactoryMethodWithOnlyItselfAsArgument: no factory-method found" )
259+ .withNoCause ();
252260
253261 }
254262
@@ -305,8 +313,9 @@ void arrayListFromCollectionInterface() {
305313
306314 var actual = sut .createCollection (new SpecimenType <Collection <String >>() {});
307315
308- assertThat (actual ).isInstanceOf (ArrayList .class );
309- assertThat (actual ).isEmpty ();
316+ assertThat (actual )
317+ .isInstanceOf (ArrayList .class )
318+ .isEmpty ();
310319 }
311320
312321 @ Test
@@ -315,8 +324,9 @@ void arrayListFromListInterface() {
315324
316325 var actual = sut .createCollection (new SpecimenType <List <String >>() {});
317326
318- assertThat (actual ).isInstanceOf (ArrayList .class );
319- assertThat (actual ).isEmpty ();
327+ assertThat (actual )
328+ .isInstanceOf (ArrayList .class )
329+ .isEmpty ();
320330 }
321331
322332 @ Test
@@ -325,8 +335,9 @@ void treeSetFromNavigableSetInterface() {
325335
326336 var actual = sut .createCollection (new SpecimenType <NavigableSet <String >>() {});
327337
328- assertThat (actual ).isInstanceOf (TreeSet .class );
329- assertThat (actual ).isEmpty ();
338+ assertThat (actual )
339+ .isInstanceOf (TreeSet .class )
340+ .isEmpty ();
330341 }
331342
332343 @ Test
@@ -335,8 +346,9 @@ void treeSetFromSortedSetInterface() {
335346
336347 var actual = sut .createCollection (new SpecimenType <SortedSet <String >>() {});
337348
338- assertThat (actual ).isInstanceOf (TreeSet .class );
339- assertThat (actual ).isEmpty ();
349+ assertThat (actual )
350+ .isInstanceOf (TreeSet .class )
351+ .isEmpty ();
340352 }
341353
342354 @ Test
@@ -345,8 +357,9 @@ void hashSetFromSetInterface() {
345357
346358 var actual = sut .createCollection (new SpecimenType <Set <String >>() {});
347359
348- assertThat (actual ).isInstanceOf (HashSet .class );
349- assertThat (actual ).isEmpty ();
360+ assertThat (actual )
361+ .isInstanceOf (HashSet .class )
362+ .isEmpty ();
350363 }
351364
352365 @ Test
@@ -355,8 +368,9 @@ void linkedBlockingDequeFromBlockingDequeInterface() {
355368
356369 var actual = sut .createCollection (new SpecimenType <BlockingDeque <String >>() {});
357370
358- assertThat (actual ).isInstanceOf (LinkedBlockingDeque .class );
359- assertThat (actual ).isEmpty ();
371+ assertThat (actual )
372+ .isInstanceOf (LinkedBlockingDeque .class )
373+ .isEmpty ();
360374 }
361375
362376 @ Test
@@ -365,8 +379,9 @@ void arrayDequeFromDequeInterface() {
365379
366380 var actual = sut .createCollection (new SpecimenType <Deque <String >>() {});
367381
368- assertThat (actual ).isInstanceOf (ArrayDeque .class );
369- assertThat (actual ).isEmpty ();
382+ assertThat (actual )
383+ .isInstanceOf (ArrayDeque .class )
384+ .isEmpty ();
370385 }
371386
372387 @ Test
@@ -375,8 +390,9 @@ void linkedTransferQueueFromTransferQueueInterface() {
375390
376391 var actual = sut .createCollection (new SpecimenType <TransferQueue <String >>() {});
377392
378- assertThat (actual ).isInstanceOf (LinkedTransferQueue .class );
379- assertThat (actual ).isEmpty ();
393+ assertThat (actual )
394+ .isInstanceOf (LinkedTransferQueue .class )
395+ .isEmpty ();
380396 }
381397
382398 @ Test
@@ -385,8 +401,9 @@ void linkedBlockingQueueFromBlockingQueueInterface() {
385401
386402 var actual = sut .createCollection (new SpecimenType <BlockingQueue <String >>() {});
387403
388- assertThat (actual ).isInstanceOf (LinkedBlockingQueue .class );
389- assertThat (actual ).isEmpty ();
404+ assertThat (actual )
405+ .isInstanceOf (LinkedBlockingQueue .class )
406+ .isEmpty ();
390407 }
391408
392409 @ Test
@@ -395,8 +412,9 @@ void linkedListFromQueueInterface() {
395412
396413 var actual = sut .createCollection (new SpecimenType <Queue <String >>() {});
397414
398- assertThat (actual ).isInstanceOf (LinkedList .class );
399- assertThat (actual ).isEmpty ();
415+ assertThat (actual )
416+ .isInstanceOf (LinkedList .class )
417+ .isEmpty ();
400418 }
401419
402420 @ Test
@@ -405,8 +423,9 @@ void arrayList() {
405423
406424 var actual = sut .createCollection (new SpecimenType <ArrayList <String >>() {});
407425
408- assertThat (actual ).isInstanceOf (ArrayList .class );
409- assertThat (actual ).isEmpty ();
426+ assertThat (actual )
427+ .isInstanceOf (ArrayList .class )
428+ .isEmpty ();
410429 }
411430
412431 @ Test
@@ -415,8 +434,9 @@ void treeSet() {
415434
416435 var actual = sut .createCollection (new SpecimenType <TreeSet <String >>() {});
417436
418- assertThat (actual ).isInstanceOf (TreeSet .class );
419- assertThat (actual ).isEmpty ();
437+ assertThat (actual )
438+ .isInstanceOf (TreeSet .class )
439+ .isEmpty ();
420440 }
421441
422442 @ Test
@@ -425,8 +445,9 @@ void hashSet() {
425445
426446 var actual = sut .createCollection (new SpecimenType <HashSet <String >>() {});
427447
428- assertThat (actual ).isInstanceOf (HashSet .class );
429- assertThat (actual ).isEmpty ();
448+ assertThat (actual )
449+ .isInstanceOf (HashSet .class )
450+ .isEmpty ();
430451 }
431452
432453 @ Test
@@ -435,8 +456,9 @@ void linkedBlockingDeque() {
435456
436457 var actual = sut .createCollection (new SpecimenType <LinkedBlockingDeque <String >>() {});
437458
438- assertThat (actual ).isInstanceOf (LinkedBlockingDeque .class );
439- assertThat (actual ).isEmpty ();
459+ assertThat (actual )
460+ .isInstanceOf (LinkedBlockingDeque .class )
461+ .isEmpty ();
440462 }
441463
442464 @ Test
@@ -445,8 +467,9 @@ void arrayDeque() {
445467
446468 var actual = sut .createCollection (new SpecimenType <ArrayDeque <String >>() {});
447469
448- assertThat (actual ).isInstanceOf (ArrayDeque .class );
449- assertThat (actual ).isEmpty ();
470+ assertThat (actual )
471+ .isInstanceOf (ArrayDeque .class )
472+ .isEmpty ();
450473 }
451474
452475 @ Test
@@ -455,8 +478,9 @@ void linkedTransferQueue() {
455478
456479 var actual = sut .createCollection (new SpecimenType <LinkedTransferQueue <String >>() {});
457480
458- assertThat (actual ).isInstanceOf (LinkedTransferQueue .class );
459- assertThat (actual ).isEmpty ();
481+ assertThat (actual )
482+ .isInstanceOf (LinkedTransferQueue .class )
483+ .isEmpty ();
460484 }
461485
462486 @ Test
@@ -465,8 +489,9 @@ void linkedBlockingQueue() {
465489
466490 var actual = sut .createCollection (new SpecimenType <LinkedBlockingQueue <String >>() {});
467491
468- assertThat (actual ).isInstanceOf (LinkedBlockingQueue .class );
469- assertThat (actual ).isEmpty ();
492+ assertThat (actual )
493+ .isInstanceOf (LinkedBlockingQueue .class )
494+ .isEmpty ();
470495 }
471496
472497 @ Test
@@ -475,8 +500,9 @@ void linkedList() {
475500
476501 var actual = sut .createCollection (new SpecimenType <LinkedList <String >>() {});
477502
478- assertThat (actual ).isInstanceOf (LinkedList .class );
479- assertThat (actual ).isEmpty ();
503+ assertThat (actual )
504+ .isInstanceOf (LinkedList .class )
505+ .isEmpty ();
480506 }
481507 }
482508
0 commit comments