Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
marcphilipp committed Nov 7, 2015
1 parent fb9c34e commit 60ba523
Showing 1 changed file with 7 additions and 10 deletions.
Expand Up @@ -10,18 +10,19 @@

package org.junit.gen5.junit4runner;

import static java.util.Arrays.stream;
import static java.util.stream.Collectors.toList;

import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Method;
import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

import org.junit.gen5.engine.TestDescriptor;
import org.junit.gen5.engine.TestPlanSpecification;
Expand Down Expand Up @@ -140,23 +141,19 @@ private TestPlanSpecification createSpecification() throws InitializationError {
}
}

private Collection<? extends TestPlanSpecificationElement> getPackagesSpecificationElements()
throws InitializationError {
private Collection<TestPlanSpecificationElement> getPackagesSpecificationElements() throws InitializationError {
String[] packages = getAnnotatedPackages(testClass);
return Arrays.stream(packages).map(uniqueId -> TestPlanSpecification.forPackage(uniqueId)).collect(
Collectors.toList());
return stream(packages).map(TestPlanSpecification::forPackage).collect(toList());
}

private List<TestPlanSpecificationElement> getClassnameSpecificationElements() throws InitializationError {
Class<?>[] testClasses = getAnnotatedClasses(testClass);
return Arrays.stream(testClasses).map(clazz -> TestPlanSpecification.forClassName(clazz.getName())).collect(
Collectors.toList());
return stream(testClasses).map(Class::getName).map(TestPlanSpecification::forClassName).collect(toList());
}

private List<TestPlanSpecificationElement> getUniqueIdSpecificationElements() throws InitializationError {
String[] uniqueIds = getAnnotatedUniqueIds(testClass);
return Arrays.stream(uniqueIds).map(uniqueId -> TestPlanSpecification.forUniqueId(uniqueId)).collect(
Collectors.toList());
return stream(uniqueIds).map(TestPlanSpecification::forUniqueId).collect(toList());
}

private Description generateDescription() {
Expand Down

0 comments on commit 60ba523

Please sign in to comment.