Migrate code to Java 17 style.
Use var instead of explicit local types where applicable. Use pattern variable instead instanceof and cast. Prefer loops and nullable types over Stream and Optional. Convert classes to records where applicable. See #2465
This commit is contained in:
committed by
Jens Schauder
parent
d4036ec0a9
commit
c735b58607
@@ -17,9 +17,8 @@ package org.springframework.data.annotation;
|
||||
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import org.springframework.data.util.AnnotatedTypeScanner;
|
||||
|
||||
/**
|
||||
@@ -33,8 +32,8 @@ class TypeAliasUnitTests {
|
||||
@SuppressWarnings("unchecked")
|
||||
void scanningforAtPersistentFindsTypeAliasAnnotatedTypes() {
|
||||
|
||||
AnnotatedTypeScanner scanner = new AnnotatedTypeScanner(Persistent.class);
|
||||
Set<Class<?>> types = scanner.findTypes(getClass().getPackage().getName());
|
||||
var scanner = new AnnotatedTypeScanner(Persistent.class);
|
||||
var types = scanner.findTypes(getClass().getPackage().getName());
|
||||
|
||||
assertThat(types).containsExactlyInAnyOrder(SampleType.class, TypeAlias.class);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user