18
18
import org .hibernate .testing .orm .junit .ServiceRegistryScope ;
19
19
import org .junit .jupiter .api .Test ;
20
20
21
+
21
22
import jakarta .persistence .Transient ;
22
23
23
24
import static org .assertj .core .api .Assertions .assertThat ;
@@ -44,13 +45,13 @@ void testSourceModel(ServiceRegistryScope registryScope) {
44
45
final ClassDetailsRegistry classDetailsRegistry = sourceModelBuildingContext .getClassDetailsRegistry ();
45
46
final ClassDetails classDetails = classDetailsRegistry .getClassDetails ( Thing .class .getName () );
46
47
47
- // NOTE : `#createBuildingContext` applies `XmlProcessor`, so `@Transient` handling is applied...
48
+ // NOTE : `#createBuildingContext` applies `XmlProcessor`
48
49
49
50
assertThat ( classDetails .getFields () ).hasSize ( 3 );
50
51
classDetails .forEachField ( (i , fieldDetails ) -> {
51
52
assertThat ( fieldDetails .isPersistable () ).isTrue ();
52
- final boolean expectTransient = fieldDetails .getName (). equals ( "somethingElse" );
53
- assertThat ( fieldDetails . hasDirectAnnotationUsage ( Transient . class ) ). isEqualTo ( expectTransient );
53
+ assertThat ( fieldDetails .hasDirectAnnotationUsage ( Transient . class ) ). isFalse ( );
54
+
54
55
} );
55
56
}
56
57
@@ -60,6 +61,6 @@ void testSourceModel(ServiceRegistryScope registryScope) {
60
61
public void testBootModel (DomainModelScope domainModelScope ) {
61
62
final PersistentClass entityBinding = domainModelScope .getEntityBinding ( Thing .class );
62
63
assertThat ( entityBinding .getIdentifierProperty ().getName () ).isEqualTo ( "id" );
63
- assertThat ( entityBinding .getProperties ().stream ().map ( Property ::getName ) ).containsOnly ( "name" );
64
+ assertThat ( entityBinding .getProperties ().stream ().map ( Property ::getName ) ).contains ( "name" ). contains ( "somethingElse " );
64
65
}
65
66
}
0 commit comments