Actual:
Unable to locate Attribute with the the given name [invalidFieldName] on this ManagedType [com.github.mhewedy.expressions.Auditable]
Expected:
Unable to locate Attribute with the the given name [invalidFieldName] on this ManagedType [com.github.mhewedy.expressions.Employee]
full stack trace:
2021-04-23 04:47:06.553 INFO 42381 --- [ main] o.s.t.c.transaction.TransactionContext : Rolled back transaction for test: [DefaultTestContext@524d6d96 testClass = ExpressionsRepositoryImplTest, testInstance = com.github.mhewedy.expressions.ExpressionsRepositoryImplTest@11bd0f3b, testMethod = testInvalidFieldName@ExpressionsRepositoryImplTest, testException = java.lang.AssertionError:
Expecting:
<"Unable to locate Attribute with the the given name [invalidFieldName] on this ManagedType [com.github.mhewedy.expressions.Auditable]; nested exception is java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [invalidFieldName] on this ManagedType [com.github.mhewedy.expressions.Auditable]">
to contain:
<"ManagedType [com.github.mhewedy.expressions.Employee]"> , mergedContextConfiguration = [MergedContextConfiguration@152aa092 testClass = ExpressionsRepositoryImplTest, locations = '{}', classes = '{class org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration, class org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper=true}', contextCustomizers = set[[ImportsContextCustomizer@44a7bfbc key = [@org.springframework.boot.test.autoconfigure.orm.jpa.AutoConfigureDataJpa(), @org.springframework.boot.test.autoconfigure.orm.jpa.AutoConfigureTestEntityManager(), @org.springframework.data.jpa.repository.config.EnableJpaRepositories(repositoryBaseClass=class com.github.mhewedy.expressions.ExpressionsRepositoryImpl, enableDefaultTransactions=true, excludeFilters=[], basePackageClasses=[], escapeCharacter=\, includeFilters=[], bootstrapMode=DEFAULT, repositoryFactoryBeanClass=class org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean, queryLookupStrategy=CREATE_IF_NOT_FOUND, entityManagerFactoryRef=entityManagerFactory, namedQueriesLocation=, transactionManagerRef=transactionManager, basePackages=[com.github.mhewedy.expressions], repositoryImplementationPostfix=Impl, considerNestedRepositories=false, value=[]), @org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase(replace=ANY, connection=NONE), @org.apiguardian.api.API(consumers=[*], since=5.0, status=STABLE), @org.springframework.boot.test.autoconfigure.core.AutoConfigureCache(cacheProvider=NONE), @org.springframework.boot.autoconfigure.domain.EntityScan(basePackages=[], value=[com.github.mhewedy.expressions], basePackageClasses=[]), @org.springframework.boot.test.autoconfigure.filter.TypeExcludeFilters(value=[class org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTypeExcludeFilter]), @org.springframework.context.annotation.Import(value=[class org.springframework.boot.autoconfigure.ImportAutoConfigurationImportSelector]), @org.springframework.test.context.ContextConfiguration(inheritInitializers=true, initializers=[], loader=interface org.springframework.test.context.ContextLoader, classes=[class org.springframework.boot.autoconfigure.data.jpa.JpaRepositoriesAutoConfiguration, class org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration], name=, locations=[], value=[], inheritLocations=true), @org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase(replace=ANY, connection=H2), @org.springframework.transaction.annotation.Transactional(propagation=REQUIRED, rollbackForClassName=[], transactionManager=, isolation=DEFAULT, timeoutString=, readOnly=false, label=[], noRollbackFor=[], noRollbackForClassName=[], value=, timeout=-1, rollbackFor=[]), @org.springframework.boot.autoconfigure.ImportAutoConfiguration(value=[], exclude=[], classes=[]), @org.junit.jupiter.api.extension.ExtendWith(value=[class org.springframework.test.context.junit.jupiter.SpringExtension]), @org.springframework.context.annotation.Import(value=[class org.springframework.boot.autoconfigure.domain.EntityScanPackages$Registrar]), @org.springframework.test.context.BootstrapWith(value=class org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTestContextBootstrapper), @org.springframework.boot.test.autoconfigure.OverrideAutoConfiguration(enabled=false), @org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest(bootstrapMode=DEFAULT, useDefaultFilters=true, excludeFilters=[], showSql=true, excludeAutoConfiguration=[], includeFilters=[], properties=[]), @org.springframework.boot.test.autoconfigure.properties.PropertyMapping(value=spring.test.database, skip=NO), @org.springframework.context.annotation.Import(value=[class org.springframework.data.jpa.repository.config.JpaRepositoriesRegistrar])]], org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@175c2241, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@776aec5c, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.autoconfigure.OverrideAutoConfigurationContextCustomizerFactory$DisableAutoConfigurationContextCustomizer@4c12331b, org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory$DisableMetricExportContextCustomizer@1573f9fc, org.springframework.boot.test.autoconfigure.filter.TypeExcludeFiltersContextCustomizer@351584c0, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@d646b630, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@489115ef, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@0], contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.event.ApplicationEventsTestExecutionListener.recordApplicationEvents' -> false]]
java.lang.AssertionError:
Expecting:
<"Unable to locate Attribute with the the given name [invalidFieldName] on this ManagedType [com.github.mhewedy.expressions.Auditable]; nested exception is java.lang.IllegalArgumentException: Unable to locate Attribute with the the given name [invalidFieldName] on this ManagedType [com.github.mhewedy.expressions.Auditable]">
to contain:
<"ManagedType [com.github.mhewedy.expressions.Employee]">
at com.github.mhewedy.expressions.ExpressionsRepositoryImplTest.testInvalidFieldName(ExpressionsRepositoryImplTest.java:277)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
enhancement