Skip to content

Commit

Permalink
Remove checks for unsupported Java version from unit tests (#3150)
Browse files Browse the repository at this point in the history
  • Loading branch information
valfirst committed Oct 18, 2023
1 parent e736992 commit 73d6afc
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,10 @@
*/
package org.mockito.internal.creation.bytebuddy;

import static net.bytebuddy.ClassFileVersion.JAVA_V11;
import static net.bytebuddy.ClassFileVersion.JAVA_V8;
import static net.bytebuddy.matcher.ElementMatchers.named;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.fail;
import static org.junit.Assert.*;
import static org.junit.Assume.assumeTrue;

import java.io.IOException;
import java.util.*;
Expand All @@ -19,7 +16,6 @@
import java.util.stream.Collectors;

import net.bytebuddy.ByteBuddy;
import net.bytebuddy.ClassFileVersion;
import net.bytebuddy.description.modifier.Visibility;
import net.bytebuddy.description.type.TypeDescription;
import net.bytebuddy.implementation.FixedValue;
Expand Down Expand Up @@ -443,8 +439,6 @@ public void is_type_mockable_give_allow_final_mockable_from_JDK() {

@Test
public void test_parameters_retention() throws Exception {
assumeTrue(ClassFileVersion.ofThisVm().isAtLeast(JAVA_V8));

Class<?> typeWithParameters =
new ByteBuddy()
.subclass(Object.class)
Expand Down Expand Up @@ -473,8 +467,6 @@ public void test_parameters_retention() throws Exception {

@Test
public void test_constant_dynamic_compatibility() throws Exception {
assumeTrue(ClassFileVersion.ofThisVm().isAtLeast(JAVA_V11));

Class<?> typeWithCondy =
new ByteBuddy()
.subclass(Callable.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package org.mockitousage.basicapi;

import static org.junit.Assert.*;
import static org.junit.Assume.assumeTrue;
import static org.mockito.Mockito.*;
import static org.mockitoutil.SimpleSerializationUtil.*;

Expand All @@ -16,7 +15,6 @@
import java.util.List;
import java.util.Observable;

import net.bytebuddy.ClassFileVersion;
import org.assertj.core.api.Assertions;
import org.junit.Test;
import org.mockito.InOrder;
Expand Down Expand Up @@ -396,8 +394,6 @@ public void private_constructor_currently_not_supported_at_the_moment_at_deseria

@Test
public void BUG_ISSUE_399_try_some_mocks_with_current_answers() throws Exception {
assumeTrue(ClassFileVersion.ofThisVm().isAtLeast(ClassFileVersion.JAVA_V7));

IMethods iMethods =
mock(
IMethods.class,
Expand Down
10 changes: 0 additions & 10 deletions src/test/java/org/mockitousage/spies/SpyingOnInterfacesTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
package org.mockitousage.spies;

import static org.junit.Assert.fail;
import static org.junit.Assume.assumeTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
Expand All @@ -14,7 +13,6 @@
import java.util.List;

import net.bytebuddy.ByteBuddy;
import net.bytebuddy.ClassFileVersion;
import net.bytebuddy.description.modifier.Visibility;
import net.bytebuddy.dynamic.loading.ClassLoadingStrategy;
import net.bytebuddy.implementation.FixedValue;
Expand Down Expand Up @@ -62,10 +60,6 @@ public Object answer(InvocationOnMock invocation) throws Throwable {

@Test
public void shouldAllowDelegatingToDefaultMethod() throws Exception {
assumeTrue(
"Test can only be executed on Java 8 capable VMs",
ClassFileVersion.ofThisVm().isAtLeast(ClassFileVersion.JAVA_V8));

Class<?> type =
new ByteBuddy()
.makeInterface()
Expand All @@ -86,10 +80,6 @@ public void shouldAllowDelegatingToDefaultMethod() throws Exception {

@Test
public void shouldAllowSpyingOnDefaultMethod() throws Exception {
assumeTrue(
"Test can only be executed on Java 8 capable VMs",
ClassFileVersion.ofThisVm().isAtLeast(ClassFileVersion.JAVA_V8));

Class<?> iFace =
new ByteBuddy()
.makeInterface()
Expand Down

0 comments on commit 73d6afc

Please sign in to comment.