DATAJPA-1248 - Polishing.
This commit is contained in:
@@ -15,8 +15,8 @@
|
||||
*/
|
||||
package org.springframework.data.jpa.repository;
|
||||
|
||||
import static org.hamcrest.MatcherAssert.assertThat;
|
||||
import static org.hamcrest.Matchers.equalTo;
|
||||
import static org.hamcrest.MatcherAssert.*;
|
||||
import static org.hamcrest.Matchers.*;
|
||||
|
||||
import javax.persistence.Query;
|
||||
|
||||
@@ -96,10 +96,6 @@ public class EclipseLinkNamespaceUserRepositoryTests extends NamespaceUserReposi
|
||||
/**
|
||||
* Ignored until https://bugs.eclipse.org/bugs/show_bug.cgi?id=525319 is fixed.
|
||||
*/
|
||||
@Ignore
|
||||
@Override
|
||||
@Test // DATAJPA-1248
|
||||
public void supportsProjectionsWithNativeQueriesAndCamelCaseProperty() {
|
||||
super.supportsProjectionsWithNativeQueriesAndCamelCaseProperty();
|
||||
}
|
||||
public void supportsProjectionsWithNativeQueriesAndCamelCaseProperty() {}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,8 @@ import org.springframework.dao.IncorrectResultSizeDataAccessException;
|
||||
import org.springframework.dao.InvalidDataAccessApiUsageException;
|
||||
import org.springframework.data.domain.Example;
|
||||
import org.springframework.data.domain.ExampleMatcher;
|
||||
import org.springframework.data.domain.ExampleMatcher.GenericPropertyMatcher;
|
||||
import org.springframework.data.domain.ExampleMatcher.StringMatcher;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.PageImpl;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
@@ -64,7 +66,6 @@ import org.springframework.data.domain.Slice;
|
||||
import org.springframework.data.domain.Sort;
|
||||
import org.springframework.data.domain.Sort.Direction;
|
||||
import org.springframework.data.domain.Sort.Order;
|
||||
import org.springframework.data.domain.ExampleMatcher.*;
|
||||
import org.springframework.data.jpa.domain.Specification;
|
||||
import org.springframework.data.jpa.domain.sample.Address;
|
||||
import org.springframework.data.jpa.domain.sample.Role;
|
||||
@@ -2212,10 +2213,8 @@ public class UserRepositoryTests {
|
||||
|
||||
String emailAddress = result.getEmailAddress();
|
||||
|
||||
assertThat(emailAddress) //
|
||||
.isEqualTo(user.getEmailAddress()) //
|
||||
.as("ensuring email is actually not null") //
|
||||
.isNotNull();
|
||||
assertThat(emailAddress, is(notNullValue()));
|
||||
assertThat(emailAddress, is(user.getEmailAddress()));
|
||||
}
|
||||
|
||||
private Page<User> executeSpecWithSort(Sort sort) {
|
||||
|
||||
@@ -15,7 +15,8 @@
|
||||
*/
|
||||
package org.springframework.data.jpa.repository.query;
|
||||
|
||||
import static org.assertj.core.api.Assertions.*;
|
||||
import static org.hamcrest.CoreMatchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
import java.util.Arrays;
|
||||
@@ -26,7 +27,6 @@ import java.util.Map;
|
||||
import javax.persistence.Tuple;
|
||||
import javax.persistence.TupleElement;
|
||||
|
||||
import org.assertj.core.api.SoftAssertions;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -74,7 +74,7 @@ public class TupleConverterUnitTests {
|
||||
|
||||
TupleConverter converter = new TupleConverter(type);
|
||||
|
||||
assertThat(converter.convert(tuple)).isEqualTo("Foo");
|
||||
assertThat(converter.convert(tuple), is((Object) "Foo"));
|
||||
}
|
||||
|
||||
@Test // DATAJPA-1024
|
||||
@@ -86,11 +86,11 @@ public class TupleConverterUnitTests {
|
||||
|
||||
TupleConverter converter = new TupleConverter(type);
|
||||
|
||||
assertThat(converter.convert(tuple)).isNull();
|
||||
assertThat(converter.convert(tuple), is(nullValue()));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Test // DATAJPA-1048
|
||||
@SuppressWarnings("unchecked")
|
||||
public void findsValuesForAllVariantsSupportedByTheTuple() {
|
||||
|
||||
Tuple tuple = new MockTuple();
|
||||
@@ -99,14 +99,10 @@ public class TupleConverterUnitTests {
|
||||
|
||||
Map<String, Object> map = (Map<String, Object>) converter.convert(tuple);
|
||||
|
||||
SoftAssertions softly = new SoftAssertions();
|
||||
|
||||
softly.assertThat(map.get("ONE")).isEqualTo("one");
|
||||
softly.assertThat(map.get("one")).isEqualTo("one");
|
||||
softly.assertThat(map.get("OnE")).isEqualTo("one");
|
||||
softly.assertThat(map.get("oNe")).isEqualTo("one");
|
||||
|
||||
softly.assertAll();
|
||||
assertThat(map.get("ONE"), is((Object) "one"));
|
||||
assertThat(map.get("one"), is((Object) "one"));
|
||||
assertThat(map.get("OnE"), is((Object) "one"));
|
||||
assertThat(map.get("oNe"), is((Object) "one"));
|
||||
}
|
||||
|
||||
interface SampleRepository extends CrudRepository<Object, Long> {
|
||||
@@ -151,7 +147,7 @@ public class TupleConverterUnitTests {
|
||||
|
||||
@Override
|
||||
public List<TupleElement<?>> getElements() {
|
||||
return Arrays.asList(one, two);
|
||||
return Arrays.<TupleElement<?>> asList(one, two);
|
||||
}
|
||||
|
||||
private static class StringTupleElement implements TupleElement<String> {
|
||||
|
||||
Reference in New Issue
Block a user