Skip to content

Commit

Permalink
Fix warnings in the junit module
Browse files Browse the repository at this point in the history
This PR removes unused dependencies and fix a couple of warnings in the `junit` module.
  • Loading branch information
MGaetan89 authored and hoisie committed Nov 18, 2024
1 parent 2630fe4 commit 8a56830
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
3 changes: 0 additions & 3 deletions junit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,8 @@ plugins {
}

dependencies {
api(project(":annotations"))
api(project(":sandbox"))
api(project(":pluginapi"))
api(project(":shadowapi"))
api(project(":utils:reflector"))

compileOnly(libs.findbugs.jsr305)
compileOnly(libs.junit4)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ protected Class<?>[] getExtraShadows(FrameworkMethod method) {
List<Class<?>> shadowClasses = new ArrayList<>();
addShadows(shadowClasses, getTestClass().getJavaClass().getAnnotation(SandboxConfig.class));
addShadows(shadowClasses, method.getAnnotation(SandboxConfig.class));
return shadowClasses.toArray(new Class[shadowClasses.size()]);
return shadowClasses.toArray(new Class[0]);
}

private void addShadows(List<Class<?>> shadowClasses, SandboxConfig annotation) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import java.util.Map;
import java.util.Objects;
import java.util.stream.IntStream;
import javax.annotation.Nonnull;
import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.InitializationError;
import org.junit.runners.model.Statement;
Expand Down Expand Up @@ -52,6 +53,7 @@ protected void validateTestMethods(List<Throwable> errors) {
}

@Override
@Nonnull
protected InstrumentationConfiguration createClassLoaderConfig(FrameworkMethod method) {
return new InstrumentationConfiguration.Builder(super.createClassLoaderConfig(method))
.doNotAcquireClass(DelegateTestRunner.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public SingleSdkRobolectricTestRunner(Class<?> testClass, Injector injector)
}

@Override
@Nonnull
protected AndroidSandbox getSandbox(FrameworkMethod method) {
AndroidSandbox sandbox = super.getSandbox(method);
latestSandbox = sandbox;
Expand Down

0 comments on commit 8a56830

Please sign in to comment.