#354 - Polishing.

Add author tags. Reformat code.

Original pull request: #355.
This commit is contained in:
Mark Paluch
2020-04-23 14:27:55 +02:00
parent bf19cb36a4
commit 75e2ba3ede
2 changed files with 8 additions and 6 deletions

View File

@@ -54,6 +54,7 @@ import org.springframework.util.CollectionUtils;
* Default {@link ReactiveDataAccessStrategy} implementation.
*
* @author Mark Paluch
* @author Louis Morgan
*/
public class DefaultReactiveDataAccessStrategy implements ReactiveDataAccessStrategy {

View File

@@ -45,6 +45,7 @@ import org.springframework.data.relational.core.sql.SqlIdentifier;
* Abstract base class for {@link R2dbcDialect}-aware {@link DefaultReactiveDataAccessStrategy} tests.
*
* @author Mark Paluch
* @author Louis Morgan
*/
public abstract class ReactiveDataAccessStrategyTestSupport {
@@ -180,12 +181,14 @@ public abstract class ReactiveDataAccessStrategyTestSupport {
@Test // gh-354
public void shouldNotWriteReadOnlyFields() {
TypeWithReadOnlyFields toSave = new TypeWithReadOnlyFields();
toSave.setWritableField("writable");
toSave.setReadOnlyField("readonly");
toSave.setReadOnlyArrayField("readonly_array".getBytes());
assertThat(getStrategy().getOutboundRow(toSave))
.containsOnlyKeys(SqlIdentifier.unquoted("writable_field"));
assertThat(getStrategy().getOutboundRow(toSave)).containsOnlyKeys(SqlIdentifier.unquoted("writable_field"));
}
private <T> void testType(BiConsumer<PrimitiveTypes, T> setter, Function<PrimitiveTypes, T> getter, T testValue,
@@ -250,9 +253,7 @@ public abstract class ReactiveDataAccessStrategyTestSupport {
@Data
static class TypeWithReadOnlyFields {
String writableField;
@ReadOnlyProperty
String readOnlyField;
@ReadOnlyProperty
byte[] readOnlyArrayField;
@ReadOnlyProperty String readOnlyField;
@ReadOnlyProperty byte[] readOnlyArrayField;
}
}