Skip to content

Commit

Permalink
Fix ExtensionComposabilityTests
Browse files Browse the repository at this point in the history
  • Loading branch information
sormuras committed Sep 16, 2018
1 parent 9361d3c commit f5687c6
Showing 1 changed file with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
package org.junit.jupiter.api.extension;

import static java.util.stream.Collectors.toList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertAll;
import static org.junit.jupiter.api.Assertions.assertLinesMatch;

import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
Expand Down Expand Up @@ -64,7 +63,7 @@ void ensureJupiterExtensionApisAreComposable() {

// 3) Dynamically implement all Extension APIs
Object dynamicKitchenSinkExtension = Proxy.newProxyInstance(getClass().getClassLoader(),
extensionApis.toArray(new Class<?>[extensionApis.size()]), (proxy, method, args) -> null);
extensionApis.toArray(new Class<?>[0]), (proxy, method, args) -> null);

// 4) Determine what ended up in the kitchen sink...

Expand Down Expand Up @@ -95,12 +94,8 @@ void ensureJupiterExtensionApisAreComposable() {

// 6) Verify our expectations

// @formatter:off
assertAll(
() -> assertThat(actualMethodSignatures).isEqualTo(expectedMethodSignatures),
() -> assertThat(actualMethodNames).isEqualTo(expectedMethodNames)
);
// @formatter:on
assertLinesMatch(expectedMethodSignatures, actualMethodSignatures);
assertLinesMatch(expectedMethodNames, actualMethodNames);
}

private boolean isExtensionApi(Class<?> candidate) {
Expand Down

0 comments on commit f5687c6

Please sign in to comment.