#390 - Polishing.

Add author tags and ticket references to tests.
This commit is contained in:
Mark Paluch
2020-07-14 15:20:42 +02:00
parent 38ca169f86
commit de1d1a3934
2 changed files with 17 additions and 14 deletions

View File

@@ -57,6 +57,7 @@ import org.springframework.lang.Nullable;
* @author Mark Paluch
* @author Ferdinand Jacobs
* @author Jens Schauder
* @author Zsombor Gegesy
*/
@RunWith(MockitoJUnitRunner.class)
public class DefaultDatabaseClientUnitTests {
@@ -249,7 +250,7 @@ public class DefaultDatabaseClientUnitTests {
verify(statement).bindNull(1, Integer.class);
}
@Test
@Test // gh-390
public void insertShouldWorkWithoutValues() {
Statement statement = mockStatementFor("INSERT INTO id_only VALUES ()");

View File

@@ -15,6 +15,8 @@
*/
package org.springframework.data.r2dbc.repository;
import static org.assertj.core.api.Assertions.*;
import io.r2dbc.spi.ConnectionFactory;
import lombok.Getter;
import lombok.NoArgsConstructor;
@@ -29,7 +31,6 @@ import javax.sql.DataSource;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.assertj.core.api.Assertions.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
@@ -50,6 +51,7 @@ import org.springframework.test.context.junit4.SpringRunner;
* Integration tests for {@link LegoSetRepository} using {@link R2dbcRepositoryFactory} against H2.
*
* @author Mark Paluch
* @author Zsombor Gegesy
*/
@RunWith(SpringRunner.class)
@ContextConfiguration
@@ -70,17 +72,6 @@ public class H2R2dbcRepositoryIntegrationTests extends AbstractR2dbcRepositoryIn
}
}
interface IdOnlyEntityRepository extends ReactiveCrudRepository<IdOnlyEntity, Integer> {
}
@Getter
@Setter
@Table("id_only")
@NoArgsConstructor
static class IdOnlyEntity {
@Id Integer id;
}
@Override
protected DataSource createDataSource() {
return H2TestSupport.createDataSource();
@@ -133,8 +124,9 @@ public class H2R2dbcRepositoryIntegrationTests extends AbstractR2dbcRepositoryIn
repository.updateManualAndReturnNothing(42).as(StepVerifier::create).verifyComplete();
}
@Test
@Test // gh-390
public void shouldInsertIdOnlyEntity() {
this.jdbc.execute("CREATE TABLE ID_ONLY(id serial CONSTRAINT id_only_pk PRIMARY KEY)");
IdOnlyEntity entity1 = new IdOnlyEntity();
@@ -175,4 +167,14 @@ public class H2R2dbcRepositoryIntegrationTests extends AbstractR2dbcRepositoryIn
@Modifying
Mono<Double> updateManualAndReturnDouble(int manual);
}
interface IdOnlyEntityRepository extends ReactiveCrudRepository<IdOnlyEntity, Integer> {}
@Getter
@Setter
@Table("id_only")
@NoArgsConstructor
static class IdOnlyEntity {
@Id Integer id;
}
}