Skip to content

Commit

Permalink
Polishing.
Browse files Browse the repository at this point in the history
Fix line breaks.

See #1647
  • Loading branch information
mp911de committed Nov 6, 2023
1 parent 9ffbfb6 commit 0035312
Showing 1 changed file with 33 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,22 @@
*/
package org.springframework.data.r2dbc.core;

import static org.assertj.core.api.Assertions.*;
import static org.mockito.Mockito.*;

import io.r2dbc.spi.R2dbcType;
import io.r2dbc.spi.test.MockColumnMetadata;
import io.r2dbc.spi.test.MockResult;
import io.r2dbc.spi.test.MockRow;
import io.r2dbc.spi.test.MockRowMetadata;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.ObjectFactory;
Expand Down Expand Up @@ -49,16 +60,6 @@
import org.springframework.r2dbc.core.DatabaseClient;
import org.springframework.r2dbc.core.Parameter;
import org.springframework.util.CollectionUtils;
import reactor.core.publisher.Mono;
import reactor.test.StepVerifier;

import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

import static org.assertj.core.api.Assertions.*;
import static org.mockito.Mockito.*;

/**
* Unit tests for {@link R2dbcEntityTemplate}.
Expand All @@ -83,8 +84,7 @@ void before() {
entityTemplate = new R2dbcEntityTemplate(client, PostgresDialect.INSTANCE);
}

@Test
// gh-220
@Test // gh-220
void shouldCountBy() {

MockRowMetadata metadata = MockRowMetadata.builder()
Expand All @@ -104,8 +104,7 @@ void shouldCountBy() {
assertThat(statement.getBindings()).hasSize(1).containsEntry(0, Parameter.from("Walter"));
}

@Test
// gh-469
@Test // gh-469
void shouldProjectExistsResult() {

MockRowMetadata metadata = MockRowMetadata.builder()
Expand All @@ -122,8 +121,7 @@ void shouldProjectExistsResult() {
.verifyComplete();
}

@Test
// gh-1310
@Test // gh-1310
void shouldProjectExistsResultWithoutId() {

MockResult result = MockResult.builder().row(MockRow.builder().identified(0, Object.class, null).build()).build();
Expand All @@ -135,8 +133,7 @@ void shouldProjectExistsResultWithoutId() {
.expectNext(true).verifyComplete();
}

@Test
// gh-1310
@Test // gh-1310
void shouldProjectCountResultWithoutId() {

MockResult result = MockResult.builder().row(MockRow.builder().identified(0, Long.class, 1L).build()).build();
Expand All @@ -148,8 +145,7 @@ void shouldProjectCountResultWithoutId() {
.expectNext(1L).verifyComplete();
}

@Test
// gh-469
@Test // gh-469
void shouldExistsByCriteria() {

MockRowMetadata metadata = MockRowMetadata.builder()
Expand All @@ -169,8 +165,7 @@ void shouldExistsByCriteria() {
assertThat(statement.getBindings()).hasSize(1).containsEntry(0, Parameter.from("Walter"));
}

@Test
// gh-220
@Test // gh-220
void shouldSelectByCriteria() {

recorder.addStubbing(s -> s.startsWith("SELECT"), Collections.emptyList());
Expand All @@ -186,8 +181,7 @@ void shouldSelectByCriteria() {
assertThat(statement.getBindings()).hasSize(1).containsEntry(0, Parameter.from("Walter"));
}

@Test
// gh-215
@Test // gh-215
void selectShouldInvokeCallback() {

MockRowMetadata metadata = MockRowMetadata.builder()
Expand All @@ -213,8 +207,7 @@ void selectShouldInvokeCallback() {
assertThat(callback.getValues()).hasSize(1);
}

@Test
// gh-220
@Test // gh-220
void shouldSelectOne() {

recorder.addStubbing(s -> s.startsWith("SELECT"), Collections.emptyList());
Expand All @@ -230,8 +223,7 @@ void shouldSelectOne() {
assertThat(statement.getBindings()).hasSize(1).containsEntry(0, Parameter.from("Walter"));
}

@Test
// gh-220, gh-758
@Test // gh-220, gh-758
void shouldSelectOneDoNotOverrideExistingLimit() {

recorder.addStubbing(s -> s.startsWith("SELECT"), Collections.emptyList());
Expand All @@ -248,8 +240,7 @@ void shouldSelectOneDoNotOverrideExistingLimit() {
assertThat(statement.getBindings()).hasSize(1).containsEntry(0, Parameter.from("Walter"));
}

@Test
// gh-220
@Test // gh-220
void shouldUpdateByQuery() {

MockRowMetadata metadata = MockRowMetadata.builder()
Expand All @@ -271,8 +262,7 @@ void shouldUpdateByQuery() {
Parameter.from("Walter"));
}

@Test
// gh-220
@Test // gh-220
void shouldDeleteByQuery() {

MockRowMetadata metadata = MockRowMetadata.builder()
Expand All @@ -292,8 +282,7 @@ void shouldDeleteByQuery() {
assertThat(statement.getBindings()).hasSize(1).containsEntry(0, Parameter.from("Walter"));
}

@Test
// gh-220
@Test // gh-220
void shouldDeleteEntity() {

Person person = Person.empty() //
Expand All @@ -310,8 +299,7 @@ void shouldDeleteEntity() {
assertThat(statement.getBindings()).hasSize(1).containsEntry(0, Parameter.from("Walter"));
}

@Test
// gh-365
@Test // gh-365
void shouldInsertVersioned() {

MockRowMetadata metadata = MockRowMetadata.builder().build();
Expand All @@ -332,8 +320,7 @@ void shouldInsertVersioned() {
Parameter.from(1L));
}

@Test
// gh-557, gh-402
@Test // gh-557, gh-402
void shouldSkipDefaultIdValueOnInsert() {

MockRowMetadata metadata = MockRowMetadata.builder().build();
Expand All @@ -351,8 +338,7 @@ void shouldSkipDefaultIdValueOnInsert() {
assertThat(statement.getBindings()).hasSize(1).containsEntry(0, Parameter.from("bar"));
}

@Test
// gh-557, gh-402
@Test // gh-557, gh-402
void shouldSkipDefaultIdValueOnVersionedInsert() {

MockRowMetadata metadata = MockRowMetadata.builder().build();
Expand All @@ -374,8 +360,7 @@ void shouldSkipDefaultIdValueOnVersionedInsert() {
Parameter.from("bar"));
}

@Test
// gh-451
@Test // gh-451
void shouldInsertCorrectlyVersionedAndAudited() {

MockRowMetadata metadata = MockRowMetadata.builder().build();
Expand Down Expand Up @@ -403,8 +388,7 @@ void shouldInsertCorrectlyVersionedAndAudited() {
"INSERT INTO with_auditing_and_optimistic_locking (version, name, created_date, last_modified_date) VALUES ($1, $2, $3, $4)");
}

@Test
// gh-451
@Test // gh-451
void shouldUpdateCorrectlyVersionedAndAudited() {

MockRowMetadata metadata = MockRowMetadata.builder().build();
Expand Down Expand Up @@ -433,8 +417,7 @@ void shouldUpdateCorrectlyVersionedAndAudited() {
"UPDATE with_auditing_and_optimistic_locking SET version = $1, name = $2, created_date = $3, last_modified_date = $4");
}

@Test
// gh-215
@Test // gh-215
void insertShouldInvokeCallback() {

MockRowMetadata metadata = MockRowMetadata.builder().build();
Expand Down Expand Up @@ -462,8 +445,7 @@ void insertShouldInvokeCallback() {
Parameter.from("before-save"));
}

@Test
// gh-365
@Test // gh-365
void shouldUpdateVersioned() {

MockRowMetadata metadata = MockRowMetadata.builder().build();
Expand All @@ -485,8 +467,7 @@ void shouldUpdateVersioned() {
Parameter.from(1L));
}

@Test
// gh-215
@Test // gh-215
void updateShouldInvokeCallback() {

MockRowMetadata metadata = MockRowMetadata.builder().build();
Expand Down Expand Up @@ -519,8 +500,7 @@ void updateShouldInvokeCallback() {
Parameter.from("before-save"));
}

@Test
// gh-637
@Test // gh-637
void insertIncludesInsertOnlyColumns() {

MockRowMetadata metadata = MockRowMetadata.builder().build();
Expand All @@ -540,8 +520,7 @@ void insertIncludesInsertOnlyColumns() {
.containsEntry(1, Parameter.from("insert this"));
}

@Test
// gh-637
@Test // gh-637
void updateExcludesInsertOnlyColumns() {

MockRowMetadata metadata = MockRowMetadata.builder().build();
Expand Down

0 comments on commit 0035312

Please sign in to comment.