File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
src/test/java/com/yannbriancon/interceptor Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 11package com .yannbriancon .interceptor ;
22
33import com .yannbriancon .exception .NPlusOneQueriesException ;
4- import com .yannbriancon .utils .entity .Avatar ;
54import com .yannbriancon .utils .entity .Message ;
65import com .yannbriancon .utils .entity .User ;
76import com .yannbriancon .utils .repository .AvatarRepository ;
@@ -78,13 +77,13 @@ void nPlusOneQueriesDetection_throwsExceptionWhenMissingEagerFetchingOnManyToOne
7877 try {
7978 // Test a method that should return a N+1 query
8079 // The query triggers N+1 queries to eager fetch the user field
81- List < Avatar > avatars = avatarRepository .findAll ();
80+ avatarRepository .findAll ();
8281 assert false ;
8382 } catch (NPlusOneQueriesException exception ) {
8483 assertThat (exception .getMessage ())
85- .contains ("N+1 queries detected with eager fetching on the query \n " +
84+ .contains ("N+1 queries detected with eager fetching on the entity com.yannbriancon.utils.entity.User \n " +
8685 " at com.yannbriancon.interceptor.NPlusOneQueriesExceptionTest" +
87- ".hibernateQueryInterceptor_isDetectingNPlusOneQueriesWhenMissingEagerFetchingOnManyToOne " );
86+ ".nPlusOneQueriesDetection_throwsExceptionWhenMissingEagerFetchingOnManyToOne " );
8887 }
8988 }
9089
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ void hibernateQueryInterceptor_isDetectingNPlusOneQueriesWhenMissingLazyFetching
8080
8181 LoggingEvent loggingEvent = loggingEventCaptor .getAllValues ().get (0 );
8282 assertThat (loggingEvent .getMessage ())
83- .contains ("N+1 queries detected with eager fetching on the query \n " +
83+ .contains ("N+1 queries detected with eager fetching on the entity com.yannbriancon.utils.entity.Message \n " +
8484 " at com.yannbriancon.interceptor.NPlusOneQueriesLoggingTest." +
8585 "hibernateQueryInterceptor_isDetectingNPlusOneQueriesWhenMissingLazyFetchingOnEntityField" );
8686 assertThat (Level .ERROR ).isEqualTo (loggingEvent .getLevel ());
You can’t perform that action at this time.
0 commit comments