@@ -63,6 +63,7 @@ import org.springframework.data.util.TypeInformation;
|
||||
* @author Thomas Darimont
|
||||
* @author Mark Paluch
|
||||
* @author Christoph Stobl
|
||||
* @author Johannes Englmeier
|
||||
*/
|
||||
class AbstractMappingContextUnitTests {
|
||||
|
||||
@@ -78,7 +79,7 @@ class AbstractMappingContextUnitTests {
|
||||
@Test // DATACMNS-92
|
||||
void doesNotAddInvalidEntity() {
|
||||
|
||||
context = TypeRejectingMappingContext.rejecting(() -> new MappingException("Not supported!"), Unsupported.class);
|
||||
context = TypeRejectingMappingContext.rejecting(() -> new MappingException("Not supported"), Unsupported.class);
|
||||
|
||||
assertThatExceptionOfType(MappingException.class) //
|
||||
.isThrownBy(() -> context.getPersistentEntity(Unsupported.class));
|
||||
|
||||
@@ -54,6 +54,7 @@ import org.springframework.data.repository.core.support.DefaultRepositoryMetadat
|
||||
* @author Oliver Gierke
|
||||
* @author Thomas Darimont
|
||||
* @author Mark Paluch
|
||||
* @author Johannes Englmeier
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
@MockitoSettings(strictness = Strictness.LENIENT)
|
||||
@@ -279,7 +280,7 @@ class DefaultRepositoryInformationUnitTests {
|
||||
return Arrays.stream(type.getMethods())//
|
||||
.filter(method -> method.getName().equals(name))//
|
||||
.findFirst()//
|
||||
.orElseThrow(() -> new IllegalStateException("No method found with name ".concat(name).concat("!")));
|
||||
.orElseThrow(() -> new IllegalStateException("No method found with name ".concat(name)));
|
||||
}
|
||||
|
||||
@Target(ElementType.METHOD)
|
||||
|
||||
@@ -84,6 +84,7 @@ import org.springframework.util.concurrent.ListenableFuture;
|
||||
* @author Oliver Gierke
|
||||
* @author Mark Paluch
|
||||
* @author Ariel Carrera
|
||||
* @author Johannes Englmeier
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
@MockitoSettings(strictness = Strictness.LENIENT)
|
||||
@@ -360,7 +361,7 @@ class RepositoryFactorySupportUnitTests {
|
||||
assertThatThrownBy( //
|
||||
() -> repository.findById("")) //
|
||||
.isInstanceOf(EmptyResultDataAccessException.class) //
|
||||
.hasMessageContaining("Result must not be null!");
|
||||
.hasMessageContaining("Result must not be null");
|
||||
|
||||
assertThat(repository.findByUsername("")).isNull();
|
||||
}
|
||||
@@ -373,7 +374,7 @@ class RepositoryFactorySupportUnitTests {
|
||||
assertThatThrownBy( //
|
||||
() -> repository.findByClass(null)) //
|
||||
.isInstanceOf(IllegalArgumentException.class) //
|
||||
.hasMessageContaining("must not be null!");
|
||||
.hasMessageContaining("must not be null");
|
||||
}
|
||||
|
||||
@Test // DATACMNS-1154
|
||||
@@ -394,7 +395,7 @@ class RepositoryFactorySupportUnitTests {
|
||||
assertThatThrownBy( //
|
||||
() -> repository.findById(null)) //
|
||||
.isInstanceOf(IllegalArgumentException.class) //
|
||||
.hasMessageContaining("must not be null!"); //
|
||||
.hasMessageContaining("must not be null"); //
|
||||
}
|
||||
|
||||
@Test // DATACMNS-1154
|
||||
@@ -437,7 +438,7 @@ class RepositoryFactorySupportUnitTests {
|
||||
void dummyRepositoryNotSupportingReactiveQuerydslShouldRaiseException() {
|
||||
assertThatThrownBy(() -> factory.getRepository(WithReactiveQuerydsl.class, backingRepo))
|
||||
.isInstanceOf(UnsupportedFragmentException.class).hasMessage(
|
||||
"Repository org.springframework.data.repository.core.support.RepositoryFactorySupportUnitTests$WithReactiveQuerydsl implements org.springframework.data.repository.query.ReactiveQueryByExampleExecutor but DummyRepositoryFactory does not support Reactive Query by Example!");
|
||||
"Repository org.springframework.data.repository.core.support.RepositoryFactorySupportUnitTests$WithReactiveQuerydsl implements org.springframework.data.repository.query.ReactiveQueryByExampleExecutor but DummyRepositoryFactory does not support Reactive Query by Example");
|
||||
}
|
||||
|
||||
@Test // GH-2341
|
||||
|
||||
@@ -64,6 +64,7 @@ import org.springframework.util.ReflectionUtils;
|
||||
|
||||
/**
|
||||
* @author Christoph Strobl
|
||||
* @author Johannes Englmeier
|
||||
*/
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class RepositoryMethodInvokerUnitTests {
|
||||
@@ -212,7 +213,7 @@ class RepositoryMethodInvokerUnitTests {
|
||||
@Test // DATACMNS-1764
|
||||
void capturesImperativeErrorCorrectly() {
|
||||
|
||||
when(query.execute(any())).thenThrow(new IllegalStateException("I'll be back!"));
|
||||
when(query.execute(any())).thenThrow(new IllegalStateException("I'll be back"));
|
||||
assertThatIllegalStateException().isThrownBy(() -> repositoryMethodInvoker("findAll").invoke());
|
||||
|
||||
assertThat(multicaster.first().getResult().getState()).isEqualTo(State.ERROR);
|
||||
@@ -223,7 +224,7 @@ class RepositoryMethodInvokerUnitTests {
|
||||
void capturesReactiveErrorCorrectly() throws Exception {
|
||||
|
||||
when(query.execute(any())).thenReturn(Mono.fromSupplier(() -> {
|
||||
throw new IllegalStateException("I'll be back!");
|
||||
throw new IllegalStateException("I'll be back");
|
||||
}));
|
||||
|
||||
repositoryMethodInvokerForReactive("findByName").<Mono<TestDummy>> invoke().as(StepVerifier::create).verifyError();
|
||||
|
||||
@@ -57,6 +57,7 @@ import com.google.common.base.Optional;
|
||||
* @author Oliver Gierke
|
||||
* @author Mark Paluch
|
||||
* @author Maciek Opała
|
||||
* @author Johannes Englmeier
|
||||
*/
|
||||
class QueryExecutionConvertersUnitTests {
|
||||
|
||||
@@ -194,7 +195,7 @@ class QueryExecutionConvertersUnitTests {
|
||||
void exposesExecutionAdapterForJavaslangTry() throws Throwable {
|
||||
|
||||
var result = getExecutionAdapter(Try.class).apply(() -> {
|
||||
throw new IOException("Some message!");
|
||||
throw new IOException("Some message");
|
||||
});
|
||||
|
||||
assertThat(result).isInstanceOf(Failure.class);
|
||||
@@ -218,7 +219,7 @@ class QueryExecutionConvertersUnitTests {
|
||||
void exposesExecutionAdapterForVavrTry() throws Throwable {
|
||||
|
||||
var result = getExecutionAdapter(io.vavr.control.Try.class).apply(() -> {
|
||||
throw new IOException("Some message!");
|
||||
throw new IOException("Some message");
|
||||
});
|
||||
|
||||
assertThat(result).isInstanceOf(io.vavr.control.Try.Failure.class);
|
||||
|
||||
Reference in New Issue
Block a user