Skip to content

Commit de1d1a3

Browse files
committed
#390 - Polishing.
Add author tags and ticket references to tests.
1 parent 38ca169 commit de1d1a3

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

src/test/java/org/springframework/data/r2dbc/core/DefaultDatabaseClientUnitTests.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
* @author Mark Paluch
5858
* @author Ferdinand Jacobs
5959
* @author Jens Schauder
60+
* @author Zsombor Gegesy
6061
*/
6162
@RunWith(MockitoJUnitRunner.class)
6263
public class DefaultDatabaseClientUnitTests {
@@ -249,7 +250,7 @@ public void insertShouldAcceptSettableValue() {
249250
verify(statement).bindNull(1, Integer.class);
250251
}
251252

252-
@Test
253+
@Test // gh-390
253254
public void insertShouldWorkWithoutValues() {
254255

255256
Statement statement = mockStatementFor("INSERT INTO id_only VALUES ()");

src/test/java/org/springframework/data/r2dbc/repository/H2R2dbcRepositoryIntegrationTests.java

+15-13
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
*/
1616
package org.springframework.data.r2dbc.repository;
1717

18+
import static org.assertj.core.api.Assertions.*;
19+
1820
import io.r2dbc.spi.ConnectionFactory;
1921
import lombok.Getter;
2022
import lombok.NoArgsConstructor;
@@ -29,7 +31,6 @@
2931

3032
import org.junit.Test;
3133
import org.junit.runner.RunWith;
32-
import static org.assertj.core.api.Assertions.*;
3334

3435
import org.springframework.beans.factory.annotation.Autowired;
3536
import org.springframework.context.annotation.Bean;
@@ -50,6 +51,7 @@
5051
* Integration tests for {@link LegoSetRepository} using {@link R2dbcRepositoryFactory} against H2.
5152
*
5253
* @author Mark Paluch
54+
* @author Zsombor Gegesy
5355
*/
5456
@RunWith(SpringRunner.class)
5557
@ContextConfiguration
@@ -70,17 +72,6 @@ public ConnectionFactory connectionFactory() {
7072
}
7173
}
7274

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-
8475
@Override
8576
protected DataSource createDataSource() {
8677
return H2TestSupport.createDataSource();
@@ -133,8 +124,9 @@ public void shouldNotReturnUpdateCount() {
133124
repository.updateManualAndReturnNothing(42).as(StepVerifier::create).verifyComplete();
134125
}
135126

136-
@Test
127+
@Test // gh-390
137128
public void shouldInsertIdOnlyEntity() {
129+
138130
this.jdbc.execute("CREATE TABLE ID_ONLY(id serial CONSTRAINT id_only_pk PRIMARY KEY)");
139131

140132
IdOnlyEntity entity1 = new IdOnlyEntity();
@@ -175,4 +167,14 @@ interface H2LegoSetRepository extends LegoSetRepository {
175167
@Modifying
176168
Mono<Double> updateManualAndReturnDouble(int manual);
177169
}
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+
}
178180
}

0 commit comments

Comments
 (0)