JAVA-27338: Fix VehicleUnitTest
This commit is contained in:
parent
df734f467b
commit
58db4f7a09
|
@ -18,19 +18,19 @@ public class VehicleUnitTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenCar_whenUsingReflectionAPI_thenSuperClassIsSealed() {
|
public void givenCar_whenUsingReflectionAPI_thenSuperClassIsSealed() throws ClassNotFoundException {
|
||||||
Assertions.assertThat(car.getClass().isSealed()).isEqualTo(false);
|
Assertions.assertThat(car.getClass().isSealed()).isEqualTo(false);
|
||||||
Assertions.assertThat(car.getClass().getSuperclass().isSealed()).isEqualTo(true);
|
Assertions.assertThat(car.getClass().getSuperclass().isSealed()).isEqualTo(true);
|
||||||
Assertions.assertThat(car.getClass().getSuperclass().getPermittedSubclasses())
|
Assertions.assertThat(car.getClass().getSuperclass().getPermittedSubclasses())
|
||||||
.contains(ClassDesc.of(car.getClass().getCanonicalName()));
|
.contains(Class.forName(car.getClass().getCanonicalName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenTruck_whenUsingReflectionAPI_thenSuperClassIsSealed() {
|
public void givenTruck_whenUsingReflectionAPI_thenSuperClassIsSealed() throws ClassNotFoundException {
|
||||||
Assertions.assertThat(truck.getClass().isSealed()).isEqualTo(false);
|
Assertions.assertThat(truck.getClass().isSealed()).isEqualTo(false);
|
||||||
Assertions.assertThat(truck.getClass().getSuperclass().isSealed()).isEqualTo(true);
|
Assertions.assertThat(truck.getClass().getSuperclass().isSealed()).isEqualTo(true);
|
||||||
Assertions.assertThat(truck.getClass().getSuperclass().getPermittedSubclasses())
|
Assertions.assertThat(truck.getClass().getSuperclass().getPermittedSubclasses())
|
||||||
.contains(ClassDesc.of(truck.getClass().getCanonicalName()));
|
.contains(Class.forName(truck.getClass().getCanonicalName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -18,19 +18,19 @@ public class VehicleUnitTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenCar_whenUsingReflectionAPI_thenInterfaceIsSealed() {
|
public void givenCar_whenUsingReflectionAPI_thenInterfaceIsSealed() throws ClassNotFoundException {
|
||||||
Assertions.assertThat(car.getClass().isSealed()).isEqualTo(false);
|
Assertions.assertThat(car.getClass().isSealed()).isEqualTo(false);
|
||||||
Assertions.assertThat(car.getClass().getInterfaces()[0].isSealed()).isEqualTo(true);
|
Assertions.assertThat(car.getClass().getInterfaces()[0].isSealed()).isEqualTo(true);
|
||||||
Assertions.assertThat(car.getClass().getInterfaces()[0].permittedSubclasses())
|
Assertions.assertThat(car.getClass().getInterfaces()[0].getPermittedSubclasses())
|
||||||
.contains(ClassDesc.of(car.getClass().getCanonicalName()));
|
.contains(Class.forName(car.getClass().getCanonicalName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void givenTruck_whenUsingReflectionAPI_thenInterfaceIsSealed() {
|
public void givenTruck_whenUsingReflectionAPI_thenInterfaceIsSealed() throws ClassNotFoundException {
|
||||||
Assertions.assertThat(truck.getClass().isSealed()).isEqualTo(false);
|
Assertions.assertThat(truck.getClass().isSealed()).isEqualTo(false);
|
||||||
Assertions.assertThat(truck.getClass().getInterfaces()[0].isSealed()).isEqualTo(true);
|
Assertions.assertThat(truck.getClass().getInterfaces()[0].isSealed()).isEqualTo(true);
|
||||||
Assertions.assertThat(truck.getClass().getInterfaces()[0].permittedSubclasses())
|
Assertions.assertThat(truck.getClass().getInterfaces()[0].getPermittedSubclasses())
|
||||||
.contains(ClassDesc.of(truck.getClass().getCanonicalName()));
|
.contains(Class.forName(truck.getClass().getCanonicalName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
Loading…
Reference in New Issue