3232import org .junit .jupiter .api .BeforeEach ;
3333import org .junit .jupiter .api .Test ;
3434import org .mockito .stubbing .Answer ;
35+
3536import org .springframework .context .ApplicationEventPublisher ;
3637import org .springframework .data .annotation .Id ;
3738import org .springframework .data .domain .PageRequest ;
3839import org .springframework .data .domain .Pageable ;
3940import org .springframework .data .domain .Sort ;
40- import org .springframework .data .jdbc .core .convert .*;
41+ import org .springframework .data .jdbc .core .convert .BasicJdbcConverter ;
42+ import org .springframework .data .jdbc .core .convert .BatchJdbcOperations ;
43+ import org .springframework .data .jdbc .core .convert .DefaultDataAccessStrategy ;
44+ import org .springframework .data .jdbc .core .convert .DefaultJdbcTypeFactory ;
45+ import org .springframework .data .jdbc .core .convert .DelegatingDataAccessStrategy ;
46+ import org .springframework .data .jdbc .core .convert .InsertStrategyFactory ;
47+ import org .springframework .data .jdbc .core .convert .JdbcConverter ;
48+ import org .springframework .data .jdbc .core .convert .JdbcCustomConversions ;
49+ import org .springframework .data .jdbc .core .convert .SqlGeneratorSource ;
50+ import org .springframework .data .jdbc .core .convert .SqlParametersFactory ;
4151import org .springframework .data .jdbc .core .mapping .JdbcMappingContext ;
4252import org .springframework .data .jdbc .repository .support .JdbcRepositoryFactory ;
4353import org .springframework .data .jdbc .repository .support .SimpleJdbcRepository ;
7383 * @author Myeonghyeon Lee
7484 * @author Chirag Tailor
7585 */
76- public class SimpleJdbcRepositoryEventsUnitTests {
86+ class SimpleJdbcRepositoryEventsUnitTests {
7787
7888 private static final long generatedId = 4711L ;
7989
80- CollectingEventPublisher publisher = new CollectingEventPublisher ();
90+ private CollectingEventPublisher publisher = new CollectingEventPublisher ();
8191
82- DummyEntityRepository repository ;
83- DefaultDataAccessStrategy dataAccessStrategy ;
92+ private DummyEntityRepository repository ;
93+ private DefaultDataAccessStrategy dataAccessStrategy ;
8494
8595 @ BeforeEach
86- public void before () {
96+ void before () {
8797
8898 RelationalMappingContext context = new JdbcMappingContext ();
8999 NamedParameterJdbcOperations operations = createIdGeneratingOperations ();
90- DelegatingDataAccessStrategy delegatingDataAccessStrategy = new DelegatingDataAccessStrategy ();
100+
91101 Dialect dialect = HsqlDbDialect .INSTANCE ;
102+ DelegatingDataAccessStrategy delegatingDataAccessStrategy = new DelegatingDataAccessStrategy ();
92103 JdbcConverter converter = new BasicJdbcConverter (context , delegatingDataAccessStrategy , new JdbcCustomConversions (),
93104 new DefaultJdbcTypeFactory (operations .getJdbcOperations ()), dialect .getIdentifierProcessing ());
94105 SqlGeneratorSource generatorSource = new SqlGeneratorSource (context , converter , dialect );
@@ -109,7 +120,7 @@ public void before() {
109120
110121 @ Test // DATAJDBC-99
111122 @ SuppressWarnings ("rawtypes" )
112- public void publishesEventsOnSave () {
123+ void publishesEventsOnSave () {
113124
114125 DummyEntity entity = new DummyEntity (23L );
115126
@@ -126,7 +137,7 @@ public void publishesEventsOnSave() {
126137
127138 @ Test // DATAJDBC-99
128139 @ SuppressWarnings ("rawtypes" )
129- public void publishesEventsOnSaveMany () {
140+ void publishesEventsOnSaveMany () {
130141
131142 DummyEntity entity1 = new DummyEntity (null );
132143 DummyEntity entity2 = new DummyEntity (23L );
@@ -146,7 +157,7 @@ public void publishesEventsOnSaveMany() {
146157 }
147158
148159 @ Test // DATAJDBC-99
149- public void publishesEventsOnDelete () {
160+ void publishesEventsOnDelete () {
150161
151162 DummyEntity entity = new DummyEntity (23L );
152163
@@ -173,7 +184,7 @@ private Object getEntity(RelationalEvent e) {
173184
174185 @ Test // DATAJDBC-99
175186 @ SuppressWarnings ("rawtypes" )
176- public void publishesEventsOnDeleteById () {
187+ void publishesEventsOnDeleteById () {
177188
178189 repository .deleteById (23L );
179190
@@ -187,7 +198,7 @@ public void publishesEventsOnDeleteById() {
187198
188199 @ Test // DATAJDBC-197
189200 @ SuppressWarnings ("rawtypes" )
190- public void publishesEventsOnFindAll () {
201+ void publishesEventsOnFindAll () {
191202
192203 DummyEntity entity1 = new DummyEntity (42L );
193204 DummyEntity entity2 = new DummyEntity (23L );
@@ -206,7 +217,7 @@ public void publishesEventsOnFindAll() {
206217
207218 @ Test // DATAJDBC-197
208219 @ SuppressWarnings ("rawtypes" )
209- public void publishesEventsOnFindAllById () {
220+ void publishesEventsOnFindAllById () {
210221
211222 DummyEntity entity1 = new DummyEntity (42L );
212223 DummyEntity entity2 = new DummyEntity (23L );
@@ -225,7 +236,7 @@ public void publishesEventsOnFindAllById() {
225236
226237 @ Test // DATAJDBC-197
227238 @ SuppressWarnings ("rawtypes" )
228- public void publishesEventsOnFindById () {
239+ void publishesEventsOnFindById () {
229240
230241 DummyEntity entity1 = new DummyEntity (23L );
231242
@@ -242,7 +253,7 @@ public void publishesEventsOnFindById() {
242253
243254 @ Test // DATAJDBC-101
244255 @ SuppressWarnings ("rawtypes" )
245- public void publishesEventsOnFindAllSorted () {
256+ void publishesEventsOnFindAllSorted () {
246257
247258 DummyEntity entity1 = new DummyEntity (42L );
248259 DummyEntity entity2 = new DummyEntity (23L );
@@ -261,7 +272,7 @@ public void publishesEventsOnFindAllSorted() {
261272
262273 @ Test // DATAJDBC-101
263274 @ SuppressWarnings ("rawtypes" )
264- public void publishesEventsOnFindAllPaged () {
275+ void publishesEventsOnFindAllPaged () {
265276
266277 DummyEntity entity1 = new DummyEntity (42L );
267278 DummyEntity entity2 = new DummyEntity (23L );
0 commit comments