15
15
*/
16
16
package org .springframework .data .jdbc .core .convert ;
17
17
18
- import static org .assertj .core .api .Assertions .*;
19
- import static org .mockito .ArgumentMatchers .*;
20
- import static org .mockito .Mockito .*;
18
+ import static org .assertj .core .api .Assertions .assertThat ;
19
+ import static org .mockito .ArgumentMatchers .anyString ;
21
20
import static org .mockito .Mockito .any ;
21
+ import static org .mockito .Mockito .mock ;
22
+ import static org .mockito .Mockito .when ;
22
23
23
24
import java .util .UUID ;
24
25
27
28
import org .mockito .Mock ;
28
29
import org .mockito .junit .jupiter .MockitoSettings ;
29
30
import org .mockito .quality .Strictness ;
30
-
31
31
import org .springframework .data .annotation .Id ;
32
+ import org .springframework .data .jdbc .core .dialect .JdbcMySqlDialect ;
33
+ import org .springframework .data .jdbc .core .dialect .JdbcPostgresDialect ;
32
34
import org .springframework .data .mapping .model .SimpleTypeHolder ;
33
35
import org .springframework .data .relational .core .conversion .MutableAggregateChange ;
34
- import org .springframework .data .relational .core .dialect .MySqlDialect ;
35
- import org .springframework .data .relational .core .dialect .PostgresDialect ;
36
36
import org .springframework .data .relational .core .mapping .RelationalMappingContext ;
37
37
import org .springframework .data .relational .core .mapping .Sequence ;
38
38
import org .springframework .data .relational .core .mapping .Table ;
@@ -56,7 +56,7 @@ class IdGeneratingEntityCallbackTest {
56
56
void setUp () {
57
57
58
58
relationalMappingContext = new RelationalMappingContext ();
59
- relationalMappingContext .setSimpleTypeHolder (new SimpleTypeHolder (PostgresDialect .INSTANCE .simpleTypes (), true ));
59
+ relationalMappingContext .setSimpleTypeHolder (new SimpleTypeHolder (JdbcPostgresDialect .INSTANCE .simpleTypes (), true ));
60
60
}
61
61
62
62
@ Test // GH-1923
@@ -65,7 +65,7 @@ void sequenceGenerationIsNotSupported() {
65
65
NamedParameterJdbcOperations operations = mock (NamedParameterJdbcOperations .class );
66
66
67
67
IdGeneratingEntityCallback subject = new IdGeneratingEntityCallback (relationalMappingContext ,
68
- MySqlDialect .INSTANCE , operations );
68
+ JdbcMySqlDialect .INSTANCE , operations );
69
69
70
70
EntityWithSequence processed = (EntityWithSequence ) subject .onBeforeSave (new EntityWithSequence (),
71
71
MutableAggregateChange .forSave (new EntityWithSequence ()));
@@ -77,7 +77,7 @@ void sequenceGenerationIsNotSupported() {
77
77
void entityIsNotMarkedWithTargetSequence () {
78
78
79
79
IdGeneratingEntityCallback subject = new IdGeneratingEntityCallback (relationalMappingContext ,
80
- MySqlDialect .INSTANCE , operations );
80
+ JdbcMySqlDialect .INSTANCE , operations );
81
81
82
82
NoSequenceEntity processed = (NoSequenceEntity ) subject .onBeforeSave (new NoSequenceEntity (),
83
83
MutableAggregateChange .forSave (new NoSequenceEntity ()));
@@ -93,7 +93,7 @@ void entityIdIsPopulatedFromSequence() {
93
93
.thenReturn (generatedId );
94
94
95
95
IdGeneratingEntityCallback subject = new IdGeneratingEntityCallback (relationalMappingContext ,
96
- PostgresDialect .INSTANCE , operations );
96
+ JdbcPostgresDialect .INSTANCE , operations );
97
97
98
98
EntityWithSequence processed = (EntityWithSequence ) subject .onBeforeSave (new EntityWithSequence (),
99
99
MutableAggregateChange .forSave (new EntityWithSequence ()));
@@ -109,7 +109,7 @@ void appliesIntegerConversion() {
109
109
.thenReturn (generatedId );
110
110
111
111
IdGeneratingEntityCallback subject = new IdGeneratingEntityCallback (relationalMappingContext ,
112
- PostgresDialect .INSTANCE , operations );
112
+ JdbcPostgresDialect .INSTANCE , operations );
113
113
114
114
EntityWithIntSequence processed = (EntityWithIntSequence ) subject .onBeforeSave (new EntityWithIntSequence (),
115
115
MutableAggregateChange .forSave (new EntityWithIntSequence ()));
@@ -125,7 +125,7 @@ void assignsUuidValues() {
125
125
.thenReturn (generatedId );
126
126
127
127
IdGeneratingEntityCallback subject = new IdGeneratingEntityCallback (relationalMappingContext ,
128
- PostgresDialect .INSTANCE , operations );
128
+ JdbcPostgresDialect .INSTANCE , operations );
129
129
130
130
EntityWithUuidSequence processed = (EntityWithUuidSequence ) subject .onBeforeSave (new EntityWithUuidSequence (),
131
131
MutableAggregateChange .forSave (new EntityWithUuidSequence ()));
0 commit comments