15
15
*/
16
16
package org .springframework .data .r2dbc .repository ;
17
17
18
+ import static org .assertj .core .api .Assertions .*;
19
+
18
20
import io .r2dbc .spi .ConnectionFactory ;
19
21
import lombok .Getter ;
20
22
import lombok .NoArgsConstructor ;
29
31
30
32
import org .junit .Test ;
31
33
import org .junit .runner .RunWith ;
32
- import static org .assertj .core .api .Assertions .*;
33
34
34
35
import org .springframework .beans .factory .annotation .Autowired ;
35
36
import org .springframework .context .annotation .Bean ;
50
51
* Integration tests for {@link LegoSetRepository} using {@link R2dbcRepositoryFactory} against H2.
51
52
*
52
53
* @author Mark Paluch
54
+ * @author Zsombor Gegesy
53
55
*/
54
56
@ RunWith (SpringRunner .class )
55
57
@ ContextConfiguration
@@ -70,17 +72,6 @@ public ConnectionFactory connectionFactory() {
70
72
}
71
73
}
72
74
73
- interface IdOnlyEntityRepository extends ReactiveCrudRepository <IdOnlyEntity , Integer > {
74
- }
75
-
76
- @ Getter
77
- @ Setter
78
- @ Table ("id_only" )
79
- @ NoArgsConstructor
80
- static class IdOnlyEntity {
81
- @ Id Integer id ;
82
- }
83
-
84
75
@ Override
85
76
protected DataSource createDataSource () {
86
77
return H2TestSupport .createDataSource ();
@@ -133,8 +124,9 @@ public void shouldNotReturnUpdateCount() {
133
124
repository .updateManualAndReturnNothing (42 ).as (StepVerifier ::create ).verifyComplete ();
134
125
}
135
126
136
- @ Test
127
+ @ Test // gh-390
137
128
public void shouldInsertIdOnlyEntity () {
129
+
138
130
this .jdbc .execute ("CREATE TABLE ID_ONLY(id serial CONSTRAINT id_only_pk PRIMARY KEY)" );
139
131
140
132
IdOnlyEntity entity1 = new IdOnlyEntity ();
@@ -175,4 +167,14 @@ interface H2LegoSetRepository extends LegoSetRepository {
175
167
@ Modifying
176
168
Mono <Double > updateManualAndReturnDouble (int manual );
177
169
}
170
+
171
+ interface IdOnlyEntityRepository extends ReactiveCrudRepository <IdOnlyEntity , Integer > {}
172
+
173
+ @ Getter
174
+ @ Setter
175
+ @ Table ("id_only" )
176
+ @ NoArgsConstructor
177
+ static class IdOnlyEntity {
178
+ @ Id Integer id ;
179
+ }
178
180
}
0 commit comments