@@ -85,7 +85,7 @@ public class ReportPortalListener implements ShutdownListener, RunnerWatcher, Ru
8585 private static final String IS_THEORY = "IS_THEORY" ;
8686 public static final String DESCRIPTION_TEST_ERROR_FORMAT = "%s\n Error: \n %s" ;
8787 private Throwable testThrowable ;
88- private static final Map <Class <? extends Annotation >, ItemType > TYPE_MAP = Collections .unmodifiableMap (new HashMap <Class <? extends Annotation >, ItemType >() {
88+ private static final Map <Class <? extends Annotation >, ItemType > TYPE_MAP = Collections .unmodifiableMap (new HashMap <>() {
8989 private static final long serialVersionUID = 5292344734560662610L ;
9090
9191 {
@@ -360,7 +360,7 @@ protected Instant getDateForChild(@Nullable final TestItemTree.TestItemLeaf pare
360360 */
361361 protected void startTest (@ Nonnull final AtomicTest testContext ) {
362362 FrameworkMethod method = testContext .getIdentity ();
363- if (! ofNullable (method .getAnnotation (Theory .class )).isPresent ()) {
363+ if (ofNullable (method .getAnnotation (Theory .class )).isEmpty ()) {
364364 context .setTestStatus (createItemTreeKey (method , getStepParameters (testContext )), ItemStatus .PASSED );
365365 }
366366 context .setTestMethodDescription (method , testContext .getDescription ());
@@ -574,7 +574,7 @@ protected void stopTestMethod(@Nonnull final Object runner, @Nonnull final Frame
574574 @ Nonnull final ReflectiveCallable callable , @ Nonnull final FinishTestItemRQ rq ) {
575575 ofNullable (getLeaf (runner , method , callable )).ifPresent (l -> {
576576 ItemStatus status = ItemStatus .valueOf (rq .getStatus ());
577- if (! ofNullable (method .getAnnotation (Theory .class )).isPresent ()) {
577+ if (ofNullable (method .getAnnotation (Theory .class )).isEmpty ()) {
578578 l .setStatus (status );
579579 stopTestMethod (l , method , rq );
580580 }
@@ -1085,11 +1085,11 @@ private Set<ItemAttributesRQ> getAttributes(@Nonnull final AnnotatedElement anno
10851085 */
10861086 @ Nonnull
10871087 protected Set <ItemAttributesRQ > getAttributes (@ Nonnull final TestClass testClass ) {
1088- Stream <ItemAttributesRQ > categories = ofNullable (testClass .getAnnotation (Category .class )).map ( a -> Arrays . stream (a . value () )
1089- .map (c -> new ItemAttributesRQ (null , c .getSimpleName ()))). orElse ( Stream . empty ( ));
1088+ Stream <ItemAttributesRQ > categories = ofNullable (testClass .getAnnotation (Category .class )).stream ()
1089+ .flatMap ( a -> Arrays . stream ( a . value ()). map (c -> new ItemAttributesRQ (null , c .getSimpleName ())));
10901090 Stream <ItemAttributesRQ > attributes = ofNullable (testClass .getJavaClass ()).map (this ::getAttributes )
1091- .map ( Set :: stream )
1092- .orElse ( Stream . empty () );
1091+ .stream ( )
1092+ .flatMap ( Collection :: stream );
10931093 return Stream .concat (categories , attributes ).collect (Collectors .toSet ());
10941094 }
10951095
@@ -1101,8 +1101,8 @@ protected Set<ItemAttributesRQ> getAttributes(@Nonnull final TestClass testClass
11011101 */
11021102 @ Nonnull
11031103 protected Set <ItemAttributesRQ > getAttributes (@ Nonnull final FrameworkMethod frameworkMethod ) {
1104- Stream <ItemAttributesRQ > categories = ofNullable (frameworkMethod .getAnnotation (Category .class )).map ( a -> Arrays . stream (a . value () )
1105- .map (c -> new ItemAttributesRQ (null , c .getSimpleName ()))). orElse ( Stream . empty ( ));
1104+ Stream <ItemAttributesRQ > categories = ofNullable (frameworkMethod .getAnnotation (Category .class )).stream ()
1105+ .flatMap ( a -> Arrays . stream ( a . value ()). map (c -> new ItemAttributesRQ (null , c .getSimpleName ())));
11061106 Stream <ItemAttributesRQ > attributes = ofNullable (frameworkMethod .getMethod ()).map (this ::getAttributes )
11071107 .orElse (Collections .emptySet ())
11081108 .stream ();
0 commit comments