diff --git a/src/main/java/org/springframework/data/jpa/domain/AbstractPersistable.java b/src/main/java/org/springframework/data/jpa/domain/AbstractPersistable.java index fd6afc8c6..706570c7e 100644 --- a/src/main/java/org/springframework/data/jpa/domain/AbstractPersistable.java +++ b/src/main/java/org/springframework/data/jpa/domain/AbstractPersistable.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2015 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,10 +60,9 @@ public abstract class AbstractPersistable implements Pe /** * Must be {@link Transient} in order to ensure that no JPA provider complains because of a missing setter. * - * @see DATAJPA-622 * @see org.springframework.data.domain.Persistable#isNew() */ - @Transient + @Transient // DATAJPA-622 public boolean isNew() { return null == getId(); } diff --git a/src/main/java/org/springframework/data/jpa/provider/PersistenceProvider.java b/src/main/java/org/springframework/data/jpa/provider/PersistenceProvider.java index 01517f0fc..4ed4e69a2 100644 --- a/src/main/java/org/springframework/data/jpa/provider/PersistenceProvider.java +++ b/src/main/java/org/springframework/data/jpa/provider/PersistenceProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2016 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,7 +62,7 @@ public enum PersistenceProvider implements QueryExtractor, ProxyIdAccessor { * Since Hibernate 4.3 the location of the HibernateEntityManager moved to the org.hibernate.jpa package. In order to * support both locations we interpret both classnames as a Hibernate {@code PersistenceProvider}. * - * @see DATAJPA-444 + * @see DATAJPA-444 */ HIBERNATE(// Arrays.asList(HIBERNATE52_ENTITY_MANAGER_INTERFACE, HIBERNATE43_ENTITY_MANAGER_INTERFACE, @@ -77,8 +77,8 @@ public enum PersistenceProvider implements QueryExtractor, ProxyIdAccessor { * Return custom placeholder ({@code *}) as Hibernate does create invalid queries for count queries for objects with * compound keys. * - * @see HHH-4044 - * @see HHH-3096 + * @see HHH-4044 + * @see HHH-3096 */ @Override public String getCountQueryPlaceholder() { @@ -383,7 +383,7 @@ public enum PersistenceProvider implements QueryExtractor, ProxyIdAccessor { * Potentially converts an empty collection to the appropriate representation of this {@link PersistenceProvider}, * since some JPA providers cannot correctly handle empty collections. * - * @see DATAJPA-606 + * @see DATAJPA-606 * @param collection * @return */ diff --git a/src/main/java/org/springframework/data/jpa/repository/query/NamedQuery.java b/src/main/java/org/springframework/data/jpa/repository/query/NamedQuery.java index 56b2eae80..230e52fa1 100644 --- a/src/main/java/org/springframework/data/jpa/repository/query/NamedQuery.java +++ b/src/main/java/org/springframework/data/jpa/repository/query/NamedQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2014 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +21,7 @@ import javax.persistence.TypedQuery; import org.slf4j.Logger; import org.slf4j.LoggerFactory; + import org.springframework.data.jpa.provider.QueryExtractor; import org.springframework.data.repository.query.Parameters; import org.springframework.data.repository.query.QueryCreationException; @@ -90,8 +91,8 @@ final class NamedQuery extends AbstractJpaQuery { private static boolean hasNamedQuery(EntityManager em, String queryName) { /* - * @see DATAJPA-617 - * we have to use a dedicated em for the lookups to avoid a potential rollback of the running tx. + * See DATAJPA-617, we have to use a dedicated em for the lookups to avoid a + * potential rollback of the running tx. */ EntityManager lookupEm = em.getEntityManagerFactory().createEntityManager(); diff --git a/src/main/java/org/springframework/data/jpa/repository/query/PartTreeJpaQuery.java b/src/main/java/org/springframework/data/jpa/repository/query/PartTreeJpaQuery.java index d780d0a9a..707b0a51c 100644 --- a/src/main/java/org/springframework/data/jpa/repository/query/PartTreeJpaQuery.java +++ b/src/main/java/org/springframework/data/jpa/repository/query/PartTreeJpaQuery.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2016 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -184,11 +184,10 @@ public class PartTreeJpaQuery extends AbstractJpaQuery { } /** - * Checks whether we are working with a cached {@link CriteriaQuery} and snychronizes the creation of a + * Checks whether we are working with a cached {@link CriteriaQuery} and synchronizes the creation of a * {@link TypedQuery} instance from it. This is due to non-thread-safety in the {@link CriteriaQuery} implementation - * of some persistence providers (i.e. Hibernate in this case). + * of some persistence providers (i.e. Hibernate in this case), see DATAJPA-396. * - * @see DATAJPA-396 * @param criteriaQuery must not be {@literal null}. * @return */ diff --git a/src/main/java/org/springframework/data/jpa/support/ClasspathScanningPersistenceUnitPostProcessor.java b/src/main/java/org/springframework/data/jpa/support/ClasspathScanningPersistenceUnitPostProcessor.java index 7ae4c7812..7d985225c 100644 --- a/src/main/java/org/springframework/data/jpa/support/ClasspathScanningPersistenceUnitPostProcessor.java +++ b/src/main/java/org/springframework/data/jpa/support/ClasspathScanningPersistenceUnitPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2015 the original author or authors. + * Copyright 2011-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -152,7 +152,7 @@ public class ClasspathScanningPersistenceUnitPostProcessor * Note that we cannot use File.pathSeparator here since resourcePath uses a forward slash path ('/') separator * being an URI, while basePackagePathComponent has system dependent separator (on windows it's the backslash separator). * - * @see DATAJPA-407 + * See DATAJPA-407. */ char slash = '/'; String basePackagePathComponent = basePackage.replace('.', slash); @@ -182,11 +182,10 @@ public class ClasspathScanningPersistenceUnitPostProcessor /** * Returns the path from the given {@link URI}. In case the given {@link URI} is opaque, e.g. beginning with jar:file, - * the path is extracted from URI by leaving out the protocol prefix. + * the path is extracted from URI by leaving out the protocol prefix, see DATAJPA-519. * * @param uri * @return - * @see DATAJPA-519 */ private static String getResourcePath(URI uri) throws IOException { diff --git a/src/test/java/org/springframework/data/jpa/convert/QueryByExamplePredicateBuilderUnitTests.java b/src/test/java/org/springframework/data/jpa/convert/QueryByExamplePredicateBuilderUnitTests.java index 4ff355102..678b63f4d 100644 --- a/src/test/java/org/springframework/data/jpa/convert/QueryByExamplePredicateBuilderUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/convert/QueryByExamplePredicateBuilderUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -116,42 +116,27 @@ public class QueryByExamplePredicateBuilderUnitTests { doReturn(orPredicate).when(cb).or(Matchers.anyVararg()); } - /** - * @see DATAJPA-218 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-218 public void getPredicateShouldThrowExceptionOnNullRoot() { QueryByExamplePredicateBuilder.getPredicate(null, cb, of(new Person())); } - /** - * @see DATAJPA-218 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-218 public void getPredicateShouldThrowExceptionOnNullCriteriaBuilder() { QueryByExamplePredicateBuilder.getPredicate(root, null, of(new Person())); } - /** - * @see DATAJPA-218 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-218 public void getPredicateShouldThrowExceptionOnNullExample() { QueryByExamplePredicateBuilder.getPredicate(root, null, null); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void emptyCriteriaListShouldResultTruePredicate() { assertThat(QueryByExamplePredicateBuilder.getPredicate(root, cb, of(new Person())), equalTo(truePredicate)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void singleElementCriteriaShouldJustReturnIt() { Person p = new Person(); @@ -161,10 +146,7 @@ public class QueryByExamplePredicateBuilderUnitTests { verify(cb, times(1)).equal(any(Expression.class), eq("foo")); } - /** - * @see DATAJPA-937 - */ - @Test + @Test // DATAJPA-937 public void unresolvableNestedAssociatedPathShouldFail() { Person p = new Person(); @@ -178,10 +160,7 @@ public class QueryByExamplePredicateBuilderUnitTests { QueryByExamplePredicateBuilder.getPredicate(root, cb, of(p)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void multiPredicateCriteriaShouldReturnCombinedOnes() { Person p = new Person(); @@ -194,10 +173,7 @@ public class QueryByExamplePredicateBuilderUnitTests { verify(cb, times(1)).equal(any(Expression.class), eq(2L)); } - /** - * @see DATAJPA-879 - */ - @Test + @Test // DATAJPA-879 public void orConcatenatesPredicatesIfMatcherSpecifies() { Person person = new Person(); diff --git a/src/test/java/org/springframework/data/jpa/convert/threeten/Jsr310JpaConvertersIntegrationTests.java b/src/test/java/org/springframework/data/jpa/convert/threeten/Jsr310JpaConvertersIntegrationTests.java index bc2218471..ac5330d5c 100644 --- a/src/test/java/org/springframework/data/jpa/convert/threeten/Jsr310JpaConvertersIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/convert/threeten/Jsr310JpaConvertersIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,10 +55,7 @@ public class Jsr310JpaConvertersIntegrationTests extends AbstractAttributeConver @PersistenceContext EntityManager em; - /** - * @see DATAJPA-650 - */ - @Test + @Test // DATAJPA-650 public void usesJsr310JpaConverters() { assumeTrue(currentEntityManagerIsAJpa21EntityManager(em)); diff --git a/src/test/java/org/springframework/data/jpa/convert/threetenbp/ThreeTenBackPortJpaConvertersIntegrationTests.java b/src/test/java/org/springframework/data/jpa/convert/threetenbp/ThreeTenBackPortJpaConvertersIntegrationTests.java index f09a15bd2..7283d9c44 100644 --- a/src/test/java/org/springframework/data/jpa/convert/threetenbp/ThreeTenBackPortJpaConvertersIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/convert/threetenbp/ThreeTenBackPortJpaConvertersIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 the original author or authors. + * Copyright 2015-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -55,10 +55,7 @@ public class ThreeTenBackPortJpaConvertersIntegrationTests extends AbstractAttri @PersistenceContext EntityManager em; - /** - * @see DATAJPA-650 - */ - @Test + @Test // DATAJPA-650 public void usesThreeTenBackPortJpaConverters() { assumeTrue(currentEntityManagerIsAJpa21EntityManager(em)); diff --git a/src/test/java/org/springframework/data/jpa/domain/JpaSortTests.java b/src/test/java/org/springframework/data/jpa/domain/JpaSortTests.java index fc6bf805e..75c9a6254 100644 --- a/src/test/java/org/springframework/data/jpa/domain/JpaSortTests.java +++ b/src/test/java/org/springframework/data/jpa/domain/JpaSortTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,6 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; * but only after they've been enhanced by the persistence provider. This requires an {@link EntityManagerFactory} to be * bootstrapped. * - * @see DATAJPA-12 * @author Thomas Darimont * @author Oliver Gierke * @author Christoph Strobl @@ -59,126 +58,108 @@ public class JpaSortTests { private static final PluralAttribute NULL_PLURAL_ATTRIBUTE = null; private static final PluralAttribute[] EMPTY_PLURAL_ATTRIBUTES = new PluralAttribute[0]; - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-12 public void rejectsNullAttribute() { new JpaSort(NULL_ATTRIBUTE); } - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-12 public void rejectsEmptyAttributes() { new JpaSort(EMPTY_ATTRIBUTES); } - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-12 public void rejectsNullPluralAttribute() { new JpaSort(NULL_PLURAL_ATTRIBUTE); } - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-12 public void rejectsEmptyPluralAttributes() { new JpaSort(EMPTY_PLURAL_ATTRIBUTES); } - @Test + @Test // DATAJPA-12 public void sortBySinglePropertyWithDefaultSortDirection() { assertThat(new JpaSort(path(User_.firstname)), hasItems(new Sort.Order("firstname"))); } - @Test + @Test // DATAJPA-12 public void sortByMultiplePropertiesWithDefaultSortDirection() { assertThat(new JpaSort(User_.firstname, User_.lastname), hasItems(new Order("firstname"), new Order("lastname"))); } - @Test + @Test // DATAJPA-12 public void sortByMultiplePropertiesWithDescSortDirection() { assertThat(new JpaSort(DESC, User_.firstname, User_.lastname), hasItems(new Order(DESC, "firstname"), new Order(Direction.DESC, "lastname"))); } - @Test + @Test // DATAJPA-12 public void combiningSortByMultipleProperties() { assertThat(new JpaSort(User_.firstname).and(new JpaSort(User_.lastname)), hasItems(new Order("firstname"), new Order("lastname"))); } - @Test + @Test // DATAJPA-12 public void combiningSortByMultiplePropertiesWithDifferentSort() { assertThat(new JpaSort(User_.firstname).and(new JpaSort(DESC, User_.lastname)), hasItems(new Order("firstname"), new Order(DESC, "lastname"))); } - @Test + @Test // DATAJPA-12 public void combiningSortByNestedEmbeddedProperty() { assertThat(new JpaSort(path(User_.address).dot(Address_.streetName)), hasItems(new Order("address.streetName"))); } - @Test + @Test // DATAJPA-12 public void buildJpaSortFromJpaMetaModelSingleAttribute() { assertThat(new JpaSort(ASC, path(User_.firstname)), // hasItems(new Order("firstname"))); } - @Test + @Test // DATAJPA-12 public void buildJpaSortFromJpaMetaModelNestedAttribute() { assertThat(new JpaSort(ASC, path(MailMessage_.mailSender).dot(MailSender_.name)), // hasItems(new Order("mailSender.name"))); } - /** - * @see DATAJPA-702 - */ - @Test + @Test // DATAJPA-702 public void combiningSortByMultiplePropertiesWithDifferentSortUsingSimpleAnd() { assertThat(new JpaSort(User_.firstname).and(DESC, User_.lastname), contains(new Order("firstname"), new Order(DESC, "lastname"))); } - /** - * @see DATAJPA-702 - */ - @Test + @Test // DATAJPA-702 public void combiningSortByMultiplePathsWithDifferentSortUsingSimpleAnd() { assertThat(new JpaSort(User_.firstname).and(DESC, path(MailMessage_.mailSender).dot(MailSender_.name)), contains(new Order("firstname"), new Order(DESC, "mailSender.name"))); } - /** - * @see DATAJPA-702 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-702 public void rejectsNullAttributesForCombiningCriterias() { new JpaSort(User_.firstname).and(DESC, (Attribute[]) null); } - /** - * @see DATAJPA-702 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-702 public void rejectsNullPathsForCombiningCriterias() { new JpaSort(User_.firstname).and(DESC, (Path[]) null); } - /** - * @see DATAJPA-702 - */ - @Test + @Test // DATAJPA-702 public void buildsUpPathForPluralAttributesCorrectly() { // assertThat(new JpaSort(JpaSort.path(User_.colleagues).dot(User_.roles).dot(Role_.name)), // // hasItem(new Order(ASC, "colleagues.roles.name"))); } - /** - * @see DATAJPA-??? - */ - @Test + @Test // DATAJPA-965 public void createsUnsafeSortCorrectly() { JpaSort sort = JpaSort.unsafe(DESC, "foo.bar"); @@ -187,10 +168,7 @@ public class JpaSortTests { assertThat(sort.getOrderFor("foo.bar"), is(instanceOf(JpaOrder.class))); } - /** - * @see DATAJPA-??? - */ - @Test + @Test // DATAJPA-965 public void createsUnsafeSortWithMultiplePropertiesCorrectly() { JpaSort sort = JpaSort.unsafe(DESC, "foo.bar", "spring.data"); @@ -200,10 +178,7 @@ public class JpaSortTests { assertThat(sort.getOrderFor("spring.data"), is(instanceOf(JpaOrder.class))); } - /** - * @see DATAJPA-??? - */ - @Test + @Test // DATAJPA-965 public void combinesSafeAndUnsafeSortCorrectly() { // JpaSort sort = new JpaSort(path(User_.colleagues).dot(User_.roles).dot(Role_.name)).andUnsafe(DESC, "foo.bar"); @@ -213,10 +188,7 @@ public class JpaSortTests { // assertThat(sort.getOrderFor("foo.bar"), is(instanceOf(JpaOrder.class))); } - /** - * @see DATAJPA-??? - */ - @Test + @Test // DATAJPA-965 public void combinesUnsafeAndSafeSortCorrectly() { // Sort sort = JpaSort.unsafe(DESC, "foo.bar").and(ASC, path(User_.colleagues).dot(User_.roles).dot(Role_.name)); diff --git a/src/test/java/org/springframework/data/jpa/domain/SpecificationsUnitTests.java b/src/test/java/org/springframework/data/jpa/domain/SpecificationsUnitTests.java index e3f81d546..c720ca9e7 100644 --- a/src/test/java/org/springframework/data/jpa/domain/SpecificationsUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/domain/SpecificationsUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,10 +57,7 @@ public class SpecificationsUnitTests { when(mockSpec.toPredicate(root, query, builder)).thenReturn(predicate); } - /** - * @see DATAJPA-300 - */ - @Test + @Test // DATAJPA-300 public void createsSpecificationsFromNull() { Specifications specification = where(null); @@ -68,10 +65,7 @@ public class SpecificationsUnitTests { assertThat(specification.toPredicate(root, query, builder), is(nullValue())); } - /** - * @see DATAJPA-300 - */ - @Test + @Test // DATAJPA-300 public void negatesNullSpecToNull() { Specifications specification = not((Specification) null); @@ -80,10 +74,7 @@ public class SpecificationsUnitTests { assertThat(specification.toPredicate(root, query, builder), is(nullValue())); } - /** - * @see DATAJPA-300 - */ - @Test + @Test // DATAJPA-300 public void andConcatenatesSpecToNullSpec() { Specifications specification = where(null); @@ -93,10 +84,7 @@ public class SpecificationsUnitTests { assertThat(specification.toPredicate(root, query, builder), is(predicate)); } - /** - * @see DATAJPA-300 - */ - @Test + @Test // DATAJPA-300 public void andConcatenatesNullSpecToSpec() { Specifications specification = where(mockSpec); @@ -106,10 +94,7 @@ public class SpecificationsUnitTests { assertThat(specification.toPredicate(root, query, builder), is(predicate)); } - /** - * @see DATAJPA-300 - */ - @Test + @Test // DATAJPA-300 public void orConcatenatesSpecToNullSpec() { Specifications specification = where(null); @@ -119,10 +104,7 @@ public class SpecificationsUnitTests { assertThat(specification.toPredicate(root, query, builder), is(predicate)); } - /** - * @see DATAJPA-300 - */ - @Test + @Test // DATAJPA-300 public void orConcatenatesNullSpecToSpec() { Specifications specification = where(mockSpec); @@ -132,10 +114,7 @@ public class SpecificationsUnitTests { assertThat(specification.toPredicate(root, query, builder), is(predicate)); } - /** - * @see DATAJPA-523 - */ - @Test + @Test // DATAJPA-523 public void specificationsShouldBeSerializable() { Specifications specification = where(mockSpec); @@ -149,10 +128,7 @@ public class SpecificationsUnitTests { assertThat(transferedSpecification, is(notNullValue())); } - /** - * @see DATAJPA-523 - */ - @Test + @Test // DATAJPA-523 public void complexSpecificationsShouldBeSerializable() { Specifications specification = where(mockSpec); diff --git a/src/test/java/org/springframework/data/jpa/domain/sample/Item.java b/src/test/java/org/springframework/data/jpa/domain/sample/Item.java index 2a399dc39..7b19fc77a 100755 --- a/src/test/java/org/springframework/data/jpa/domain/sample/Item.java +++ b/src/test/java/org/springframework/data/jpa/domain/sample/Item.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,8 +23,9 @@ import javax.persistence.JoinColumn; import javax.persistence.Table; /** + * Related to DATAJPA-413. + * * @author Mark Paluch - * @see DATAJPA-413 * @see Final JPA 2.1 Specification 2.4.1.3 Derived Identities Example 2 */ @Entity diff --git a/src/test/java/org/springframework/data/jpa/domain/sample/ItemId.java b/src/test/java/org/springframework/data/jpa/domain/sample/ItemId.java index 2622519e8..370d993a5 100755 --- a/src/test/java/org/springframework/data/jpa/domain/sample/ItemId.java +++ b/src/test/java/org/springframework/data/jpa/domain/sample/ItemId.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,8 +18,9 @@ package org.springframework.data.jpa.domain.sample; import java.io.Serializable; /** + * Related to DATAJPA-413. + * * @author Mark Paluch - * @see DATAJPA-413 * @see Final JPA 2.1 Specification 2.4.1.3 Derived Identities Example 2 */ public class ItemId implements Serializable { diff --git a/src/test/java/org/springframework/data/jpa/domain/sample/ItemSite.java b/src/test/java/org/springframework/data/jpa/domain/sample/ItemSite.java index 457d99d58..aec7fda7b 100755 --- a/src/test/java/org/springframework/data/jpa/domain/sample/ItemSite.java +++ b/src/test/java/org/springframework/data/jpa/domain/sample/ItemSite.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -22,8 +22,9 @@ import javax.persistence.ManyToOne; import javax.persistence.Table; /** + * Related to DATAJPA-413. + * * @author Mark Paluch - * @see DATAJPA-413 * @see Final JPA 2.1 Specification 2.4.1.3 Derived Identities Example 2 */ @Entity diff --git a/src/test/java/org/springframework/data/jpa/domain/sample/ItemSiteId.java b/src/test/java/org/springframework/data/jpa/domain/sample/ItemSiteId.java index c62e6ae98..a123d50a5 100755 --- a/src/test/java/org/springframework/data/jpa/domain/sample/ItemSiteId.java +++ b/src/test/java/org/springframework/data/jpa/domain/sample/ItemSiteId.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -18,8 +18,9 @@ package org.springframework.data.jpa.domain.sample; import java.io.Serializable; /** + * Related to DATAJPA-413. + * * @author Mark Paluch - * @see DATAJPA-413 * @see Final JPA 2.1 Specification 2.4.1.3 Derived Identities Example 2 */ public class ItemSiteId implements Serializable { diff --git a/src/test/java/org/springframework/data/jpa/domain/sample/Site.java b/src/test/java/org/springframework/data/jpa/domain/sample/Site.java index 7acbcd245..e6095e84a 100644 --- a/src/test/java/org/springframework/data/jpa/domain/sample/Site.java +++ b/src/test/java/org/springframework/data/jpa/domain/sample/Site.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,8 +21,9 @@ import javax.persistence.Id; import javax.persistence.Table; /** + * Related to DATAJPA-413. + * * @author Mark Paluch - * @see DATAJPA-413 * @see Final JPA 2.1 Specification 2.4.1.3 Derived Identities Example 2 */ @Entity diff --git a/src/test/java/org/springframework/data/jpa/domain/support/AuditingBeanFactoryPostProcessorUnitTests.java b/src/test/java/org/springframework/data/jpa/domain/support/AuditingBeanFactoryPostProcessorUnitTests.java index 8fadfb07b..fb0aa0462 100644 --- a/src/test/java/org/springframework/data/jpa/domain/support/AuditingBeanFactoryPostProcessorUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/domain/support/AuditingBeanFactoryPostProcessorUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2014 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,18 +66,12 @@ public class AuditingBeanFactoryPostProcessorUnitTests { assertThat(beanFactory.isBeanNameInUse(AuditingBeanFactoryPostProcessor.BEAN_CONFIGURER_ASPECT_BEAN_NAME), is(true)); } - /** - * @see DATAJPA-265 - */ - @Test(expected = IllegalStateException.class) + @Test(expected = IllegalStateException.class) // DATAJPA-265 public void rejectsConfigurationWithoutSpringConfigured() { processor.postProcessBeanFactory(new DefaultListableBeanFactory()); } - /** - * @see DATAJPA-265 - */ - @Test + @Test // DATAJPA-265 public void setsDependsOnOnEntityManagerFactory() { processor.postProcessBeanFactory(beanFactory); @@ -92,10 +86,7 @@ public class AuditingBeanFactoryPostProcessorUnitTests { } } - /** - * @see DATAJPA-453 - */ - @Test + @Test // DATAJPA-453 public void findsEntityManagerFactoryInParentBeanFactory() { DefaultListableBeanFactory childFactory = new DefaultListableBeanFactory(getBeanFactory()); diff --git a/src/test/java/org/springframework/data/jpa/domain/support/AuditingEntityListenerTests.java b/src/test/java/org/springframework/data/jpa/domain/support/AuditingEntityListenerTests.java index 9f7726f47..774193814 100644 --- a/src/test/java/org/springframework/data/jpa/domain/support/AuditingEntityListenerTests.java +++ b/src/test/java/org/springframework/data/jpa/domain/support/AuditingEntityListenerTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2013 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,10 +68,7 @@ public class AuditingEntityListenerTests { assertUserIsAuditor(user, user); } - /** - * @see DATAJPA-303 - */ - @Test + @Test // DATAJPA-303 public void updatesLastModifiedDates() throws Exception { Thread.sleep(200); @@ -98,10 +95,7 @@ public class AuditingEntityListenerTests { assertUserIsAuditor(user, role); } - /** - * @see DATAJPA-501 - */ - @Test + @Test // DATAJPA-501 public void usesAnnotationMetadata() { AnnotatedAuditableUser auditableUser = annotatedUserRepository.save(new AnnotatedAuditableUser()); diff --git a/src/test/java/org/springframework/data/jpa/mapping/JpaMetamodelMappingContextIntegrationTests.java b/src/test/java/org/springframework/data/jpa/mapping/JpaMetamodelMappingContextIntegrationTests.java index 55ef6d3da..6a516dad8 100644 --- a/src/test/java/org/springframework/data/jpa/mapping/JpaMetamodelMappingContextIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/mapping/JpaMetamodelMappingContextIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -113,10 +113,7 @@ public class JpaMetamodelMappingContextIntegrationTests { assertThat(property.isEntity(), is(false)); } - /** - * @see DATAJPA-608 - */ - @Test + @Test // DATAJPA-608 public void detectsEntityPropertyForCollections() { JpaPersistentEntityImpl entity = context.getPersistentEntity(User.class); @@ -125,10 +122,7 @@ public class JpaMetamodelMappingContextIntegrationTests { assertThat(entity.getPersistentProperty("colleagues").isEntity(), is(true)); } - /** - * @see DATAJPA-630 - */ - @Test + @Test // DATAJPA-630 public void lookingUpIdentifierOfProxyDoesNotInitializeProxy() { TransactionTemplate template = new TransactionTemplate(transactionManager); diff --git a/src/test/java/org/springframework/data/jpa/mapping/JpaMetamodelMappingContextUnitTests.java b/src/test/java/org/springframework/data/jpa/mapping/JpaMetamodelMappingContextUnitTests.java index 9f9207934..fbbe713b4 100644 --- a/src/test/java/org/springframework/data/jpa/mapping/JpaMetamodelMappingContextUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/mapping/JpaMetamodelMappingContextUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 the original author or authors. + * Copyright 2015-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,10 +31,7 @@ import org.springframework.data.annotation.Version; */ public class JpaMetamodelMappingContextUnitTests { - /** - * @see DATAJPA-775 - */ - @Test + @Test // DATAJPA-775 public void jpaPersistentEntityRejectsSprignDataAtVersionAnnotation() { Metamodel metamodel = mock(Metamodel.class); diff --git a/src/test/java/org/springframework/data/jpa/mapping/JpaPersistentPropertyImplUnitTests.java b/src/test/java/org/springframework/data/jpa/mapping/JpaPersistentPropertyImplUnitTests.java index be1c05158..c0c5965af 100644 --- a/src/test/java/org/springframework/data/jpa/mapping/JpaPersistentPropertyImplUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/mapping/JpaPersistentPropertyImplUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,62 +63,41 @@ public class JpaPersistentPropertyImplUnitTests { entity = context.getPersistentEntity(Sample.class); } - /** - * @see DATAJPA-284 - */ - @Test + @Test // DATAJPA-284 public void considersOneToOneMappedPropertyAnAssociation() { JpaPersistentProperty property = entity.getPersistentProperty("other"); assertThat(property.isAssociation(), is(true)); } - /** - * @see DATAJPA-376 - */ - @Test + @Test // DATAJPA-376 public void considersJpaTransientFieldsAsTransient() { assertThat(entity.getPersistentProperty("transientProp"), is(nullValue())); } - /** - * @see DATAJPA-484 - */ - @Test + @Test // DATAJPA-484 public void considersEmbeddableAnEntity() { assertThat(context.getPersistentEntity(SampleEmbeddable.class), is(notNullValue())); } - /** - * @see DATAJPA-484 - */ - @Test + @Test // DATAJPA-484 public void considersEmbeddablePropertyAnAssociation() { assertThat(entity.getPersistentProperty("embeddable").isAssociation(), is(true)); } - /** - * @see DATAJPA-484 - */ - @Test + @Test // DATAJPA-484 public void considersEmbeddedPropertyAnAssociation() { assertThat(entity.getPersistentProperty("embedded").isAssociation(), is(true)); } - /** - * @see DATAJPA-619 - */ - @Test + @Test // DATAJPA-619 public void considersPropertyLevelAccessTypeDefinitions() { assertThat(getProperty(PropertyLevelPropertyAccess.class, "field").usePropertyAccess(), is(false)); assertThat(getProperty(PropertyLevelPropertyAccess.class, "property").usePropertyAccess(), is(true)); } - /** - * @see DATAJPA-619 - */ - @Test + @Test // DATAJPA-619 public void propertyLevelAccessTypeTrumpsTypeLevelDefinition() { assertThat(getProperty(PropertyLevelDefinitionTrumpsTypeLevelOne.class, "field").usePropertyAccess(), is(false)); @@ -128,42 +107,27 @@ public class JpaPersistentPropertyImplUnitTests { assertThat(getProperty(PropertyLevelDefinitionTrumpsTypeLevelOne2.class, "property").usePropertyAccess(), is(true)); } - /** - * @see DATAJPA-619 - */ - @Test + @Test // DATAJPA-619 public void considersJpaAccessDefinitionAnnotations() { assertThat(getProperty(TypeLevelPropertyAccess.class, "id").usePropertyAccess(), is(true)); } - /** - * @see DATAJPA-619 - */ - @Test + @Test // DATAJPA-619 public void springDataAnnotationTrumpsJpaIfBothOnTypeLevel() { assertThat(getProperty(CompetingTypeLevelAnnotations.class, "id").usePropertyAccess(), is(false)); } - /** - * @see DATAJPA-619 - */ - @Test + @Test // DATAJPA-619 public void springDataAnnotationTrumpsJpaIfBothOnPropertyLevel() { assertThat(getProperty(CompetingPropertyLevelAnnotations.class, "id").usePropertyAccess(), is(false)); } - /** - * @see DATAJPA-605 - */ - @Test + @Test // DATAJPA-605 public void detectsJpaVersionAnnotation() { assertThat(getProperty(JpaVersioned.class, "version").isVersionProperty(), is(true)); } - /** - * @see DATAJPA-664 - */ - @Test + @Test // DATAJPA-664 @SuppressWarnings("rawtypes") public void considersTargetEntityTypeForPropertyType() { @@ -177,19 +141,13 @@ public class JpaPersistentPropertyImplUnitTests { assertThat(entityType.iterator().next(), is((TypeInformation) ClassTypeInformation.from(Implementation.class))); } - /** - * @see DATAJPA-716 - */ - @Test + @Test // DATAJPA-716 public void considersNonUpdateablePropertyNotWriteable() { assertThat(getProperty(WithReadOnly.class, "name").isWritable(), is(false)); assertThat(getProperty(WithReadOnly.class, "updatable").isWritable(), is(true)); } - /** - * @see DATAJPA-904 - */ - @Test + @Test // DATAJPA-904 public void isEntityWorksEvenWithManagedTypeWithNullJavaType() { ManagedType managedType = mock(ManagedType.class); diff --git a/src/test/java/org/springframework/data/jpa/provider/PersistenceProviderIntegrationTests.java b/src/test/java/org/springframework/data/jpa/provider/PersistenceProviderIntegrationTests.java index c72792c09..4b0ee12b3 100644 --- a/src/test/java/org/springframework/data/jpa/provider/PersistenceProviderIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/provider/PersistenceProviderIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -74,10 +74,7 @@ public class PersistenceProviderIntegrationTests { this.category = categories.save(new Category(product)); } - /** - * @see DATAJPA-630 - */ - @Test + @Test // DATAJPA-630 public void testname() { new TransactionTemplate(transactionManager).execute(new TransactionCallback() { diff --git a/src/test/java/org/springframework/data/jpa/provider/PersistenceProviderUnitTests.java b/src/test/java/org/springframework/data/jpa/provider/PersistenceProviderUnitTests.java index 9f6c84d68..7da11970b 100644 --- a/src/test/java/org/springframework/data/jpa/provider/PersistenceProviderUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/provider/PersistenceProviderUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2015 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,10 +50,7 @@ public class PersistenceProviderUnitTests { this.shadowingClassLoader = new ShadowingClassLoader(getClass().getClassLoader()); } - /** - * @see DATAJPA-444 - */ - @Test + @Test // DATAJPA-444 public void detectsHibernatePersistenceProviderForHibernateVersionLessThan4Dot3() throws Exception { shadowingClassLoader.excludePackage("org.hibernate"); @@ -63,10 +60,7 @@ public class PersistenceProviderUnitTests { assertThat(fromEntityManager(em), is(HIBERNATE)); } - /** - * @see DATAJPA-444 - */ - @Test + @Test // DATAJPA-444 public void detectsHibernatePersistenceProviderForHibernateVersionGreaterEqual4dot3() throws Exception { shadowingClassLoader.excludePackage("org.hibernate"); @@ -104,10 +98,7 @@ public class PersistenceProviderUnitTests { assertThat(fromEntityManager(em), is(GENERIC_JPA)); } - /** - * @see DATAJPA-1019 - */ - @Test + @Test // DATAJPA-1019 public void detectsHibernatePersistenceProviderForHibernateVersion52() throws Exception { Assume.assumeThat(Version.getVersionString(), startsWith("5.2")); diff --git a/src/test/java/org/springframework/data/jpa/repository/AbstractPersistableIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/AbstractPersistableIntegrationTests.java index 79880b914..33eb12b68 100644 --- a/src/test/java/org/springframework/data/jpa/repository/AbstractPersistableIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/AbstractPersistableIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,10 +44,7 @@ public class AbstractPersistableIntegrationTests { @Autowired CustomAbstractPersistableRepository repository; @Autowired EntityManager em; - /** - * @see DATAJPA-622 - */ - @Test + @Test // DATAJPA-622 public void shouldBeAbleToSaveAndLoadCustomPersistableWithUuidId() { CustomAbstractPersistable entity = new CustomAbstractPersistable(); @@ -57,10 +54,7 @@ public class AbstractPersistableIntegrationTests { assertThat(found, is(saved)); } - /** - * @see DATAJPA-848 - */ - @Test + @Test // DATAJPA-848 public void equalsWorksForProxiedEntities() { CustomAbstractPersistable entity = repository.saveAndFlush(new CustomAbstractPersistable()); diff --git a/src/test/java/org/springframework/data/jpa/repository/CrudMethodMetadataUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/CrudMethodMetadataUnitTests.java index 3302f930e..d5b904e86 100644 --- a/src/test/java/org/springframework/data/jpa/repository/CrudMethodMetadataUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/CrudMethodMetadataUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2016 the original author or authors. + * Copyright 2011-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -82,10 +82,7 @@ public class CrudMethodMetadataUnitTests { repository = factory.getRepository(RoleRepository.class); } - /** - * @see DATAJPA-73, DATAJPA-173 - */ - @Test + @Test // DATAJPA-73, DATAJPA-173 public void usesLockInformationAnnotatedAtRedeclaredMethod() { when(em.getCriteriaBuilder()).thenReturn(builder); @@ -99,10 +96,7 @@ public class CrudMethodMetadataUnitTests { verify(typedQuery).setHint("foo", "bar"); } - /** - * @see DATAJPA-359, DATAJPA-173 - */ - @Test + @Test // DATAJPA-359, DATAJPA-173 public void usesMetadataAnnotatedAtRedeclaredFindOne() { repository.findOne(1); @@ -113,10 +107,7 @@ public class CrudMethodMetadataUnitTests { verify(em).find(Role.class, 1, expectedLockModeType, expectedLinks); } - /** - * @see DATAJPA-574 - */ - @Test + @Test // DATAJPA-574 public void appliesLockModeAndQueryHintsToQuerydslQuery() { when(em.getDelegate()).thenReturn(mock(EntityManager.class)); diff --git a/src/test/java/org/springframework/data/jpa/repository/CustomAbstractPersistableIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/CustomAbstractPersistableIntegrationTests.java index f224273c8..0bc1d90e3 100644 --- a/src/test/java/org/springframework/data/jpa/repository/CustomAbstractPersistableIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/CustomAbstractPersistableIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,10 +38,7 @@ public class CustomAbstractPersistableIntegrationTests { @Autowired CustomAbstractPersistableRepository repository; - /** - * @see DATAJPA-622 - */ - @Test + @Test // DATAJPA-622 public void shouldBeAbleToSaveAndLoadCustomPersistableWithUuidId() { CustomAbstractPersistable entity = new CustomAbstractPersistable(); diff --git a/src/test/java/org/springframework/data/jpa/repository/EntityGraphRepositoryMethodsIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/EntityGraphRepositoryMethodsIntegrationTests.java index c23f16c80..a2afe7734 100644 --- a/src/test/java/org/springframework/data/jpa/repository/EntityGraphRepositoryMethodsIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/EntityGraphRepositoryMethodsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,10 +73,7 @@ public class EntityGraphRepositoryMethodsIntegrationTests { tom.getColleagues().add(ollie); } - /** - * @see DATAJPA-612 - */ - @Test + @Test // DATAJPA-612 public void shouldRespectConfiguredJpaEntityGraph() { Assume.assumeTrue(currentEntityManagerIsAJpa21EntityManager(em)); @@ -88,10 +85,7 @@ public class EntityGraphRepositoryMethodsIntegrationTests { assertThat(result.get(0), is(tom)); } - /** - * @see DATAJPA-689 - */ - @Test + @Test // DATAJPA-689 public void shouldRespectConfiguredJpaEntityGraphInFindOne() { Assume.assumeTrue(currentEntityManagerIsAJpa21EntityManager(em)); @@ -103,10 +97,7 @@ public class EntityGraphRepositoryMethodsIntegrationTests { Persistence.getPersistenceUtil().isLoaded(user.getColleagues()), is(true)); } - /** - * @see DATAJPA-696 - */ - @Test + @Test // DATAJPA-696 public void shouldRespectInferFetchGraphFromMethodName() { Assume.assumeTrue(currentEntityManagerIsAJpa21EntityManager(em)); @@ -118,10 +109,7 @@ public class EntityGraphRepositoryMethodsIntegrationTests { Persistence.getPersistenceUtil().isLoaded(user.getColleagues()), is(true)); } - /** - * @see DATAJPA-696 - */ - @Test + @Test // DATAJPA-696 public void shouldRespectDynamicFetchGraphForGetOneWithAttributeNamesById() { Assume.assumeTrue(currentEntityManagerIsAJpa21EntityManager(em)); @@ -133,10 +121,7 @@ public class EntityGraphRepositoryMethodsIntegrationTests { Persistence.getPersistenceUtil().isLoaded(user.getColleagues()), is(true)); } - /** - * @see DATAJPA-790 - */ - @Test + @Test // DATAJPA-790 public void shouldRespectConfiguredJpaEntityGraphWithPaginationAndQueryDslPredicates() { Assume.assumeTrue(currentEntityManagerIsAJpa21EntityManager(em)); diff --git a/src/test/java/org/springframework/data/jpa/repository/JavaConfigUserRepositoryTests.java b/src/test/java/org/springframework/data/jpa/repository/JavaConfigUserRepositoryTests.java index 0a1f1428b..8e6be50e0 100644 --- a/src/test/java/org/springframework/data/jpa/repository/JavaConfigUserRepositoryTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/JavaConfigUserRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2015 the original author or authors. + * Copyright 2012-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -99,10 +99,7 @@ public class JavaConfigUserRepositoryTests extends UserRepositoryTests { } } - /** - * @see DATAJPA-317 - */ - @Test(expected = NoSuchBeanDefinitionException.class) + @Test(expected = NoSuchBeanDefinitionException.class) // DATAJPA-317 public void doesNotPickUpJpaRepository() { ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(JpaRepositoryConfig.class); diff --git a/src/test/java/org/springframework/data/jpa/repository/MappedTypeRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/MappedTypeRepositoryIntegrationTests.java index 3889b0882..144c69c60 100644 --- a/src/test/java/org/springframework/data/jpa/repository/MappedTypeRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/MappedTypeRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,10 +49,7 @@ public class MappedTypeRepositoryIntegrationTests { @Autowired ConcreteRepository1 concreteRepository1; @Autowired ConcreteRepository2 concreteRepository2; - /** - * @see DATAJPA-170 - */ - @Test + @Test // DATAJPA-170 public void supportForExpressionBasedQueryMethods() { concreteRepository1.save(new ConcreteType1("foo")); @@ -65,10 +62,7 @@ public class MappedTypeRepositoryIntegrationTests { assertThat(concretes2.size(), is(1)); } - /** - * @see DATAJPA-424 - */ - @Test + @Test // DATAJPA-424 public void supportForPaginationCustomQueryMethodsWithEntityExpression() { concreteRepository1.save(new ConcreteType1("foo")); diff --git a/src/test/java/org/springframework/data/jpa/repository/ParentRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/ParentRepositoryIntegrationTests.java index 3990c6d13..4054c2f07 100644 --- a/src/test/java/org/springframework/data/jpa/repository/ParentRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/ParentRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2014 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,10 +59,7 @@ public class ParentRepositoryIntegrationTests { repository.flush(); } - /** - * @see DATAJPA-287 - */ - @Test + @Test // DATAJPA-287 public void testWithoutJoin() throws Exception { Page page = repository.findAll(new Specification() { @@ -82,10 +79,7 @@ public class ParentRepositoryIntegrationTests { assertThat(page.getTotalPages(), is(1)); } - /** - * @see DATAJPA-287 - */ - @Test + @Test // DATAJPA-287 public void testWithJoin() throws Exception { Page page = repository.findAll(new Specification() { public Predicate toPredicate(Root root, CriteriaQuery query, CriteriaBuilder cb) { diff --git a/src/test/java/org/springframework/data/jpa/repository/RedeclaringRepositoryMethodsTests.java b/src/test/java/org/springframework/data/jpa/repository/RedeclaringRepositoryMethodsTests.java index 844ce929c..1ef00e9ce 100644 --- a/src/test/java/org/springframework/data/jpa/repository/RedeclaringRepositoryMethodsTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/RedeclaringRepositoryMethodsTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,10 +52,7 @@ public class RedeclaringRepositoryMethodsTests { tom = new User("Thomas", "Darimont", "tdarimont@gopivotal.com"); } - /** - * @see DATAJPA-398 - */ - @Test + @Test // DATAJPA-398 public void adjustedWellKnownPagedFindAllMethodShouldReturnOnlyTheUserWithFirstnameOliver() { ollie = repository.save(ollie); @@ -67,10 +64,7 @@ public class RedeclaringRepositoryMethodsTests { assertThat(page.getContent().get(0).getFirstname(), is("Oliver")); } - /** - * @see DATAJPA-398 - */ - @Test + @Test // DATAJPA-398 public void adjustedWllKnownFindAllMethodShouldReturnAnEmptyList() { ollie = repository.save(ollie); diff --git a/src/test/java/org/springframework/data/jpa/repository/RepositoryWithCompositeKeyTests.java b/src/test/java/org/springframework/data/jpa/repository/RepositoryWithCompositeKeyTests.java index e70db179b..39bad67e4 100644 --- a/src/test/java/org/springframework/data/jpa/repository/RepositoryWithCompositeKeyTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/RepositoryWithCompositeKeyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,10 +61,9 @@ public class RepositoryWithCompositeKeyTests { @Autowired EmployeeRepositoryWithEmbeddedId employeeRepositoryWithEmbeddedId; /** - * @see DATAJPA-269 * @see Final JPA 2.0 Specification 2.4.1.3 Derived Identities Example 2 */ - @Test + @Test // DATAJPA-269 public void shouldSupportSavingEntitiesWithCompositeKeyClassesWithIdClassAndDerivedIdentities() { IdClassExampleDepartment dep = new IdClassExampleDepartment(); @@ -87,10 +86,9 @@ public class RepositoryWithCompositeKeyTests { } /** - * @see DATAJPA-269 * @see Final JPA 2.0 Specification 2.4.1.3 Derived Identities Example 3 */ - @Test + @Test // DATAJPA-269 public void shouldSupportSavingEntitiesWithCompositeKeyClassesWithEmbeddedIdsAndDerivedIdentities() { EmbeddedIdExampleDepartment dep = new EmbeddedIdExampleDepartment(); @@ -113,11 +111,7 @@ public class RepositoryWithCompositeKeyTests { assertThat(persistedEmp.getDepartment().getName(), is(dep.getName())); } - /** - * @see DATAJPA-472 - * @see DATAJPA-912 - */ - @Test + @Test // DATAJPA-472, DATAJPA-912 public void shouldSupportFindAllWithPageableAndEntityWithIdClass() throws Exception { if (Package.getPackage("org.hibernate.cfg").getImplementationVersion().startsWith("4.1.")) { @@ -141,10 +135,7 @@ public class RepositoryWithCompositeKeyTests { assertThat(page.getTotalElements(), is(1L)); } - /** - * @see DATAJPA-497 - */ - @Test + @Test // DATAJPA-497 public void sortByEmbeddedPkFieldInCompositePkWithEmbeddedIdInQueryDsl() { EmbeddedIdExampleDepartment dep1 = new EmbeddedIdExampleDepartment(); @@ -180,10 +171,7 @@ public class RepositoryWithCompositeKeyTests { assertThat(result.get(1), is(emp1)); } - /** - * @see DATAJPA-497 - */ - @Test + @Test // DATAJPA-497 public void sortByEmbeddedPkFieldInCompositePkWithIdClassInQueryDsl() { IdClassExampleDepartment dep1 = new IdClassExampleDepartment(); @@ -219,10 +207,7 @@ public class RepositoryWithCompositeKeyTests { assertThat(result.get(1), is(emp1)); } - /** - * @see DATAJPA-527 - */ - @Test + @Test // DATAJPA-527 public void testExistsWithIdClass() { IdClassExampleDepartment dep = new IdClassExampleDepartment(); @@ -241,10 +226,7 @@ public class RepositoryWithCompositeKeyTests { assertThat(employeeRepositoryWithIdClass.exists(key), is(true)); } - /** - * @see DATAJPA-527 - */ - @Test + @Test // DATAJPA-527 public void testExistsWithEmbeddedId() { EmbeddedIdExampleDepartment dep1 = new EmbeddedIdExampleDepartment(); @@ -267,10 +249,7 @@ public class RepositoryWithCompositeKeyTests { assertThat(employeeRepositoryWithEmbeddedId.exists(key), is(true)); } - /** - * @see DATAJPA-611 - */ - @Test + @Test // DATAJPA-611 public void shouldAllowFindAllWithIdsForEntitiesWithCompoundIdClassKeys() { IdClassExampleDepartment dep2 = new IdClassExampleDepartment(); @@ -304,10 +283,7 @@ public class RepositoryWithCompositeKeyTests { assertThat(result, hasSize(2)); } - /** - * @see DATAJPA-920 - */ - @Test + @Test // DATAJPA-920 public void shouldExecuteExistsQueryForEntitiesWithEmbeddedId() { EmbeddedIdExampleDepartment dep1 = new EmbeddedIdExampleDepartment(); @@ -328,10 +304,7 @@ public class RepositoryWithCompositeKeyTests { assertThat(employeeRepositoryWithEmbeddedId.existsByName(emp.getName()), is(true)); } - /** - * @see DATAJPA-920 - */ - @Test + @Test // DATAJPA-920 public void shouldExecuteExistsQueryForEntitiesWithCompoundIdClassKeys() { IdClassExampleDepartment dep2 = new IdClassExampleDepartment(); diff --git a/src/test/java/org/springframework/data/jpa/repository/RepositoryWithIdClassKeyTests.java b/src/test/java/org/springframework/data/jpa/repository/RepositoryWithIdClassKeyTests.java index 8ac72b9e5..5af4d8326 100644 --- a/src/test/java/org/springframework/data/jpa/repository/RepositoryWithIdClassKeyTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/RepositoryWithIdClassKeyTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,10 +69,9 @@ public class RepositoryWithIdClassKeyTests { } /** - * @see DATAJPA-413 * @see Final JPA 2.1 Specification 2.4.1.3 Derived Identities Example 2 */ - @Test + @Test // DATAJPA-413 public void shouldSaveAndLoadEntitiesWithDerivedIdentities() throws Exception { Site site = siteRepository.save(new Site()); diff --git a/src/test/java/org/springframework/data/jpa/repository/RoleRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/RoleRepositoryIntegrationTests.java index e9db15183..83900284b 100644 --- a/src/test/java/org/springframework/data/jpa/repository/RoleRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/RoleRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2014 the original author or authors. + * Copyright 2011-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,10 +63,7 @@ public class RoleRepositoryIntegrationTests { assertThat(repository.findOne(result.getId()), is(reference)); } - /** - * @see DATAJPA-509 - */ - @Test + @Test // DATAJPA-509 public void shouldUseExplicitlyConfiguredEntityNameInOrmXmlInCountQueries() { Role reference = new Role("ADMIN"); @@ -75,10 +72,7 @@ public class RoleRepositoryIntegrationTests { assertThat(repository.count(), is(1L)); } - /** - * @see DATAJPA-509 - */ - @Test + @Test // DATAJPA-509 public void shouldUseExplicitlyConfiguredEntityNameInOrmXmlInExistsQueries() { Role reference = new Role("ADMIN"); @@ -87,10 +81,7 @@ public class RoleRepositoryIntegrationTests { assertThat(repository.exists(reference.getId()), is(true)); } - /** - * @see DATAJPA-509 - */ - @Test + @Test // DATAJPA-509 public void shouldUseExplicitlyConfiguredEntityNameInDerivedCountQueries() { Role reference = new Role("ADMIN"); diff --git a/src/test/java/org/springframework/data/jpa/repository/StoredProcedureIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/StoredProcedureIntegrationTests.java index 0ab282a6f..3fcc5b16a 100644 --- a/src/test/java/org/springframework/data/jpa/repository/StoredProcedureIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/StoredProcedureIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 the original author or authors. + * Copyright 2015-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,34 +71,22 @@ public class StoredProcedureIntegrationTests { assumeTrue(currentEntityManagerIsAJpa21EntityManager(em)); } - /** - * @see DATAJPA-652 - */ - @Test + @Test // DATAJPA-652 public void shouldExecuteAdHocProcedureWithNoInputAnd1OutputParameter() { assertThat(repository.adHocProcedureWithNoInputAnd1OutputParameter(), is(42)); } - /** - * @see DATAJPA-652 - */ - @Test + @Test // DATAJPA-652 public void shouldExecuteAdHocProcedureWith1InputAnd1OutputParameter() { assertThat(repository.adHocProcedureWith1InputAnd1OutputParameter(23), is(24)); } - /** - * @see DATAJPA-652 - */ - @Test + @Test // DATAJPA-652 public void shouldExecuteAdHocProcedureWith1InputAndNoOutputParameter() { repository.adHocProcedureWith1InputAndNoOutputParameter(42); } - /** - * @see DATAJPA-652 - */ - @Test + @Test // DATAJPA-652 @Ignore(NOT_SUPPORTED) public void shouldExecuteAdHocProcedureWith1InputAnd1OutputParameterWithResultSet() { @@ -108,10 +96,7 @@ public class StoredProcedureIntegrationTests { assertThat(dummies.size(), is(equalTo(3))); } - /** - * @see DATAJPA-652 - */ - @Test + @Test // DATAJPA-652 @Ignore(NOT_SUPPORTED) public void shouldExecuteAdHocProcedureWith1InputAnd1OutputParameterWithResultSetWithUpdate() { @@ -121,42 +106,27 @@ public class StoredProcedureIntegrationTests { assertThat(dummies.size(), is(equalTo(3))); } - /** - * @see DATAJPA-652 - */ - @Test + @Test // DATAJPA-652 public void shouldExecuteAdHocProcedureWith1InputAnd1OutputParameterWithUpdate() { repository.adHocProcedureWith1InputAndNoOutputParameterWithUpdate("FOO"); } - /** - * @see DATAJPA-652 - */ - @Test + @Test // DATAJPA-652 public void shouldExecuteProcedureWithNoInputAnd1OutputParameter() { assertThat(repository.procedureWithNoInputAnd1OutputParameter(), is(42)); } - /** - * @see DATAJPA-652 - */ - @Test + @Test // DATAJPA-652 public void shouldExecuteProcedureWith1InputAnd1OutputParameter() { assertThat(repository.procedureWith1InputAnd1OutputParameter(23), is(24)); } - /** - * @see DATAJPA-652 - */ - @Test + @Test // DATAJPA-652 public void shouldExecuteProcedureWith1InputAndNoOutputParameter() { repository.procedureWith1InputAndNoOutputParameter(42); } - /** - * @see DATAJPA-652 - */ - @Test + @Test // DATAJPA-652 @Ignore(NOT_SUPPORTED) public void shouldExecuteProcedureWith1InputAnd1OutputParameterWithResultSet() { @@ -166,10 +136,7 @@ public class StoredProcedureIntegrationTests { assertThat(dummies.size(), is(equalTo(3))); } - /** - * @see DATAJPA-652 - */ - @Test + @Test // DATAJPA-652 @Ignore(NOT_SUPPORTED) public void shouldExecuteProcedureWith1InputAnd1OutputParameterWithResultSetWithUpdate() { @@ -179,10 +146,7 @@ public class StoredProcedureIntegrationTests { assertThat(dummies.size(), is(equalTo(3))); } - /** - * @see DATAJPA-652 - */ - @Test + @Test // DATAJPA-652 public void shouldExecuteProcedureWith1InputAnd1OutputParameterWithUpdate() { repository.procedureWith1InputAndNoOutputParameterWithUpdate("FOO"); } diff --git a/src/test/java/org/springframework/data/jpa/repository/UserRepositoryFinderTests.java b/src/test/java/org/springframework/data/jpa/repository/UserRepositoryFinderTests.java index 1333c0e29..193d83fd2 100644 --- a/src/test/java/org/springframework/data/jpa/repository/UserRepositoryFinderTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/UserRepositoryFinderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2016 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -147,40 +147,28 @@ public class UserRepositoryFinderTests { assertThat(result.get(0), is(oliver)); } - /** - * @see DATAJPA-92 - */ - @Test + @Test // DATAJPA-92 public void findsByLastnameIgnoringCase() throws Exception { List result = userRepository.findByLastnameIgnoringCase("BeAUfoRd"); assertThat(result.size(), is(1)); assertThat(result.get(0), is(carter)); } - /** - * @see DATAJPA-92 - */ - @Test + @Test // DATAJPA-92 public void findsByLastnameIgnoringCaseLike() throws Exception { List result = userRepository.findByLastnameIgnoringCaseLike("BeAUfo%"); assertThat(result.size(), is(1)); assertThat(result.get(0), is(carter)); } - /** - * @see DATAJPA-92 - */ - @Test + @Test // DATAJPA-92 public void findByLastnameAndFirstnameAllIgnoringCase() throws Exception { List result = userRepository.findByLastnameAndFirstnameAllIgnoringCase("MaTTheWs", "DaVe"); assertThat(result.size(), is(1)); assertThat(result.get(0), is(dave)); } - /** - * @see DATAJPA-94 - */ - @Test + @Test // DATAJPA-94 public void respectsPageableOrderOnQueryGenerateFromMethodName() throws Exception { Page ascending = userRepository.findByLastnameIgnoringCase(new PageRequest(0, 10, new Sort(ASC, "firstname")), "Matthews"); @@ -196,10 +184,7 @@ public class UserRepositoryFinderTests { is(equalTo(descending.getContent().get(0).getFirstname()))); } - /** - * @see DATAJPA-486 - */ - @Test + @Test // DATAJPA-486 public void executesQueryToSlice() { Slice slice = userRepository.findSliceByLastname("Matthews", new PageRequest(0, 1, ASC, "firstname")); @@ -208,18 +193,12 @@ public class UserRepositoryFinderTests { assertThat(slice.hasNext(), is(true)); } - /** - * @see DATAJPA-830 - */ - @Test + @Test // DATAJPA-830 public void executesMethodWithNotContainingOnStringCorrectly() { assertThat(userRepository.findByLastnameNotContaining("u"), containsInAnyOrder(dave, oliver)); } - /** - * @see DATAJPA-829 - */ - @Test + @Test // DATAJPA-829 public void translatesContainsToMemberOf() { List singers = userRepository.findByRolesContaining(singer); @@ -229,26 +208,17 @@ public class UserRepositoryFinderTests { assertThat(userRepository.findByRolesContaining(drummer), contains(carter)); } - /** - * @see DATAJPA-829 - */ - @Test + @Test // DATAJPA-829 public void translatesNotContainsToNotMemberOf() { assertThat(userRepository.findByRolesNotContaining(drummer), hasItems(dave, oliver)); } - /** - * @see DATAJPA-974 - */ - @Test + @Test // DATAJPA-974 public void executesQueryWithProjectionContainingReferenceToPluralAttribute() { assertThat(userRepository.findRolesAndFirstnameBy(), is(notNullValue())); } - /** - * @see DATAJPA-1023, DATACMNS-959 - */ - @Test(expected = InvalidDataAccessApiUsageException.class) + @Test(expected = InvalidDataAccessApiUsageException.class) // DATAJPA-1023, DATACMNS-959 @Transactional(propagation = Propagation.NOT_SUPPORTED) public void rejectsStreamExecutionIfNoSurroundingTransactionActive() { userRepository.findAllByCustomQueryAndStream(); diff --git a/src/test/java/org/springframework/data/jpa/repository/UserRepositoryStoredProcedureTests.java b/src/test/java/org/springframework/data/jpa/repository/UserRepositoryStoredProcedureTests.java index 6415df777..0982b4385 100644 --- a/src/test/java/org/springframework/data/jpa/repository/UserRepositoryStoredProcedureTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/UserRepositoryStoredProcedureTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,10 +50,7 @@ public class UserRepositoryStoredProcedureTests { @Autowired UserRepository repository; @PersistenceContext EntityManager em; - /** - * @see DATAJPA-455 - */ - @Test + @Test // DATAJPA-455 public void callProcedureWithInAndOutParameters() { assumeTrue(currentEntityManagerIsAJpa21EntityManager(em)); @@ -61,10 +58,7 @@ public class UserRepositoryStoredProcedureTests { assertThat(repository.plus1inout(1), is(2)); } - /** - * @see DATAJPA-455 - */ - @Test + @Test // DATAJPA-455 public void callProcedureExplicitNameWithInAndOutParameters() { assumeTrue(currentEntityManagerIsAJpa21EntityManager(em)); @@ -72,10 +66,7 @@ public class UserRepositoryStoredProcedureTests { assertThat(repository.explicitlyNamedPlus1inout(1), is(2)); } - /** - * @see DATAJPA-455 - */ - @Test + @Test // DATAJPA-455 public void entityAnnotatedCustomNamedProcedurePlus1IO() { assumeTrue(currentEntityManagerIsAJpa21EntityManager(em)); @@ -83,10 +74,7 @@ public class UserRepositoryStoredProcedureTests { assertThat(repository.entityAnnotatedCustomNamedProcedurePlus1IO(1), is(2)); } - /** - * @see DATAJPA-455 - */ - @Test + @Test // DATAJPA-455 @Ignore public void plainJpa21() { @@ -102,10 +90,7 @@ public class UserRepositoryStoredProcedureTests { assertThat(proc.getOutputParameterValue(2), is((Object) 2)); } - /** - * @see DATAJPA-455 - */ - @Test + @Test // DATAJPA-455 @Ignore public void plainJpa21_entityAnnotatedCustomNamedProcedurePlus1IO() { diff --git a/src/test/java/org/springframework/data/jpa/repository/UserRepositoryTests.java b/src/test/java/org/springframework/data/jpa/repository/UserRepositoryTests.java index 3a2ee4253..5bd6fff7c 100644 --- a/src/test/java/org/springframework/data/jpa/repository/UserRepositoryTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/UserRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2016 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -236,11 +236,7 @@ public class UserRepositoryTests { assertThat(result.get(3), is(fourthUser)); } - /** - * @see DATAJPA-296 - * @author Kevin Raymond - */ - @Test + @Test // DATAJPA-296 public void returnsAllIgnoreCaseSortedCorrectly() throws Exception { flushTestUsers(); @@ -360,10 +356,7 @@ public class UserRepositoryTests { assertThat(repository.count(), is(0L)); } - /** - * @see DATAJPA-137 - */ - @Test + @Test // DATAJPA-137 public void deleteAllInBatch() { flushTestUsers(); @@ -498,10 +491,7 @@ public class UserRepositoryTests { assertThat(repository.findAll(spec), hasSize(2)); } - /** - * @see DATAJPA-253 - */ - @Test + @Test // DATAJPA-253 public void executesNegatingSpecificationCorrectly() { flushTestUsers(); @@ -730,10 +720,7 @@ public class UserRepositoryTests { assertThat(result, hasItem(firstUser)); } - /** - * @see DATADOC-86 - */ - @Test + @Test // DATADOC-86 public void readsPageWithGroupByClauseCorrectly() { flushTestUsers(); @@ -762,10 +749,7 @@ public class UserRepositoryTests { assertThat(result, hasItems(secondUser, thirdUser)); } - /** - * @see DATAJPA-117 - */ - @Test + @Test // DATAJPA-117 public void executesNativeQueryCorrectly() { flushTestUsers(); @@ -776,10 +760,7 @@ public class UserRepositoryTests { assertThat(result.size(), is(1)); } - /** - * @see DATAJPA-132 - */ - @Test + @Test // DATAJPA-132 public void executesFinderWithTrueKeywordCorrectly() { flushTestUsers(); @@ -791,10 +772,7 @@ public class UserRepositoryTests { assertThat(result, hasItems(secondUser, thirdUser, fourthUser)); } - /** - * @see DATAJPA-132 - */ - @Test + @Test // DATAJPA-132 public void executesFinderWithFalseKeywordCorrectly() { flushTestUsers(); @@ -822,10 +800,7 @@ public class UserRepositoryTests { assertThat(result, hasItem(thirdUser)); } - /** - * @see DATAJPA-188 - */ - @Test + @Test // DATAJPA-188 public void executesFinderWithAfterKeywordCorrectly() { flushTestUsers(); @@ -835,10 +810,7 @@ public class UserRepositoryTests { assertThat(result, hasItems(thirdUser, fourthUser)); } - /** - * @see DATAJPA-188 - */ - @Test + @Test // DATAJPA-188 public void executesFinderWithBeforeKeywordCorrectly() { flushTestUsers(); @@ -848,10 +820,7 @@ public class UserRepositoryTests { assertThat(result, hasItems(firstUser, secondUser)); } - /** - * @see DATAJPA-180 - */ - @Test + @Test // DATAJPA-180 public void executesFinderWithStartingWithCorrectly() { flushTestUsers(); @@ -860,10 +829,7 @@ public class UserRepositoryTests { assertThat(result, hasItem(firstUser)); } - /** - * @see DATAJPA-180 - */ - @Test + @Test // DATAJPA-180 public void executesFinderWithEndingWithCorrectly() { flushTestUsers(); @@ -872,10 +838,7 @@ public class UserRepositoryTests { assertThat(result, hasItem(firstUser)); } - /** - * @see DATAJPA-180 - */ - @Test + @Test // DATAJPA-180 public void executesFinderWithContainingCorrectly() { flushTestUsers(); @@ -884,10 +847,7 @@ public class UserRepositoryTests { assertThat(result, hasItems(secondUser, thirdUser)); } - /** - * @see DATAJPA-201 - */ - @Test + @Test // DATAJPA-201 public void allowsExecutingPageableMethodWithNullPageable() { flushTestUsers(); @@ -905,10 +865,7 @@ public class UserRepositoryTests { assertThat(page.getContent(), hasItems(firstUser, secondUser, thirdUser, fourthUser)); } - /** - * @see DATAJPA-207 - */ - @Test + @Test // DATAJPA-207 public void executesNativeQueryForNonEntitiesCorrectly() { flushTestUsers(); @@ -919,10 +876,7 @@ public class UserRepositoryTests { assertThat(result, hasItem(1)); } - /** - * @see DATAJPA-232 - */ - @Test + @Test // DATAJPA-232 public void handlesIterableOfIdsCorrectly() { flushTestUsers(); @@ -993,10 +947,7 @@ public class UserRepositoryTests { assertThat(all.getContent().isEmpty(), is(false)); } - /** - * @see DATAJPA-252 - */ - @Test + @Test // DATAJPA-252 public void bindsSortingToOuterJoinCorrectly() { flushTestUsers(); @@ -1006,10 +957,7 @@ public class UserRepositoryTests { assertThat(result.getContent(), hasSize((int) repository.count())); } - /** - * @see DATAJPA-277 - */ - @Test + @Test // DATAJPA-277 public void doesNotDropNullValuesOnPagedSpecificationExecution() { flushTestUsers(); @@ -1024,10 +972,7 @@ public class UserRepositoryTests { assertThat(page, hasItem(firstUser)); } - /** - * @see DATAJPA-346 - */ - @Test + @Test // DATAJPA-346 public void shouldGenerateLeftOuterJoinInfindAllWithPaginationAndSortOnNestedPropertyPath() { firstUser.setManager(null); @@ -1046,10 +991,7 @@ public class UserRepositoryTests { assertThat(pages.getTotalElements(), is(4L)); } - /** - * @see DATAJPA-292 - */ - @Test + @Test // DATAJPA-292 public void executesManualQueryWithPositionLikeExpressionCorrectly() { flushTestUsers(); @@ -1060,10 +1002,7 @@ public class UserRepositoryTests { assertThat(result, hasItem(thirdUser)); } - /** - * @see DATAJPA-292 - */ - @Test + @Test // DATAJPA-292 public void executesManualQueryWithNamedLikeExpressionCorrectly() { flushTestUsers(); @@ -1074,10 +1013,7 @@ public class UserRepositoryTests { assertThat(result, hasItem(thirdUser)); } - /** - * @see DATAJPA-231 - */ - @Test + @Test // DATAJPA-231 public void executesDerivedCountQueryToLong() { flushTestUsers(); @@ -1085,10 +1021,7 @@ public class UserRepositoryTests { assertThat(repository.countByLastname("Matthews"), is(1L)); } - /** - * @see DATAJPA-231 - */ - @Test + @Test // DATAJPA-231 public void executesDerivedCountQueryToInt() { flushTestUsers(); @@ -1096,10 +1029,7 @@ public class UserRepositoryTests { assertThat(repository.countUsersByFirstname("Dave"), is(1)); } - /** - * @see DATAJPA-231 - */ - @Test + @Test // DATAJPA-231 public void executesDerivedExistsQuery() { flushTestUsers(); @@ -1108,20 +1038,14 @@ public class UserRepositoryTests { assertThat(repository.existsByLastname("Hans Peter"), is(false)); } - /** - * @see DATAJPA-332 - */ - @Test + @Test // DATAJPA-332 public void findAllReturnsEmptyIterableIfNoIdsGiven() { assertThat(repository.findAll(Collections. emptySet()), is(emptyIterable())); assertThat(repository.findAll((Iterable) null), is(emptyIterable())); } - /** - * @see DATAJPA-391 - */ - @Test + @Test // DATAJPA-391 public void executesManuallyDefinedQueryWithFieldProjection() { flushTestUsers(); @@ -1131,10 +1055,7 @@ public class UserRepositoryTests { assertThat(lastname, hasItem("Dave")); } - /** - * @see DATAJPA-83 - */ - @Test + @Test // DATAJPA-83 public void looksUpEntityReference() { flushTestUsers(); @@ -1143,10 +1064,7 @@ public class UserRepositoryTests { assertThat(result, is(firstUser)); } - /** - * @see DATAJPA-415 - */ - @Test + @Test // DATAJPA-415 public void invokesQueryWithVarargsParametersCorrectly() { flushTestUsers(); @@ -1157,10 +1075,7 @@ public class UserRepositoryTests { assertThat(result, hasItems(firstUser, secondUser)); } - /** - * @see DATAJPA-415 - */ - @Test + @Test // DATAJPA-415 public void shouldSupportModifyingQueryWithVarArgs() { flushTestUsers(); @@ -1173,10 +1088,7 @@ public class UserRepositoryTests { assertThat(repository.findByActiveTrue().size(), is(0)); } - /** - * @see DATAJPA-405 - */ - @Test + @Test // DATAJPA-405 public void executesFinderWithOrderClauseOnly() { flushTestUsers(); @@ -1187,10 +1099,7 @@ public class UserRepositoryTests { assertThat(result, contains(secondUser, firstUser, thirdUser, fourthUser)); } - /** - * @see DATAJPA-427 - */ - @Test + @Test // DATAJPA-427 public void sortByAssociationPropertyShouldUseLeftOuterJoin() { secondUser.getColleagues().add(firstUser); @@ -1202,10 +1111,7 @@ public class UserRepositoryTests { assertThat(result, hasSize(4)); } - /** - * @see DATAJPA-427 - */ - @Test + @Test // DATAJPA-427 public void sortByAssociationPropertyInPageableShouldUseLeftOuterJoin() { secondUser.getColleagues().add(firstUser); @@ -1217,10 +1123,7 @@ public class UserRepositoryTests { assertThat(page.getContent(), hasSize(4)); } - /** - * @see DATAJPA-427 - */ - @Test + @Test // DATAJPA-427 public void sortByEmbeddedProperty() { thirdUser.setAddress(new Address("Germany", "Saarbrücken", "HaveItYourWay", "123")); @@ -1232,10 +1135,7 @@ public class UserRepositoryTests { assertThat(page.getContent().get(3), is(thirdUser)); } - /** - * @see DATAJPA-454 - */ - @Test + @Test // DATAJPA-454 public void findsUserByBinaryDataReference() throws Exception { byte[] data = "Woho!!".getBytes("UTF-8"); @@ -1249,10 +1149,7 @@ public class UserRepositoryTests { assertThat(result.get(0).getBinaryData(), is(data)); } - /** - * @see DATAJPA-461 - */ - @Test + @Test // DATAJPA-461 public void customFindByQueryWithPositionalVarargsParameters() { flushTestUsers(); @@ -1263,10 +1160,7 @@ public class UserRepositoryTests { assertThat(result, hasItems(firstUser, secondUser)); } - /** - * @see DATAJPA-461 - */ - @Test + @Test // DATAJPA-461 public void customFindByQueryWithNamedVarargsParameters() { flushTestUsers(); @@ -1277,10 +1171,7 @@ public class UserRepositoryTests { assertThat(result, hasItems(firstUser, secondUser)); } - /** - * @see DATAJPA-464 - */ - @Test + @Test // DATAJPA-464 public void saveAndFlushShouldSupportReturningSubTypesOfRepositoryEntity() { repository.deleteAll(); @@ -1294,10 +1185,7 @@ public class UserRepositoryTests { assertThat(user.getEmailAddress(), is(savedUser.getEmailAddress())); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findAllByUntypedExampleShouldReturnSubTypesOfRepositoryEntity() { flushTestUsers(); @@ -1314,10 +1202,7 @@ public class UserRepositoryTests { assertThat(result, hasSize(5)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findAllByTypedUserExampleShouldReturnSubTypesOfRepositoryEntity() { flushTestUsers(); @@ -1334,10 +1219,7 @@ public class UserRepositoryTests { assertThat(result, hasSize(5)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findAllByTypedSpecialUserExampleShouldReturnSubTypesOfRepositoryEntity() { flushTestUsers(); @@ -1355,10 +1237,7 @@ public class UserRepositoryTests { assertThat(result, hasSize(1)); } - /** - * @see DATAJPA-491 - */ - @Test + @Test // DATAJPA-491 public void sortByNestedAssociationPropertyWithSortInPageable() { firstUser.setManager(thirdUser); @@ -1373,10 +1252,7 @@ public class UserRepositoryTests { assertThat(page.getContent().get(3), is(firstUser)); } - /** - * @see DATAJPA-510 - */ - @Test + @Test // DATAJPA-510 public void sortByNestedAssociationPropertyWithSortOrderIgnoreCaseInPageable() { firstUser.setManager(thirdUser); @@ -1391,10 +1267,7 @@ public class UserRepositoryTests { assertThat(page.getContent().get(3), is(firstUser)); } - /** - * @see DATAJPA-496 - */ - @Test + @Test // DATAJPA-496 public void findByElementCollectionAttribute() { firstUser.getAttributes().add("cool"); @@ -1409,10 +1282,7 @@ public class UserRepositoryTests { assertThat(result, hasItems(firstUser, secondUser)); } - /** - * @see DATAJPA-460 - */ - @Test + @Test // DATAJPA-460 public void deleteByShouldReturnListOfDeletedElementsWhenRetunTypeIsCollectionLike() { flushTestUsers(); @@ -1422,10 +1292,7 @@ public class UserRepositoryTests { assertThat(result, hasSize(1)); } - /** - * @see DATAJPA-460 - */ - @Test + @Test // DATAJPA-460 public void deleteByShouldRemoveElementsMatchingDerivedQuery() { flushTestUsers(); @@ -1434,10 +1301,7 @@ public class UserRepositoryTests { assertThat(repository.countByLastname(firstUser.getLastname()), is(0L)); } - /** - * @see DATAJPA-460 - */ - @Test + @Test // DATAJPA-460 public void deleteByShouldReturnNumberOfEntitiesRemovedIfReturnTypeIsLong() { flushTestUsers(); @@ -1445,10 +1309,7 @@ public class UserRepositoryTests { assertThat(repository.removeByLastname(firstUser.getLastname()), is(1L)); } - /** - * @see DATAJPA-460 - */ - @Test + @Test // DATAJPA-460 public void deleteByShouldReturnZeroInCaseNoEntityHasBeenRemovedAndReturnTypeIsNumber() { flushTestUsers(); @@ -1456,10 +1317,7 @@ public class UserRepositoryTests { assertThat(repository.removeByLastname("bubu"), is(0L)); } - /** - * @see DATAJPA-460 - */ - @Test + @Test // DATAJPA-460 public void deleteByShouldReturnEmptyListInCaseNoEntityHasBeenRemovedAndReturnTypeIsCollectionLike() { flushTestUsers(); @@ -1468,10 +1326,9 @@ public class UserRepositoryTests { } /** - * @see DATAJPA-505 * @see https://issues.apache.org/jira/browse/OPENJPA-2484 */ - @Test + @Test // DATAJPA-505 @Ignore public void findBinaryDataByIdJpaQl() throws Exception { @@ -1486,10 +1343,7 @@ public class UserRepositoryTests { assertThat(result, is(data)); } - /** - * @see DATAJPA-506 - */ - @Test + @Test // DATAJPA-506 public void findBinaryDataByIdNative() throws Exception { byte[] data = "Woho!!".getBytes("UTF-8"); @@ -1502,10 +1356,7 @@ public class UserRepositoryTests { assertThat(result, is(data)); } - /** - * @see DATAJPA-456 - */ - @Test + @Test // DATAJPA-456 public void findPaginatedExplicitQueryWithCountQueryProjection() { firstUser.setFirstname(null); @@ -1517,10 +1368,7 @@ public class UserRepositoryTests { assertThat(result.getContent().size(), is(3)); } - /** - * @see DATAJPA-456 - */ - @Test + @Test // DATAJPA-456 public void findPaginatedNamedQueryWithCountQueryProjection() { flushTestUsers(); @@ -1530,10 +1378,7 @@ public class UserRepositoryTests { assertThat(result.getContent().size(), is(1)); } - /** - * @see DATAJPA-551 - */ - @Test + @Test // DATAJPA-551 public void findOldestUser() { flushTestUsers(); @@ -1544,10 +1389,7 @@ public class UserRepositoryTests { assertThat(repository.findFirst1ByOrderByAgeDesc(), is(oldest)); } - /** - * @see DATAJPA-551 - */ - @Test + @Test // DATAJPA-551 public void findYoungestUser() { flushTestUsers(); @@ -1558,10 +1400,7 @@ public class UserRepositoryTests { assertThat(repository.findTop1ByOrderByAgeAsc(), is(youngest)); } - /** - * @see DATAJPA-551 - */ - @Test + @Test // DATAJPA-551 public void find2OldestUsers() { flushTestUsers(); @@ -1573,10 +1412,7 @@ public class UserRepositoryTests { assertThat(repository.findTop2ByOrderByAgeDesc(), hasItems(oldest1, oldest2)); } - /** - * @see DATAJPA-551 - */ - @Test + @Test // DATAJPA-551 public void find2YoungestUsers() { flushTestUsers(); @@ -1588,10 +1424,7 @@ public class UserRepositoryTests { assertThat(repository.findTop2UsersBy(new Sort(ASC, "age")), hasItems(youngest1, youngest2)); } - /** - * @see DATAJPA-551 - */ - @Test + @Test // DATAJPA-551 public void find3YoungestUsersPageableWithPageSize2() { flushTestUsers(); @@ -1607,10 +1440,7 @@ public class UserRepositoryTests { assertThat(secondPage.getContent(), hasItems(youngest3)); } - /** - * @see DATAJPA-551 - */ - @Test + @Test // DATAJPA-551 public void find2YoungestUsersPageableWithPageSize3() { flushTestUsers(); @@ -1626,10 +1456,7 @@ public class UserRepositoryTests { assertThat(secondPage.getContent(), hasItems(youngest3)); } - /** - * @see DATAJPA-551 - */ - @Test + @Test // DATAJPA-551 public void find3YoungestUsersPageableWithPageSize2Sliced() { flushTestUsers(); @@ -1645,10 +1472,7 @@ public class UserRepositoryTests { assertThat(secondPage.getContent(), hasItems(youngest3)); } - /** - * @see DATAJPA-551 - */ - @Test + @Test // DATAJPA-551 public void find2YoungestUsersPageableWithPageSize3Sliced() { flushTestUsers(); @@ -1664,10 +1488,7 @@ public class UserRepositoryTests { assertThat(secondPage.getContent(), hasItems(youngest3)); } - /** - * @see DATAJPA-912 - */ - @Test + @Test // DATAJPA-912 public void pageableQueryReportsTotalFromResult() { flushTestUsers(); @@ -1681,10 +1502,7 @@ public class UserRepositoryTests { assertThat(secondPage.getTotalElements(), is(4L)); } - /** - * @see DATAJPA-912 - */ - @Test + @Test // DATAJPA-912 public void pageableQueryReportsTotalFromCount() { flushTestUsers(); @@ -1698,10 +1516,7 @@ public class UserRepositoryTests { assertThat(secondPage.getTotalElements(), is(4L)); } - /** - * @see DATAJPA-506 - */ - @Test + @Test // DATAJPA-506 public void invokesQueryWithWrapperType() { flushTestUsers(); @@ -1712,10 +1527,7 @@ public class UserRepositoryTests { assertThat(result.get(), is(firstUser)); } - /** - * @see DATAJPA-564 - */ - @Test + @Test // DATAJPA-564 public void shouldFindUserByFirstnameAndLastnameWithSpelExpressionInStringBasedQuery() { flushTestUsers(); @@ -1725,10 +1537,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(firstUser)); } - /** - * @see DATAJPA-564 - */ - @Test + @Test // DATAJPA-564 public void shouldFindUserByLastnameWithSpelExpressionInStringBasedQuery() { flushTestUsers(); @@ -1738,10 +1547,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(firstUser)); } - /** - * @see DATAJPA-564 - */ - @Test + @Test // DATAJPA-564 public void shouldFindBySpELExpressionWithoutArgumentsWithQuestionmark() { flushTestUsers(); @@ -1751,10 +1557,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(firstUser)); } - /** - * @see DATAJPA-564 - */ - @Test + @Test // DATAJPA-564 public void shouldFindBySpELExpressionWithoutArgumentsWithColon() { flushTestUsers(); @@ -1764,10 +1567,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(firstUser)); } - /** - * @see DATAJPA-564 - */ - @Test + @Test // DATAJPA-564 public void shouldFindUsersByAgeForSpELExpression() { flushTestUsers(); @@ -1777,10 +1577,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(secondUser)); } - /** - * @see DATAJPA-564 - */ - @Test + @Test // DATAJPA-564 public void shouldfindUsersByFirstnameForSpELExpressionWithParameterNameVariableReference() { flushTestUsers(); @@ -1790,10 +1587,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(secondUser)); } - /** - * @see DATAJPA-564 - */ - @Test + @Test // DATAJPA-564 public void shouldFindCurrentUserWithCustomQueryDependingOnSecurityContext() { flushTestUsers(); @@ -1811,10 +1605,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(firstUser)); } - /** - * @see DATAJPA-564 - */ - @Test + @Test // DATAJPA-564 public void shouldFindByFirstnameAndCurrentUserWithCustomQuery() { flushTestUsers(); @@ -1826,10 +1617,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(secondUser)); } - /** - * @see DATAJPA-564 - */ - @Test + @Test // DATAJPA-564 public void shouldfindUsersByFirstnameForSpELExpressionOnlyWithParameterNameVariableReference() { flushTestUsers(); @@ -1839,10 +1627,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(secondUser)); } - /** - * @see DATAJPA-564 - */ - @Test + @Test // DATAJPA-564 public void shouldfindUsersByFirstnameForSpELExpressionOnlyWithParameterIndexReference() { flushTestUsers(); @@ -1852,10 +1637,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(secondUser)); } - /** - * @see DATAJPA-564 - */ - @Test + @Test // DATAJPA-564 public void shouldFindUsersInNativeQueryWithPagination() { flushTestUsers(); @@ -1873,10 +1655,7 @@ public class UserRepositoryTests { assertThat(users.getContent().get(1), is(fourthUser)); } - /** - * @see DATAJPA-629 - */ - @Test + @Test // DATAJPA-629 public void shouldfindUsersBySpELExpressionParametersWithSpelTemplateExpression() { flushTestUsers(); @@ -1887,10 +1666,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(secondUser)); } - /** - * @see DATAJPA-606 - */ - @Test + @Test // DATAJPA-606 public void findByEmptyCollectionOfStrings() throws Exception { flushTestUsers(); @@ -1899,10 +1675,7 @@ public class UserRepositoryTests { assertThat(users, hasSize(0)); } - /** - * @see DATAJPA-606 - */ - @Test + @Test // DATAJPA-606 public void findByEmptyCollectionOfIntegers() throws Exception { flushTestUsers(); @@ -1911,10 +1684,7 @@ public class UserRepositoryTests { assertThat(users, hasSize(0)); } - /** - * @see DATAJPA-606 - */ - @Test + @Test // DATAJPA-606 public void findByEmptyArrayOfIntegers() throws Exception { flushTestUsers(); @@ -1923,10 +1693,7 @@ public class UserRepositoryTests { assertThat(users, hasSize(0)); } - /** - * @see DATAJPA-606 - */ - @Test + @Test // DATAJPA-606 public void findByAgeWithEmptyArrayOfIntegersOrFirstName() { flushTestUsers(); @@ -1936,10 +1703,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(secondUser)); } - /** - * @see DATAJPA-677 - */ - @Test + @Test // DATAJPA-677 public void shouldSupportJava8StreamsForRepositoryFinderMethods() { flushTestUsers(); @@ -1965,10 +1729,7 @@ public class UserRepositoryTests { assertThat(users, hasSize(4)); } - /** - * @see DATAJPA-677 - */ - @Test + @Test // DATAJPA-677 public void shouldSupportJava8StreamsForRepositoryDerivedFinderMethods() { flushTestUsers(); @@ -1994,10 +1755,7 @@ public class UserRepositoryTests { assertThat(users, hasSize(4)); } - /** - * @see DATAJPA-677 - */ - @Test + @Test // DATAJPA-677 public void supportsJava8StreamForPageableMethod() { flushTestUsers(); @@ -2023,10 +1781,7 @@ public class UserRepositoryTests { assertThat(users, hasSize(2)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findAllByExample() { flushTestUsers(); @@ -2041,10 +1796,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(firstUser)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findAllByExampleWithEmptyProbe() { flushTestUsers(); @@ -2058,18 +1810,12 @@ public class UserRepositoryTests { assertThat(users, hasSize(4)); } - /** - * @see DATAJPA-218 - */ - @Test(expected = InvalidDataAccessApiUsageException.class) + @Test(expected = InvalidDataAccessApiUsageException.class) // DATAJPA-218 public void findAllByNullExample() { repository.findAll((Example) null); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findAllByExampleWithExcludedAttributes() { flushTestUsers(); @@ -2084,10 +1830,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(firstUser)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findAllByExampleWithAssociation() { flushTestUsers(); @@ -2112,10 +1855,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(firstUser)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findAllByExampleWithEmbedded() { flushTestUsers(); @@ -2134,10 +1874,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(firstUser)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findAllByExampleWithStartingStringMatcher() { flushTestUsers(); @@ -2153,10 +1890,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(firstUser)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findAllByExampleWithEndingStringMatcher() { flushTestUsers(); @@ -2172,10 +1906,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(firstUser)); } - /** - * @see DATAJPA-218 - */ - @Test(expected = InvalidDataAccessApiUsageException.class) + @Test(expected = InvalidDataAccessApiUsageException.class) // DATAJPA-218 public void findAllByExampleWithRegexStringMatcher() { flushTestUsers(); @@ -2187,10 +1918,7 @@ public class UserRepositoryTests { repository.findAll(example); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findAllByExampleWithIgnoreCase() { flushTestUsers(); @@ -2206,10 +1934,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(firstUser)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findAllByExampleWithStringMatcherAndIgnoreCase() { flushTestUsers(); @@ -2226,10 +1951,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(firstUser)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findAllByExampleWithIncludeNull() { // something is wrong with OpenJPA - I do not know what @@ -2260,10 +1982,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(fifthUser)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findAllByExampleWithPropertySpecifier() { flushTestUsers(); @@ -2280,10 +1999,7 @@ public class UserRepositoryTests { assertThat(users.get(0), is(firstUser)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findAllByExampleWithSort() { flushTestUsers(); @@ -2306,10 +2022,7 @@ public class UserRepositoryTests { assertThat(users.get(1), is(firstUser)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findAllByExampleWithPageable() { flushTestUsers(); @@ -2334,10 +2047,7 @@ public class UserRepositoryTests { assertThat(users.getTotalElements(), is(100L)); } - /** - * @see DATAJPA-218 - */ - @Test(expected = InvalidDataAccessApiUsageException.class) + @Test(expected = InvalidDataAccessApiUsageException.class) // DATAJPA-218 public void findAllByExampleShouldNotAllowCycles() { flushTestUsers(); @@ -2353,10 +2063,7 @@ public class UserRepositoryTests { repository.findAll(example, new PageRequest(0, 10, new Sort(DESC, "age"))); } - /** - * @see DATAJPA-218 - */ - @Test(expected = InvalidDataAccessApiUsageException.class) + @Test(expected = InvalidDataAccessApiUsageException.class) // DATAJPA-218 public void findAllByExampleShouldNotAllowCyclesOverSeveralInstances() { flushTestUsers(); @@ -2376,10 +2083,7 @@ public class UserRepositoryTests { repository.findAll(example, new PageRequest(0, 10, new Sort(DESC, "age"))); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void findOneByExampleWithExcludedAttributes() { flushTestUsers(); @@ -2393,10 +2097,7 @@ public class UserRepositoryTests { assertThat(users, is(firstUser)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void countByExampleWithExcludedAttributes() { flushTestUsers(); @@ -2410,10 +2111,7 @@ public class UserRepositoryTests { assertThat(count, is(1L)); } - /** - * @see DATAJPA-218 - */ - @Test + @Test // DATAJPA-218 public void existsByExampleWithExcludedAttributes() { flushTestUsers(); @@ -2427,10 +2125,7 @@ public class UserRepositoryTests { assertThat(exists, is(true)); } - /** - * @see DATAJPA-905 - */ - @Test + @Test // DATAJPA-905 public void excutesPagedSpecificationSettingAnOrder() { flushTestUsers(); diff --git a/src/test/java/org/springframework/data/jpa/repository/cdi/CdiExtensionIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/cdi/CdiExtensionIntegrationTests.java index 57c2afccd..cace66d73 100644 --- a/src/test/java/org/springframework/data/jpa/repository/cdi/CdiExtensionIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/cdi/CdiExtensionIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2014 the original author or authors. + * Copyright 2011-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -52,10 +52,7 @@ public class CdiExtensionIntegrationTests { LOGGER.debug("CDI container bootstrapped!"); } - /** - * @see DATAJPA-319 - */ - @Test + @Test // DATAJPA-319 @SuppressWarnings("rawtypes") public void foo() { @@ -75,20 +72,14 @@ public class CdiExtensionIntegrationTests { repositoryConsumer.findAll(); } - /** - * @see DATAJPA-584 - */ - @Test + @Test // DATAJPA-584 public void returnOneFromCustomImpl() { RepositoryConsumer repositoryConsumer = container.getInstance(RepositoryConsumer.class); assertThat(repositoryConsumer.returnOne(), is(1)); } - /** - * @see DATAJPA-584 - */ - @Test + @Test // DATAJPA-584 public void useQualifiedCustomizedUserRepo() { RepositoryConsumer repositoryConsumer = container.getInstance(RepositoryConsumer.class); diff --git a/src/test/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryExtensionUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryExtensionUnitTests.java index 3778e487e..5d23b583e 100644 --- a/src/test/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryExtensionUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/cdi/JpaRepositoryExtensionUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -66,10 +66,7 @@ public class JpaRepositoryExtensionUnitTests { assertEntityManagerRegistered(extension, em); } - /** - * @see DATAJPA-388 - */ - @Test + @Test // DATAJPA-388 public void alternativeEntityManagerOverridesDefault() { JpaRepositoryExtension extension = new JpaRepositoryExtension(); @@ -79,10 +76,7 @@ public class JpaRepositoryExtensionUnitTests { assertEntityManagerRegistered(extension, alternativeEm); } - /** - * @see DATAJPA-388 - */ - @Test + @Test // DATAJPA-388 public void alternativeEntityManagerDoesNotGetOverridden() { JpaRepositoryExtension extension = new JpaRepositoryExtension(); diff --git a/src/test/java/org/springframework/data/jpa/repository/cdi/QualifiedCustomizedCdiConfiguration.java b/src/test/java/org/springframework/data/jpa/repository/cdi/QualifiedCustomizedCdiConfiguration.java index 7caa1ba23..0a1e72dc9 100644 --- a/src/test/java/org/springframework/data/jpa/repository/cdi/QualifiedCustomizedCdiConfiguration.java +++ b/src/test/java/org/springframework/data/jpa/repository/cdi/QualifiedCustomizedCdiConfiguration.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ package org.springframework.data.jpa.repository.cdi; import org.springframework.data.repository.cdi.CdiRepositoryConfiguration; /** - * @see DATAJPA-584 * @author Mark Paluch */ @UserDB diff --git a/src/test/java/org/springframework/data/jpa/repository/cdi/QualifiedCustomizedUserRepository.java b/src/test/java/org/springframework/data/jpa/repository/cdi/QualifiedCustomizedUserRepository.java index 42e4bb3a3..bf08df1ab 100644 --- a/src/test/java/org/springframework/data/jpa/repository/cdi/QualifiedCustomizedUserRepository.java +++ b/src/test/java/org/springframework/data/jpa/repository/cdi/QualifiedCustomizedUserRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import org.springframework.data.jpa.domain.sample.User; import org.springframework.data.repository.Repository; /** - * @see DATAJPA-584 * @author Mark Paluch */ @UserDB diff --git a/src/test/java/org/springframework/data/jpa/repository/cdi/QualifiedCustomizedUserRepositoryBean.java b/src/test/java/org/springframework/data/jpa/repository/cdi/QualifiedCustomizedUserRepositoryBean.java index b5d144cf0..250013d51 100644 --- a/src/test/java/org/springframework/data/jpa/repository/cdi/QualifiedCustomizedUserRepositoryBean.java +++ b/src/test/java/org/springframework/data/jpa/repository/cdi/QualifiedCustomizedUserRepositoryBean.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package org.springframework.data.jpa.repository.cdi; /** - * @see DATAJPA-584 * @author Mark Paluch */ @UserDB diff --git a/src/test/java/org/springframework/data/jpa/repository/cdi/QualifiedCustomizedUserRepositoryCustom.java b/src/test/java/org/springframework/data/jpa/repository/cdi/QualifiedCustomizedUserRepositoryCustom.java index 6262cc3e7..3c1aff21c 100644 --- a/src/test/java/org/springframework/data/jpa/repository/cdi/QualifiedCustomizedUserRepositoryCustom.java +++ b/src/test/java/org/springframework/data/jpa/repository/cdi/QualifiedCustomizedUserRepositoryCustom.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package org.springframework.data.jpa.repository.cdi; /** - * @see DATAJPA-584 * @author Mark Paluch */ public interface QualifiedCustomizedUserRepositoryCustom { diff --git a/src/test/java/org/springframework/data/jpa/repository/cdi/SamplePersonRepository.java b/src/test/java/org/springframework/data/jpa/repository/cdi/SamplePersonRepository.java index 6c3042319..aac3084d5 100644 --- a/src/test/java/org/springframework/data/jpa/repository/cdi/SamplePersonRepository.java +++ b/src/test/java/org/springframework/data/jpa/repository/cdi/SamplePersonRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ package org.springframework.data.jpa.repository.cdi; import org.springframework.data.repository.Repository; /** - * @see DATAJPA-584 * @author Mark Paluch */ public interface SamplePersonRepository extends Repository, SamplePersonRepositoryCustom {} diff --git a/src/test/java/org/springframework/data/jpa/repository/cdi/SamplePersonRepositoryCustom.java b/src/test/java/org/springframework/data/jpa/repository/cdi/SamplePersonRepositoryCustom.java index 4d2354c4c..f0e66792c 100644 --- a/src/test/java/org/springframework/data/jpa/repository/cdi/SamplePersonRepositoryCustom.java +++ b/src/test/java/org/springframework/data/jpa/repository/cdi/SamplePersonRepositoryCustom.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package org.springframework.data.jpa.repository.cdi; /** - * @see DATAJPA-584 * @author Mark Paluch */ interface SamplePersonRepositoryCustom { diff --git a/src/test/java/org/springframework/data/jpa/repository/cdi/SamplePersonRepositoryImpl.java b/src/test/java/org/springframework/data/jpa/repository/cdi/SamplePersonRepositoryImpl.java index 81ef8a64a..1b2f507a1 100644 --- a/src/test/java/org/springframework/data/jpa/repository/cdi/SamplePersonRepositoryImpl.java +++ b/src/test/java/org/springframework/data/jpa/repository/cdi/SamplePersonRepositoryImpl.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -17,7 +17,6 @@ package org.springframework.data.jpa.repository.cdi; /** - * @see DATAJPA-584 * @author Mark Paluch */ class SamplePersonRepositoryImpl implements SamplePersonRepositoryCustom { diff --git a/src/test/java/org/springframework/data/jpa/repository/cdi/UserDB.java b/src/test/java/org/springframework/data/jpa/repository/cdi/UserDB.java index 1251ffdd0..153079f79 100644 --- a/src/test/java/org/springframework/data/jpa/repository/cdi/UserDB.java +++ b/src/test/java/org/springframework/data/jpa/repository/cdi/UserDB.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -23,7 +23,6 @@ import java.lang.annotation.Target; import javax.inject.Qualifier; /** - * @see DATAJPA-584 * @author Mark Paluch */ @Qualifier diff --git a/src/test/java/org/springframework/data/jpa/repository/config/AbstractAuditingViaJavaConfigRepositoriesTests.java b/src/test/java/org/springframework/data/jpa/repository/config/AbstractAuditingViaJavaConfigRepositoriesTests.java index 71a104050..131ab74c7 100644 --- a/src/test/java/org/springframework/data/jpa/repository/config/AbstractAuditingViaJavaConfigRepositoriesTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/config/AbstractAuditingViaJavaConfigRepositoriesTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2015 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -102,10 +102,7 @@ public abstract class AbstractAuditingViaJavaConfigRepositoriesTests { assertThat(createdBy.getFirstname(), is(this.auditor.getFirstname())); } - /** - * @see DATAJPA-382 - */ - @Test + @Test // DATAJPA-382 public void shouldAllowUseOfDynamicSpelParametersInUpdateQueries() { AuditableUser oliver = auditableUserRepository.save(new AuditableUser(null, "oliver")); diff --git a/src/test/java/org/springframework/data/jpa/repository/config/AbstractRepositoryConfigTests.java b/src/test/java/org/springframework/data/jpa/repository/config/AbstractRepositoryConfigTests.java index 6cb9d0573..f2bfe4084 100644 --- a/src/test/java/org/springframework/data/jpa/repository/config/AbstractRepositoryConfigTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/config/AbstractRepositoryConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2014 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,10 +51,7 @@ public abstract class AbstractRepositoryConfigTests { assertNotNull(auditableUserRepository); } - /** - * @see DATAJPA-330 - */ - @Test + @Test // DATAJPA-330 public void repositoriesHaveExceptionTranslationApplied() { JpaRepositoriesRegistrarIntegrationTests.assertExceptionTranslationActive(userRepository); @@ -62,10 +59,7 @@ public abstract class AbstractRepositoryConfigTests { JpaRepositoriesRegistrarIntegrationTests.assertExceptionTranslationActive(auditableUserRepository); } - /** - * @see DATAJPA-??? - */ - @Test + @Test // DATAJPA-484 public void exposesJpaMappingContext() { assertNotNull(mappingContext); } diff --git a/src/test/java/org/springframework/data/jpa/repository/config/AllowNestedRepositoriesRepositoryConfigTests.java b/src/test/java/org/springframework/data/jpa/repository/config/AllowNestedRepositoriesRepositoryConfigTests.java index 532ca81e1..f8eb5e0fe 100644 --- a/src/test/java/org/springframework/data/jpa/repository/config/AllowNestedRepositoriesRepositoryConfigTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/config/AllowNestedRepositoriesRepositoryConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,10 +34,7 @@ public class AllowNestedRepositoriesRepositoryConfigTests extends AbstractReposi @Autowired NestedUserRepository fooRepository; - /** - * @see DATAJPA-416 - */ - @Test + @Test // DATAJPA-416 public void shouldFindNestedRepository() { assertThat(fooRepository, is(notNullValue())); } diff --git a/src/test/java/org/springframework/data/jpa/repository/config/AuditingBeanDefinitionParserTests.java b/src/test/java/org/springframework/data/jpa/repository/config/AuditingBeanDefinitionParserTests.java index eea8e548e..b841ee685 100644 --- a/src/test/java/org/springframework/data/jpa/repository/config/AuditingBeanDefinitionParserTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/config/AuditingBeanDefinitionParserTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2014 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,10 +47,7 @@ public class AuditingBeanDefinitionParserTests { assertSetDatesIsSetTo("auditing/auditing-namespace-context2.xml", "false"); } - /** - * @see DATAJPA-9 - */ - @Test + @Test // DATAJPA-9 public void wiresDateTimeProviderIfConfigured() { BeanDefinition definition = getBeanDefinition("auditing/auditing-namespace-context3.xml"); @@ -65,10 +62,7 @@ public class AuditingBeanDefinitionParserTests { assertThat(bean, is(notNullValue())); } - /** - * @see DATAJPA-367 - */ - @Test(expected = BeanDefinitionParsingException.class) + @Test(expected = BeanDefinitionParsingException.class) // DATAJPA-367 public void shouldThrowBeanDefinitionParsingExceptionIfClassFromSpringAspectsJarCannotBeFound() { ShadowingClassLoader scl = new ShadowingClassLoader(getClass().getClassLoader()); diff --git a/src/test/java/org/springframework/data/jpa/repository/config/JpaAuditingRegistrarUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/config/JpaAuditingRegistrarUnitTests.java index 37b9f45f5..ce1db7436 100644 --- a/src/test/java/org/springframework/data/jpa/repository/config/JpaAuditingRegistrarUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/config/JpaAuditingRegistrarUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -25,7 +25,6 @@ import org.springframework.core.type.AnnotationMetadata; /** * Unit tests for {@link JpaAuditingRegistrar}. * - * @see DATAJPA-265 * @author Oliver Gierke */ @RunWith(MockitoJUnitRunner.class) @@ -36,12 +35,12 @@ public class JpaAuditingRegistrarUnitTests { @Mock AnnotationMetadata metadata; @Mock BeanDefinitionRegistry registry; - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-265 public void rejectsNullAnnotationMetadata() { registrar.registerBeanDefinitions(null, registry); } - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-265 public void rejectsNullBeanDefinitionRegistry() { registrar.registerBeanDefinitions(metadata, null); } diff --git a/src/test/java/org/springframework/data/jpa/repository/config/JpaRepositoriesRegistrarIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/config/JpaRepositoriesRegistrarIntegrationTests.java index ba8db7127..2bf063618 100644 --- a/src/test/java/org/springframework/data/jpa/repository/config/JpaRepositoriesRegistrarIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/config/JpaRepositoriesRegistrarIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -99,10 +99,7 @@ public class JpaRepositoriesRegistrarIntegrationTests { assertThat(repository, is(notNullValue())); } - /** - * @see DATAJPA-330 - */ - @Test + @Test // DATAJPA-330 public void doesNotProxyPlainAtRepositoryBeans() { assertThat(sampleRepository, is(notNullValue())); diff --git a/src/test/java/org/springframework/data/jpa/repository/config/JpaRepositoryConfigExtensionUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/config/JpaRepositoryConfigExtensionUnitTests.java index 26b46e6af..06621b55d 100644 --- a/src/test/java/org/springframework/data/jpa/repository/config/JpaRepositoryConfigExtensionUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/config/JpaRepositoryConfigExtensionUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -90,10 +90,7 @@ public class JpaRepositoryConfigExtensionUnitTests { assertOnlyOnePersistenceAnnotationBeanPostProcessorRegistered(factory, beanName); } - /** - * @see DATAJPA-525 - */ - @Test + @Test // DATAJPA-525 public void guardsAgainstNullJavaTypesReturnedFromJpaMetamodel() throws Exception { ApplicationContext context = mock(ApplicationContext.class); diff --git a/src/test/java/org/springframework/data/jpa/repository/config/NestedRepositoriesJavaConfigTests.java b/src/test/java/org/springframework/data/jpa/repository/config/NestedRepositoriesJavaConfigTests.java index 3290fc7ea..a8097f623 100644 --- a/src/test/java/org/springframework/data/jpa/repository/config/NestedRepositoriesJavaConfigTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/config/NestedRepositoriesJavaConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -46,10 +46,7 @@ public class NestedRepositoriesJavaConfigTests { @Autowired NestedUserRepository nestedUserRepository; - /** - * @see DATAJPA-416 - */ - @Test + @Test // DATAJPA-416 public void shouldSupportNestedRepositories() { assertThat(nestedUserRepository, is(notNullValue())); } diff --git a/src/test/java/org/springframework/data/jpa/repository/config/RepositoriesJavaConfigTests.java b/src/test/java/org/springframework/data/jpa/repository/config/RepositoriesJavaConfigTests.java index 85604cb51..7729d42b1 100644 --- a/src/test/java/org/springframework/data/jpa/repository/config/RepositoriesJavaConfigTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/config/RepositoriesJavaConfigTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,10 +57,7 @@ public class RepositoriesJavaConfigTests { @Autowired Repositories repositories; - /** - * @see DATAJPA-323 - */ - @Test + @Test // DATAJPA-323 public void foo() { assertThat(repositories.hasRepositoryFor(User.class), is(true)); } diff --git a/src/test/java/org/springframework/data/jpa/repository/custom/UserCustomExtendedRepository.java b/src/test/java/org/springframework/data/jpa/repository/custom/UserCustomExtendedRepository.java index dbf89c00d..c883348b8 100644 --- a/src/test/java/org/springframework/data/jpa/repository/custom/UserCustomExtendedRepository.java +++ b/src/test/java/org/springframework/data/jpa/repository/custom/UserCustomExtendedRepository.java @@ -30,10 +30,7 @@ public interface UserCustomExtendedRepository extends CustomGenericRepository findAll(); diff --git a/src/test/java/org/springframework/data/jpa/repository/query/AbstractJpaQueryTests.java b/src/test/java/org/springframework/data/jpa/repository/query/AbstractJpaQueryTests.java index ea86d52d6..ef50d098e 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/AbstractJpaQueryTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/AbstractJpaQueryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2015 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -68,11 +68,7 @@ public class AbstractJpaQueryTests { countQuery = mock(TypedQuery.class); } - /** - * @see DATADOC-97 - * @throws Exception - */ - @Test + @Test // DATADOC-97 public void addsHintsToQueryObject() throws Exception { JpaQueryMethod queryMethod = getMethod("findByLastname", String.class); @@ -86,11 +82,7 @@ public class AbstractJpaQueryTests { verify(result).setHint("foo", "bar"); } - /** - * @see DATAJPA-54 - * @throws Exception - */ - @Test + @Test // DATAJPA-54 public void skipsHintsForCountQueryIfConfigured() throws Exception { JpaQueryMethod queryMethod = getMethod("findByFirstname", String.class); @@ -103,10 +95,7 @@ public class AbstractJpaQueryTests { verify(result, never()).setHint("bar", "foo"); } - /** - * @see DATAJPA-73 - */ - @Test + @Test // DATAJPA-73 public void addsLockingModeToQueryObject() throws Exception { when(query.setLockMode(any(LockModeType.class))).thenReturn(query); @@ -118,10 +107,7 @@ public class AbstractJpaQueryTests { verify(result).setLockMode(LockModeType.PESSIMISTIC_WRITE); } - /** - * @see DATAJPA-466 - */ - @Test + @Test // DATAJPA-466 @Transactional public void shouldAddEntityGraphHintForFetch() throws Exception { @@ -137,10 +123,7 @@ public class AbstractJpaQueryTests { verify(result).setHint("javax.persistence.fetchgraph", entityGraph); } - /** - * @see DATAJPA-466 - */ - @Test + @Test // DATAJPA-466 @Transactional public void shouldAddEntityGraphHintForLoad() throws Exception { @@ -177,15 +160,11 @@ public class AbstractJpaQueryTests { @org.springframework.data.jpa.repository.Query("select u from User u where u.id = ?1") List findOneLocked(Integer primaryKey); - /** - * @see DATAJPA-466 - */ + // DATAJPA-466 @EntityGraph(value = "User.detail", type = EntityGraphType.LOAD) User getById(Integer id); - /** - * @see DATAJPA-466 - */ + // DATAJPA-466 @EntityGraph("User.overview") List findAll(); } diff --git a/src/test/java/org/springframework/data/jpa/repository/query/AbstractStringBasedJpaQueryIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/query/AbstractStringBasedJpaQueryIntegrationTests.java index 4c7fbdcfd..b6f38e79c 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/AbstractStringBasedJpaQueryIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/AbstractStringBasedJpaQueryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,10 +50,7 @@ public class AbstractStringBasedJpaQueryIntegrationTests { @PersistenceContext EntityManager em; - /** - * @see DATAJPA-885 - */ - @Test + @Test // DATAJPA-885 public void createsNormalQueryForJpaManagedReturnTypes() throws Exception { EntityManager mock = mock(EntityManager.class); diff --git a/src/test/java/org/springframework/data/jpa/repository/query/ExpressionBasedStringQueryUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/query/ExpressionBasedStringQueryUnitTests.java index 992aaad0e..b9033e283 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/ExpressionBasedStringQueryUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/ExpressionBasedStringQueryUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -15,14 +15,15 @@ */ package org.springframework.data.jpa.repository.query; -import static org.hamcrest.Matchers.*; -import static org.junit.Assert.*; -import static org.mockito.Mockito.*; +import static org.hamcrest.Matchers.is; +import static org.junit.Assert.assertThat; +import static org.mockito.Mockito.when; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.Mock; import org.mockito.runners.MockitoJUnitRunner; + import org.springframework.expression.spel.standard.SpelExpressionParser; /** @@ -38,10 +39,7 @@ public class ExpressionBasedStringQueryUnitTests { static final SpelExpressionParser SPEL_PARSER = new SpelExpressionParser(); - /** - * @see DATAJPA-170 - */ - @Test + @Test // DATAJPA-170 public void shouldReturnQueryWithDomainTypeExpressionReplacedWithSimpleDomainTypeName() { when(metadata.getEntityName()).thenReturn("User"); @@ -51,10 +49,7 @@ public class ExpressionBasedStringQueryUnitTests { assertThat(query.getQueryString(), is("select from User u where u.firstname like :firstname")); } - /** - * @DATAJPA-424 - */ - @Test + @Test // DATAJPA-424 public void renderAliasInExpressionQueryCorrectly() { when(metadata.getEntityName()).thenReturn("User"); diff --git a/src/test/java/org/springframework/data/jpa/repository/query/Jpa21UtilsUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/query/Jpa21UtilsUnitTests.java index 4a7088354..302285c00 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/Jpa21UtilsUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/Jpa21UtilsUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 the original author or authors. + * Copyright 2015-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,10 +32,7 @@ import org.springframework.data.jpa.repository.EntityGraph.EntityGraphType; */ public class Jpa21UtilsUnitTests { - /** - * @see DATAJPA-696 - */ - @Test + @Test // DATAJPA-696 public void shouldBuildCorrectSubgraphForJpaEntityGraph() throws Exception { EntityGraph entityGraph = mock(EntityGraph.class); diff --git a/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryExecutionUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryExecutionUnitTests.java index 44f71d31d..e2a08fa10 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryExecutionUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryExecutionUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2016 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -116,11 +116,7 @@ public class JpaQueryExecutionUnitTests { new ModifyingExecution(method, em); } - /** - * @see DATAJPA-124 - * @see DATAJPA-912 - */ - @Test + @Test // DATAJPA-124, DATAJPA-912 public void pagedExecutionRetrievesObjectsForPageableOutOfRange() throws Exception { Parameters parameters = new DefaultParameters(getClass().getMethod("sampleMethod", Pageable.class)); @@ -135,11 +131,7 @@ public class JpaQueryExecutionUnitTests { verify(countQuery).getResultList(); } - /** - * @see DATAJPA-477 - * @see DATAJPA-912 - */ - @Test + @Test // DATAJPA-477, DATAJPA-912 public void pagedExecutionShouldNotGenerateCountQueryIfQueryReportedNoResults() throws Exception { Parameters parameters = new DefaultParameters(getClass().getMethod("sampleMethod", Pageable.class)); @@ -153,10 +145,7 @@ public class JpaQueryExecutionUnitTests { verify(jpaQuery, times(0)).createCountQuery((Object[]) any()); } - /** - * @see DATAJPA-912 - */ - @Test + @Test // DATAJPA-912 public void pagedExecutionShouldUseCountFromResultIfOffsetIsZeroAndResultsWithinPageSize() throws Exception { Parameters parameters = new DefaultParameters(getClass().getMethod("sampleMethod", Pageable.class)); @@ -169,10 +158,7 @@ public class JpaQueryExecutionUnitTests { verify(jpaQuery, times(0)).createCountQuery((Object[]) any()); } - /** - * @see DATAJPA-912 - */ - @Test + @Test // DATAJPA-912 public void pagedExecutionShouldUseCountFromResultWithOffsetAndResultsWithinPageSize() throws Exception { Parameters parameters = new DefaultParameters(getClass().getMethod("sampleMethod", Pageable.class)); @@ -185,10 +171,7 @@ public class JpaQueryExecutionUnitTests { verify(jpaQuery, times(0)).createCountQuery((Object[]) any()); } - /** - * @see DATAJPA-912 - */ - @Test + @Test // DATAJPA-912 public void pagedExecutionShouldUseRequestCountFromResultWithOffsetAndResultsHitLowerPageSizeBounds() throws Exception { Parameters parameters = new DefaultParameters(getClass().getMethod("sampleMethod", Pageable.class)); @@ -203,10 +186,7 @@ public class JpaQueryExecutionUnitTests { verify(jpaQuery).createCountQuery((Object[]) any()); } - /** - * @see DATAJPA-912 - */ - @Test + @Test // DATAJPA-912 public void pagedExecutionShouldUseRequestCountFromResultWithOffsetAndResultsHitUpperPageSizeBounds() throws Exception { Parameters parameters = new DefaultParameters(getClass().getMethod("sampleMethod", Pageable.class)); @@ -221,10 +201,7 @@ public class JpaQueryExecutionUnitTests { verify(jpaQuery).createCountQuery((Object[]) any()); } - /** - * @see DATAJPA-951 - */ - @Test + @Test // DATAJPA-951 public void doesNotPreemtivelyWrapResultIntoOptional() throws Exception { doReturn(method).when(jpaQuery).getQueryMethod(); diff --git a/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryLookupStrategyUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryLookupStrategyUnitTests.java index 70e48a3cb..db21be84f 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryLookupStrategyUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryLookupStrategyUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2016 the original author or authors. + * Copyright 2012-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,10 +76,7 @@ public class JpaQueryLookupStrategyUnitTests { when(em.getDelegate()).thenReturn(em); } - /** - * @see DATAJPA-226 - */ - @Test + @Test // DATAJPA-226 public void invalidAnnotatedQueryCausesException() throws Exception { QueryLookupStrategy strategy = JpaQueryLookupStrategy.create(em, Key.CREATE_IF_NOT_FOUND, extractor, @@ -98,10 +95,7 @@ public class JpaQueryLookupStrategyUnitTests { } } - /** - * @see DATAJPA-554 - */ - @Test + @Test // DATAJPA-554 public void sholdThrowMorePreciseExceptionIfTryingToUsePaginationInNativeQueries() throws Exception { QueryLookupStrategy strategy = JpaQueryLookupStrategy.create(em, Key.CREATE_IF_NOT_FOUND, extractor, diff --git a/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryMethodUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryMethodUnitTests.java index 4faaa3904..2910abf9c 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryMethodUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/JpaQueryMethodUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2016 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -220,30 +220,21 @@ public class JpaQueryMethodUnitTests { assertThat(queryMethod.getNamedQueryName(), is("SpecialUser.findSpecialUsersByLastname")); } - /** - * @see DATAJPA-117 - */ - @Test + @Test // DATAJPA-117 public void discoversNativeQuery() throws Exception { JpaQueryMethod method = getQueryMethod(ValidRepository.class, "findByLastname", String.class); assertThat(method.isNativeQuery(), is(true)); } - /** - * @see DATAJPA-129 - */ - @Test + @Test // DATAJPA-129 public void considersAnnotatedNamedQueryName() throws Exception { JpaQueryMethod queryMethod = getQueryMethod(ValidRepository.class, "findByNamedQuery"); assertThat(queryMethod.getNamedQueryName(), is("HateoasAwareSpringDataWebConfiguration.bar")); } - /** - * @see DATAJPA-73 - */ - @Test + @Test // DATAJPA-73 public void discoversLockModeCorrectly() throws Exception { JpaQueryMethod method = getQueryMethod(ValidRepository.class, "findOneLocked", Integer.class); @@ -252,30 +243,21 @@ public class JpaQueryMethodUnitTests { assertEquals(LockModeType.PESSIMISTIC_WRITE, lockMode); } - /** - * @see DATAJPA-142 - */ - @Test + @Test // DATAJPA-142 public void returnsDefaultCountQueryName() throws Exception { JpaQueryMethod method = getQueryMethod(UserRepository.class, "findByLastname", String.class); assertThat(method.getNamedCountQueryName(), is("User.findByLastname.count")); } - /** - * @see DATAJPA-142 - */ - @Test + @Test // DATAJPA-142 public void returnsDefaultCountQueryNameBasedOnConfiguredNamedQueryName() throws Exception { JpaQueryMethod method = getQueryMethod(ValidRepository.class, "findByNamedQuery"); assertThat(method.getNamedCountQueryName(), is("HateoasAwareSpringDataWebConfiguration.bar.count")); } - /** - * @see DATAJPA-185 - */ - @Test + @Test // DATAJPA-185 public void rejectsInvalidNamedParameter() throws Exception { try { @@ -291,10 +273,7 @@ public class JpaQueryMethodUnitTests { } } - /** - * @see DATAJPA-207 - */ - @Test + @Test // DATAJPA-207 @SuppressWarnings({ "rawtypes", "unchecked" }) public void returnsTrueIfReturnTypeIsEntity() { @@ -306,10 +285,7 @@ public class JpaQueryMethodUnitTests { assertThat(new JpaQueryMethod(findsProjection, metadata, factory, extractor).isQueryForEntity(), is(false)); } - /** - * @see DATAJPA-345 - */ - @Test + @Test // DATAJPA-345 public void detectsLockAndQueryHintsOnIfUsedAsMetaAnnotation() throws Exception { JpaQueryMethod method = getQueryMethod(ValidRepository.class, "withMetaAnnotation"); @@ -320,10 +296,7 @@ public class JpaQueryMethodUnitTests { assertThat(method.getHints().get(0).value(), is("bar")); } - /** - * @see DATAJPA-466 - */ - @Test + @Test // DATAJPA-466 public void shouldStoreJpa21FetchGraphInformationAsHint() { doReturn(User.class).when(metadata).getDomainType(); @@ -336,10 +309,7 @@ public class JpaQueryMethodUnitTests { assertThat(method.getEntityGraph().getType(), is(EntityGraphType.LOAD)); } - /** - * @see DATAJPA-612 - */ - @Test + @Test // DATAJPA-612 public void shouldFindEntityGraphAnnotationOnOverriddenSimpleJpaRepositoryMethod() throws Exception { doReturn(User.class).when(metadata).getDomainType(); @@ -353,10 +323,7 @@ public class JpaQueryMethodUnitTests { assertThat(method.getEntityGraph().getType(), is(EntityGraphType.FETCH)); } - /** - * @see DATAJPA-689 - */ - @Test + @Test // DATAJPA-689 public void shouldFindEntityGraphAnnotationOnOverriddenSimpleJpaRepositoryMethodFindOne() throws Exception { doReturn(User.class).when(metadata).getDomainType(); @@ -387,18 +354,12 @@ public class JpaQueryMethodUnitTests { assertThat(method.getEntityGraph().getType(), is(EntityGraphType.FETCH)); } - /** - * @see DATAJPA-758 - */ - @Test + @Test // DATAJPA-758 public void allowsPositionalBindingEvenIfParametersAreNamed() throws Exception { getQueryMethod(ValidRepository.class, "queryWithPositionalBinding", String.class); } - /** - * @see DATAJPA-871 - */ - @Test + @Test // DATAJPA-871 public void usesAliasedValueForLockLockMode() throws Exception { JpaQueryMethod method = getQueryMethod(ValidRepository.class, "withMetaAnnotationUsingAliasFor"); @@ -406,10 +367,7 @@ public class JpaQueryMethodUnitTests { assertThat(method.getLockModeType(), is(LockModeType.PESSIMISTIC_FORCE_INCREMENT)); } - /** - * @see DATAJPA-871 - */ - @Test + @Test // DATAJPA-871 public void usesAliasedValueForQueryHints() throws Exception { JpaQueryMethod method = getQueryMethod(ValidRepository.class, "withMetaAnnotationUsingAliasFor"); @@ -420,10 +378,7 @@ public class JpaQueryMethodUnitTests { } - /** - * @see DATAJPA-871 - */ - @Test + @Test // DATAJPA-871 public void usesAliasedValueForQueryHintsCounting() throws Exception { JpaQueryMethod method = getQueryMethod(ValidRepository.class, "withMetaAnnotationUsingAliasFor"); @@ -431,10 +386,7 @@ public class JpaQueryMethodUnitTests { assertThat(method.applyHintsToCountQuery(), is(true)); } - /** - * @see DATAJPA-871 - */ - @Test + @Test // DATAJPA-871 public void usesAliasedValueForModifyingClearAutomatically() throws Exception { JpaQueryMethod method = getQueryMethod(ValidRepository.class, "withMetaAnnotationUsingAliasFor"); @@ -443,10 +395,7 @@ public class JpaQueryMethodUnitTests { assertThat(method.getClearAutomatically(), is(true)); } - /** - * @see DATAJPA-871 - */ - @Test + @Test // DATAJPA-871 public void usesAliasedValueForHintsApplyToCountQuery() throws Exception { JpaQueryMethod method = getQueryMethod(ValidRepository.class, "withMetaAnnotationUsingAliasFor"); @@ -454,10 +403,7 @@ public class JpaQueryMethodUnitTests { assertThat(method.applyHintsToCountQuery(), is(true)); } - /** - * @see DATAJPA-871 - */ - @Test + @Test // DATAJPA-871 public void usesAliasedValueForQueryValue() throws Exception { JpaQueryMethod method = getQueryMethod(ValidRepository.class, "withMetaAnnotationUsingAliasFor"); @@ -465,10 +411,7 @@ public class JpaQueryMethodUnitTests { assertThat(method.getAnnotatedQuery(), is(equalTo("select u from User u where u.firstname = ?1"))); } - /** - * @see DATAJPA-871 - */ - @Test + @Test // DATAJPA-871 public void usesAliasedValueForQueryCountQuery() throws Exception { JpaQueryMethod method = getQueryMethod(ValidRepository.class, "withMetaAnnotationUsingAliasFor"); @@ -476,10 +419,7 @@ public class JpaQueryMethodUnitTests { assertThat(method.getCountQuery(), is(equalTo("select u from User u where u.lastname = ?1"))); } - /** - * @see DATAJPA-871 - */ - @Test + @Test // DATAJPA-871 public void usesAliasedValueForQueryCountQueryProjection() throws Exception { JpaQueryMethod method = getQueryMethod(ValidRepository.class, "withMetaAnnotationUsingAliasFor"); @@ -487,10 +427,7 @@ public class JpaQueryMethodUnitTests { assertThat(method.getCountQueryProjection(), is(equalTo("foo-bar"))); } - /** - * @see DATAJPA-871 - */ - @Test + @Test // DATAJPA-871 public void usesAliasedValueForQueryNamedQueryName() throws Exception { JpaQueryMethod method = getQueryMethod(ValidRepository.class, "withMetaAnnotationUsingAliasFor"); @@ -498,10 +435,7 @@ public class JpaQueryMethodUnitTests { assertThat(method.getNamedQueryName(), is(equalTo("namedQueryName"))); } - /** - * @see DATAJPA-871 - */ - @Test + @Test // DATAJPA-871 public void usesAliasedValueForQueryNamedCountQueryName() throws Exception { JpaQueryMethod method = getQueryMethod(ValidRepository.class, "withMetaAnnotationUsingAliasFor"); @@ -509,10 +443,7 @@ public class JpaQueryMethodUnitTests { assertThat(method.getNamedCountQueryName(), is(equalTo("namedCountQueryName"))); } - /** - * @see DATAJPA-871 - */ - @Test + @Test // DATAJPA-871 public void usesAliasedValueForQueryNativeQuery() throws Exception { JpaQueryMethod method = getQueryMethod(ValidRepository.class, "withMetaAnnotationUsingAliasFor"); @@ -520,10 +451,7 @@ public class JpaQueryMethodUnitTests { assertThat(method.isNativeQuery(), is(true)); } - /** - * @see DATAJPA-871 - */ - @Test + @Test // DATAJPA-871 public void usesAliasedValueForEntityGraph() throws Exception { doReturn(User.class).when(metadata).getDomainType(); @@ -592,9 +520,7 @@ public class JpaQueryMethodUnitTests { @CustomAnnotation void withMetaAnnotation(); - /** - * @see DATAJPA-466 - */ + // DATAJPA-466 @EntityGraph(value = "User.propertyLoadPath", type = EntityGraphType.LOAD) User queryMethodWithCustomEntityFetchGraph(Integer id); diff --git a/src/test/java/org/springframework/data/jpa/repository/query/NamedQueryUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/query/NamedQueryUnitTests.java index 68e9cbc93..f6ec4fe8b 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/NamedQueryUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/NamedQueryUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2014 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,10 +79,7 @@ public class NamedQueryUnitTests { NamedQuery.lookupFrom(queryMethod, em); } - /** - * @see DATAJPA-142 - */ - @Test + @Test // DATAJPA-142 public void doesNotRejectPersistenceProviderIfNamedCountQueryIsAvailable() { when(extractor.canExtractQuery()).thenReturn(false); diff --git a/src/test/java/org/springframework/data/jpa/repository/query/ParameterBinderUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/query/ParameterBinderUnitTests.java index 3f8c784da..85e009c64 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/ParameterBinderUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/ParameterBinderUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2015 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -182,10 +182,7 @@ public class ParameterBinderUnitTests { assertThat(binder.getSort(), is(sort)); } - /** - * @see DATAJPA-107 - */ - @Test + @Test // DATAJPA-107 public void shouldSetTemporalQueryParameterToDate() throws Exception { Method method = SampleRepository.class.getMethod("validWithDefaultTemporalTypeParameter", Date.class); @@ -197,10 +194,7 @@ public class ParameterBinderUnitTests { verify(query).setParameter(eq(1), eq(date), eq(TemporalType.DATE)); } - /** - * @see DATAJPA-107 - */ - @Test + @Test // DATAJPA-107 public void shouldSetTemporalQueryParameterToTimestamp() throws Exception { Method method = SampleRepository.class.getMethod("validWithCustomTemporalTypeParameter", Date.class); @@ -212,10 +206,7 @@ public class ParameterBinderUnitTests { verify(query).setParameter(eq(1), eq(date), eq(TemporalType.TIMESTAMP)); } - /** - * @see DATAJPA-107 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-107 public void shouldThrowIllegalArgumentExceptionIfIsAnnotatedWithTemporalParamAndParameterTypeIsNotDate() throws Exception { Method method = SampleRepository.class.getMethod("invalidWithTemporalTypeParameter", String.class); @@ -224,10 +215,7 @@ public class ParameterBinderUnitTests { new ParameterBinder(parameters, new Object[] { "foo", "" }); } - /** - * @see DATAJPA-461 - */ - @Test + @Test // DATAJPA-461 public void shouldAllowBindingOfVarArgsAsIs() throws Exception { Method method = SampleRepository.class.getMethod("validWithVarArgs", Integer[].class); @@ -238,10 +226,7 @@ public class ParameterBinderUnitTests { verify(query).setParameter(eq(1), eq(ids)); } - /** - * @see DATAJPA-809 - */ - @Test + @Test // DATAJPA-809 public void unwrapsOptionalParameter() throws Exception { Method method = SampleRepository.class.getMethod("optionalParameter", Optional.class); diff --git a/src/test/java/org/springframework/data/jpa/repository/query/ParameterExpressionProviderTests.java b/src/test/java/org/springframework/data/jpa/repository/query/ParameterExpressionProviderTests.java index 988d639c7..398a268d9 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/ParameterExpressionProviderTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/ParameterExpressionProviderTests.java @@ -1,3 +1,18 @@ +/* + * Copyright 2017 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package org.springframework.data.jpa.repository.query; import static org.hamcrest.Matchers.*; @@ -32,10 +47,7 @@ public class ParameterExpressionProviderTests { @PersistenceContext EntityManager em; - /** - * @see DATADOC-99 - */ - @Test + @Test // DATADOC-99 @SuppressWarnings("rawtypes") public void createsParameterExpressionWithMostConcreteType() throws Exception { diff --git a/src/test/java/org/springframework/data/jpa/repository/query/ParameterMetadataProviderIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/query/ParameterMetadataProviderIntegrationTests.java index 9ad69a7e9..aee1124e4 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/ParameterMetadataProviderIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/ParameterMetadataProviderIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 the original author or authors. + * Copyright 2015-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -48,10 +48,7 @@ public class ParameterMetadataProviderIntegrationTests { @PersistenceContext EntityManager em; - /** - * @see DATAJPA-758 - */ - @Test + @Test // DATAJPA-758 public void forwardsParameterNameIfTransparentlyNamed() throws Exception { ParameterMetadataProvider provider = createProvider(Sample.class.getMethod("findByFirstname", String.class)); @@ -60,10 +57,7 @@ public class ParameterMetadataProviderIntegrationTests { assertThat(metadata.getExpression().getName(), is("name")); } - /** - * @see DATAJPA-758 - */ - @Test + @Test // DATAJPA-758 public void forwardsParameterNameIfExplicitlyAnnotated() throws Exception { ParameterMetadataProvider provider = createProvider(Sample.class.getMethod("findByLastname", String.class)); @@ -72,10 +66,7 @@ public class ParameterMetadataProviderIntegrationTests { assertThat(metadata.getExpression().getName(), is(nullValue())); } - /** - * @see DATAJPA-772 - */ - @Test + @Test // DATAJPA-772 public void doesNotApplyLikeExpansionOnNonStringProperties() throws Exception { ParameterMetadataProvider provider = createProvider(Sample.class.getMethod("findByAgeContaining", Integer.class)); diff --git a/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java index ebb09dae6..669083ee7 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/PartTreeJpaQueryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2016 the original author or authors. + * Copyright 2011-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License import org.springframework.aop.framework.Advised; @@ -75,11 +75,7 @@ public class PartTreeJpaQueryIntegrationTests { this.provider = PersistenceProvider.fromEntityManager(entityManager); } - /** - * @see DATADOC-90 - * @throws Exception - */ - @Test + @Test // DATADOC-90 public void test() throws Exception { JpaQueryMethod queryMethod = getQueryMethod("findByFirstname", String.class, Pageable.class); @@ -103,10 +99,7 @@ public class PartTreeJpaQueryIntegrationTests { testIgnoreCase("findByIdAllIgnoringCase", 3); } - /** - * @see DATAJPA-121 - */ - @Test + @Test // DATAJPA-121 public void recreatesQueryIfNullValueIsGiven() throws Exception { JpaQueryMethod queryMethod = getQueryMethod("findByFirstname", String.class, Pageable.class); @@ -121,10 +114,7 @@ public class PartTreeJpaQueryIntegrationTests { assertThat(HibernateUtils.getHibernateQuery(getValue(query, PROPERTY)), endsWith("firstname is null")); } - /** - * @see DATAJPA-920 - */ - @Test + @Test // DATAJPA-920 public void shouldLimitExistsProjectionQueries() throws Exception { JpaQueryMethod queryMethod = getQueryMethod("existsByFirstname", String.class); @@ -135,10 +125,7 @@ public class PartTreeJpaQueryIntegrationTests { assertThat(query.getMaxResults(), is(1)); } - /** - * @see DATAJPA-920 - */ - @Test + @Test // DATAJPA-920 public void shouldSelectAliasedIdForExistsProjectionQueries() throws Exception { JpaQueryMethod queryMethod = getQueryMethod("existsByFirstname", String.class); diff --git a/src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsIntegrationTests.java index d62543c92..f2aec0726 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,10 +61,7 @@ public class QueryUtilsIntegrationTests { @PersistenceContext EntityManager em; - /** - * @see DATAJPA-403 - */ - @Test + @Test // DATAJPA-403 public void reusesExistingJoinForExpression() { CriteriaBuilder builder = em.getCriteriaBuilder(); @@ -80,10 +77,7 @@ public class QueryUtilsIntegrationTests { assertThat(from.getJoins(), hasSize(1)); } - /** - * @see DATAJPA-401 - */ - @Test + @Test // DATAJPA-401 public void createsJoinForOptionalAssociation() { CriteriaBuilder builder = em.getCriteriaBuilder(); @@ -95,10 +89,7 @@ public class QueryUtilsIntegrationTests { assertThat(root.getJoins(), hasSize(1)); } - /** - * @see DATAJPA-401 - */ - @Test + @Test // DATAJPA-401 public void doesNotCreateAJoinForNonOptionalAssociation() { CriteriaBuilder builder = em.getCriteriaBuilder(); @@ -108,10 +99,7 @@ public class QueryUtilsIntegrationTests { QueryUtils.toExpressionRecursively(root, PropertyPath.from("customer", Order.class)); } - /** - * @see DATAJPA-454 - */ - @Test + @Test // DATAJPA-454 public void createsJoingToTraverseCollectionPath() { CriteriaBuilder builder = em.getCriteriaBuilder(); @@ -123,10 +111,7 @@ public class QueryUtilsIntegrationTests { assertThat(root.getJoins(), hasSize(1)); } - /** - * @see DATAJPA-476 - */ - @Test + @Test // DATAJPA-476 public void traversesPluralAttributeCorrectly() { PersistenceProviderResolver originalPersistenceProviderResolver = PersistenceProviderResolverHolder @@ -147,10 +132,7 @@ public class QueryUtilsIntegrationTests { } } - /** - * @see DATAJPA-763 - */ - @Test + @Test // DATAJPA-763 @SuppressWarnings("unchecked") public void doesNotCreateAJoinForAlreadyFetchedAssociation() { diff --git a/src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java index e0e19ef25..7c33168a8 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/QueryUtilsUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2016 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,9 +51,6 @@ public class QueryUtilsUnitTests { assertCountQuery(QUERY, COUNT_QUERY); } - /** - * @see #303 - */ @Test public void createsCountQueriesCorrectlyForCapitalLetterJPQL() { @@ -62,9 +59,6 @@ public class QueryUtilsUnitTests { assertCountQuery("SELECT u FROM User u where u.foo.bar = ?", "select count(u) FROM User u where u.foo.bar = ?"); } - /** - * @see #351 - */ @Test public void createsCountQueryForDistinctQueries() throws Exception { @@ -72,9 +66,6 @@ public class QueryUtilsUnitTests { "select count(distinct u) from User u where u.foo = ?"); } - /** - * @see #351 - */ @Test public void createsCountQueryForConstructorQueries() throws Exception { @@ -82,9 +73,6 @@ public class QueryUtilsUnitTests { "select count(distinct u) from User u where u.foo = ?"); } - /** - * @see #352 - */ @Test public void createsCountQueryForJoins() throws Exception { @@ -92,9 +80,6 @@ public class QueryUtilsUnitTests { "select count(distinct u) from User u left outer join u.roles r WHERE r = ?"); } - /** - * @see #352 - */ @Test public void createsCountQueryForQueriesWithSubSelects() throws Exception { @@ -102,9 +87,6 @@ public class QueryUtilsUnitTests { "select count(u) from User u left outer join u.roles r where r in (select r from Role)"); } - /** - * @see #355 - */ @Test public void createsCountQueryForAliasesCorrectly() throws Exception { @@ -137,10 +119,7 @@ public class QueryUtilsUnitTests { assertCountQuery(FQ_QUERY, "select count(u) from org.acme.domain.User$Foo_Bar u"); } - /** - * @see DATAJPA-252 - */ - @Test + @Test // DATAJPA-252 public void detectsJoinAliasesCorrectly() { Set aliases = getOuterJoinAliases("select p from Person p left outer join x.foo b2_$ar where …"); @@ -162,10 +141,7 @@ public class QueryUtilsUnitTests { assertThat(aliases, hasItems("b2_$ar", "foo")); } - /** - * @see DATAJPA-252 - */ - @Test + @Test // DATAJPA-252 public void doesNotPrefixOrderReferenceIfOuterJoinAliasDetected() { String query = "select p from Person p left join p.address address"; @@ -174,20 +150,14 @@ public class QueryUtilsUnitTests { endsWith("order by address.city asc, p.lastname asc")); } - /** - * @see DATAJPA-252 - */ - @Test + @Test // DATAJPA-252 public void extendsExistingOrderByClausesCorrectly() { String query = "select p from Person p order by p.lastname asc"; assertThat(applySorting(query, new Sort("firstname"), "p"), endsWith("order by p.lastname asc, p.firstname asc")); } - /** - * @see DATAJPA-296 - */ - @Test + @Test // DATAJPA-296 public void appliesIgnoreCaseOrderingCorrectly() { Sort sort = new Sort(new Sort.Order("firstname").ignoreCase()); @@ -196,10 +166,7 @@ public class QueryUtilsUnitTests { assertThat(applySorting(query, sort, "p"), endsWith("order by lower(p.firstname) asc")); } - /** - * @see DATAJPA-296 - */ - @Test + @Test // DATAJPA-296 public void appendsIgnoreCaseOrderingCorrectly() { Sort sort = new Sort(new Sort.Order("firstname").ignoreCase()); @@ -208,50 +175,35 @@ public class QueryUtilsUnitTests { assertThat(applySorting(query, sort, "p"), endsWith("order by p.lastname asc, lower(p.firstname) asc")); } - /** - * @see DATAJPA-342 - */ - @Test + @Test // DATAJPA-342 public void usesReturnedVariableInCOuntProjectionIfSet() { assertCountQuery("select distinct m.genre from Media m where m.user = ?1 order by m.genre asc", "select count(distinct m.genre) from Media m where m.user = ?1"); } - /** - * @see DATAJPA-343 - */ - @Test + @Test // DATAJPA-343 public void projectsCOuntQueriesForQueriesWithSubselects() { assertCountQuery("select o from Foo o where cb.id in (select b from Bar b)", "select count(o) from Foo o where cb.id in (select b from Bar b)"); } - /** - * @see DATAJPA-148 - */ - @Test(expected = InvalidDataAccessApiUsageException.class) + @Test(expected = InvalidDataAccessApiUsageException.class) // DATAJPA-148 public void doesNotPrefixSortsIfFunction() { Sort sort = new Sort("sum(foo)"); assertThat(applySorting("select p from Person p", sort, "p"), endsWith("order by sum(foo) asc")); } - /** - * @see DATAJPA-377 - */ - @Test + @Test // DATAJPA-377 public void removesOrderByInGeneratedCountQueryFromOriginalQueryIfPresent() { assertCountQuery("select distinct m.genre from Media m where m.user = ?1 OrDer By m.genre ASC", "select count(distinct m.genre) from Media m where m.user = ?1"); } - /** - * @see DATAJPA-375 - */ - @Test + @Test // DATAJPA-375 public void findsExistingOrderByIndependentOfCase() { Sort sort = new Sort("lastname"); @@ -259,35 +211,23 @@ public class QueryUtilsUnitTests { assertThat(query, endsWith("ORDER BY p.firstname, p.lastname asc")); } - /** - * @see DATAJPA-409 - */ - @Test + @Test // DATAJPA-409 public void createsCountQueryForNestedReferenceCorrectly() { assertCountQuery("select a.b from A a", "select count(a.b) from A a"); } - /** - * @see DATAJPA-420 - */ - @Test + @Test // DATAJPA-420 public void createsCountQueryForScalarSelects() { assertCountQuery("select p.lastname,p.firstname from Person p", "select count(p) from Person p"); } - /** - * @see DATAJPA-456 - */ - @Test + @Test // DATAJPA-456 public void createCountQueryFromTheGivenCountProjection() { assertThat(createCountQueryFor("select p.lastname,p.firstname from Person p", "p.lastname"), is("select count(p.lastname) from Person p")); } - /** - * @see DATAJPA-726 - */ - @Test + @Test // DATAJPA-726 public void detectsAliassesInPlainJoins() { String query = "select p from Customer c join c.productOrder p where p.delayed = true"; @@ -296,26 +236,17 @@ public class QueryUtilsUnitTests { assertThat(applySorting(query, sort, "c"), endsWith("order by p.lineItems asc")); } - /** - * @see DATAJPA-736 - */ - @Test + @Test // DATAJPA-736 public void supportsNonAsciiCharactersInEntityNames() { assertThat(createCountQueryFor("select u from Usèr u"), is("select count(u) from Usèr u")); } - /** - * @see DATAJPA-798 - */ - @Test + @Test // DATAJPA-798 public void detectsAliasInQueryContainingLineBreaks() { assertThat(detectAlias("select \n u \n from \n User \nu"), is("u")); } - /** - * @see DATAJPA-815 - */ - @Test + @Test // DATAJPA-815 public void doesPrefixPropertyWith() { String query = "from Cat c join Dog d"; @@ -324,18 +255,12 @@ public class QueryUtilsUnitTests { assertThat(applySorting(query, sort, "c"), endsWith("order by c.dPropertyStartingWithJoinAlias asc")); } - /** - * @see DATAJPA-938 - */ - @Test + @Test // DATAJPA-938 public void detectsConstructorExpressionInDistinctQuery() { assertThat(hasConstructorExpression("select distinct new Foo() from Bar b"), is(true)); } - /** - * @see DATAJPA-938 - */ - @Test + @Test // DATAJPA-938 public void detectsComplexConstructorExpression() { assertThat(hasConstructorExpression("select new foo.bar.Foo(ip.id, ip.name, sum(lp.amount)) " // @@ -345,50 +270,32 @@ public class QueryUtilsUnitTests { + "order by ip.name ASC"), is(true)); } - /** - * @see DATAJPA-938 - */ - @Test + @Test // DATAJPA-938 public void detectsConstructorExpressionWithLineBreaks() { assertThat(hasConstructorExpression("select new foo.bar.FooBar(\na.id) from DtoA a "), is(true)); } - /** - * @see DATAJPA-960 - */ - @Test + @Test // DATAJPA-960 public void doesNotQualifySortIfNoAliasDetected() { assertThat(applySorting("from mytable where ?1 is null", new Sort("firstname")), endsWith("order by firstname asc")); } - /** - * @see DATAJPA-965 - * @see DATAJPA-970 - */ - @Test(expected = InvalidDataAccessApiUsageException.class) + @Test(expected = InvalidDataAccessApiUsageException.class) // DATAJPA-965, DATAJPA-970 public void doesNotAllowWhitespaceInSort() { Sort sort = new Sort("case when foo then bar"); applySorting("select p from Person p", sort, "p"); } - /** - * @see DATAJPA-965 - * @see DATAJPA-970 - */ - @Test + @Test // DATAJPA-965, DATAJPA-970 public void doesNotPrefixUnsageJpaSortFunctionCalls() { JpaSort sort = JpaSort.unsafe("sum(foo)"); assertThat(applySorting("select p from Person p", sort, "p"), endsWith("order by sum(foo) asc")); } - /** - * @see DATAJPA-965 - * @see DATAJPA-970 - */ - @Test + @Test // DATAJPA-965, DATAJPA-970 public void doesNotPrefixMultipleAliasedFunctionCalls() { String query = "SELECT AVG(m.price) AS avgPrice, SUM(m.stocks) AS sumStocks FROM Magazine m"; @@ -397,11 +304,7 @@ public class QueryUtilsUnitTests { assertThat(applySorting(query, sort, "m"), endsWith("order by avgPrice asc, sumStocks asc")); } - /** - * @see DATAJPA-965 - * @see DATAJPA-970 - */ - @Test + @Test // DATAJPA-965, DATAJPA-970 public void doesNotPrefixSingleAliasedFunctionCalls() { String query = "SELECT AVG(m.price) AS avgPrice FROM Magazine m"; @@ -410,11 +313,7 @@ public class QueryUtilsUnitTests { assertThat(applySorting(query, sort, "m"), endsWith("order by avgPrice asc")); } - /** - * @see DATAJPA-965 - * @see DATAJPA-970 - */ - @Test + @Test // DATAJPA-965, DATAJPA-970 public void prefixesSingleNonAliasedFunctionCallRelatedSortProperty() { String query = "SELECT AVG(m.price) AS avgPrice FROM Magazine m"; @@ -423,11 +322,7 @@ public class QueryUtilsUnitTests { assertThat(applySorting(query, sort, "m"), endsWith("order by m.someOtherProperty asc")); } - /** - * @see DATAJPA-965 - * @see DATAJPA-970 - */ - @Test + @Test // DATAJPA-965, DATAJPA-970 public void prefixesNonAliasedFunctionCallRelatedSortPropertyWhenSelectClauseContainesAliasedFunctionForDifferentProperty() { String query = "SELECT m.name, AVG(m.price) AS avgPrice FROM Magazine m"; @@ -436,11 +331,7 @@ public class QueryUtilsUnitTests { assertThat(applySorting(query, sort, "m"), endsWith("order by m.name asc, avgPrice asc")); } - /** - * @see DATAJPA-965 - * @see DATAJPA-970 - */ - @Test + @Test // DATAJPA-965, DATAJPA-970 public void doesNotPrefixAliasedFunctionCallNameWithMultipleNumericParameters() { String query = "SELECT SUBSTRING(m.name, 2, 5) AS trimmedName FROM Magazine m"; @@ -449,11 +340,7 @@ public class QueryUtilsUnitTests { assertThat(applySorting(query, sort, "m"), endsWith("order by trimmedName asc")); } - /** - * @see DATAJPA-965 - * @see DATAJPA-970 - */ - @Test + @Test // DATAJPA-965, DATAJPA-970 public void doesNotPrefixAliasedFunctionCallNameWithMultipleStringParameters() { String query = "SELECT CONCAT(m.name, 'foo') AS extendedName FROM Magazine m"; @@ -462,11 +349,7 @@ public class QueryUtilsUnitTests { assertThat(applySorting(query, sort, "m"), endsWith("order by extendedName asc")); } - /** - * @see DATAJPA-965 - * @see DATAJPA-970 - */ - @Test + @Test // DATAJPA-965, DATAJPA-970 public void doesNotPrefixAliasedFunctionCallNameWithUnderscores() { String query = "SELECT AVG(m.price) AS avg_price FROM Magazine m"; @@ -475,11 +358,7 @@ public class QueryUtilsUnitTests { assertThat(applySorting(query, sort, "m"), endsWith("order by avg_price asc")); } - /** - * @see DATAJPA-965 - * @see DATAJPA-970 - */ - @Test + @Test // DATAJPA-965, DATAJPA-970 public void doesNotPrefixAliasedFunctionCallNameWithDots() { String query = "SELECT AVG(m.price) AS m.avg FROM Magazine m"; @@ -488,11 +367,7 @@ public class QueryUtilsUnitTests { assertThat(applySorting(query, sort, "m"), endsWith("order by m.avg asc")); } - /** - * @see DATAJPA-965 - * @see DATAJPA-970 - */ - @Test + @Test // DATAJPA-965, DATAJPA-970 public void doesNotPrefixAliasedFunctionCallNameWhenQueryStringContainsMultipleWhiteSpaces() { String query = "SELECT AVG( m.price ) AS avgPrice FROM Magazine m"; @@ -501,10 +376,7 @@ public class QueryUtilsUnitTests { assertThat(applySorting(query, sort, "m"), endsWith("order by avgPrice asc")); } - /** - * @see DATAJPA-1000 - */ - @Test + @Test // DATAJPA-1000 public void discoversCorrectAliasForJoinFetch() { Set aliases = QueryUtils diff --git a/src/test/java/org/springframework/data/jpa/repository/query/SimpleJpaQueryUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/query/SimpleJpaQueryUnitTests.java index c7abc6f42..d9a0eb7a6 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/SimpleJpaQueryUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/SimpleJpaQueryUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2016 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -111,10 +111,7 @@ public class SimpleJpaQueryUnitTests { assertThat(jpaQuery.createCountQuery(new Object[] {}), is((javax.persistence.Query) typedQuery)); } - /** - * @see DATAJPA-77 - */ - @Test + @Test // DATAJPA-77 public void doesNotApplyPaginationToCountQuery() throws Exception { when(em.createQuery(Mockito.anyString())).thenReturn(query); @@ -150,31 +147,21 @@ public class SimpleJpaQueryUnitTests { verify(em).createNativeQuery("SELECT u FROM User u WHERE u.lastname = ?1", User.class); } - /** - * @see DATAJPA-554 - */ - @Test(expected = InvalidJpaQueryMethodException.class) + @Test(expected = InvalidJpaQueryMethodException.class) // DATAJPA-554 public void rejectsNativeQueryWithDynamicSort() throws Exception { Method method = SampleRepository.class.getMethod("findNativeByLastname", String.class, Sort.class); createJpaQuery(method); } - /** - * @see DATAJPA-554 - */ - @Test(expected = InvalidJpaQueryMethodException.class) + @Test(expected = InvalidJpaQueryMethodException.class) // DATAJPA-554 public void rejectsNativeQueryWithPageable() throws Exception { Method method = SampleRepository.class.getMethod("findNativeByLastname", String.class, Pageable.class); createJpaQuery(method); } - /** - * @see DATAJPA-352 - * @throws Exception - */ - @Test + @Test // DATAJPA-352 @SuppressWarnings("unchecked") public void doesNotValidateCountQueryIfNotPagingMethod() throws Exception { @@ -184,10 +171,7 @@ public class SimpleJpaQueryUnitTests { createJpaQuery(method); } - /** - * @see DATAJPA-352 - */ - @Test + @Test // DATAJPA-352 @SuppressWarnings("unchecked") public void validatesAndRejectsCountQueryIfPagingMethod() throws Exception { @@ -215,10 +199,7 @@ public class SimpleJpaQueryUnitTests { assertThat(query instanceof NativeJpaQuery, is(true)); } - /** - * @see DATAJPA-757 - */ - @Test + @Test // DATAJPA-757 public void createsNativeCountQuery() throws Exception { when(em.createNativeQuery(anyString())).thenReturn(query); @@ -231,10 +212,7 @@ public class SimpleJpaQueryUnitTests { verify(em).createNativeQuery(anyString()); } - /** - * @see DATAJPA-885 - */ - @Test + @Test // DATAJPA-885 public void projectsWithManuallyDeclaredQuery() throws Exception { AbstractJpaQuery jpaQuery = createJpaQuery(SampleRepository.class.getMethod("projectWithExplicitQuery")); diff --git a/src/test/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributeSourceUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributeSourceUnitTests.java index c947c4d22..31f493921 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributeSourceUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributeSourceUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,10 +59,7 @@ public class StoredProcedureAttributeSourceUnitTests { when(entityMetadata.getEntityName()).thenReturn("User"); } - /** - * @see DATAJPA-455 - */ - @Test + @Test // DATAJPA-455 public void shouldCreateStoredProcedureAttributesFromProcedureMethodWithImplicitProcedureName() { StoredProcedureAttributes attr = creator.createFrom(method("plus1inout", Integer.class), entityMetadata); @@ -72,10 +69,7 @@ public class StoredProcedureAttributeSourceUnitTests { assertThat(attr.getOutputParameterName(), is(StoredProcedureAttributes.SYNTHETIC_OUTPUT_PARAMETER_NAME)); } - /** - * @see DATAJPA-455 - */ - @Test + @Test // DATAJPA-455 public void shouldCreateStoredProcedureAttributesFromProcedureMethodWithExplictName() { StoredProcedureAttributes attr = creator.createFrom(method("explicitlyNamedPlus1inout", Integer.class), @@ -86,10 +80,7 @@ public class StoredProcedureAttributeSourceUnitTests { assertThat(attr.getOutputParameterName(), is(StoredProcedureAttributes.SYNTHETIC_OUTPUT_PARAMETER_NAME)); } - /** - * @see DATAJPA-455 - */ - @Test + @Test // DATAJPA-455 public void shouldCreateStoredProcedureAttributesFromProcedureMethodWithExplictProcedureNameValue() { StoredProcedureAttributes attr = creator.createFrom(method("explicitlyNamedPlus1inout", Integer.class), @@ -100,10 +91,7 @@ public class StoredProcedureAttributeSourceUnitTests { assertThat(attr.getOutputParameterName(), is(StoredProcedureAttributes.SYNTHETIC_OUTPUT_PARAMETER_NAME)); } - /** - * @see DATAJPA-455 - */ - @Test + @Test // DATAJPA-455 public void shouldCreateStoredProcedureAttributesFromProcedureMethodWithExplictProcedureNameAlias() { StoredProcedureAttributes attr = creator @@ -114,10 +102,7 @@ public class StoredProcedureAttributeSourceUnitTests { assertThat(attr.getOutputParameterName(), is(StoredProcedureAttributes.SYNTHETIC_OUTPUT_PARAMETER_NAME)); } - /** - * @see DATAJPA-455 - */ - @Test + @Test // DATAJPA-455 public void shouldCreateStoredProcedureAttributesFromProcedureMethodBackedWithExplicitlyNamedProcedure() { StoredProcedureAttributes attr = creator @@ -128,10 +113,7 @@ public class StoredProcedureAttributeSourceUnitTests { assertThat(attr.getOutputParameterName(), is("res")); } - /** - * @see DATAJPA-455 - */ - @Test + @Test // DATAJPA-455 public void shouldCreateStoredProcedureAttributesFromProcedureMethodBackedWithImplicitlyNamedProcedure() { StoredProcedureAttributes attr = creator.createFrom(method("plus1", Integer.class), entityMetadata); @@ -141,10 +123,7 @@ public class StoredProcedureAttributeSourceUnitTests { assertThat(attr.getOutputParameterName(), is("res")); } - /** - * @see DATAJPA-871 - */ - @Test + @Test // DATAJPA-871 public void aliasedStoredProcedure() { StoredProcedureAttributes attr = creator @@ -155,10 +134,7 @@ public class StoredProcedureAttributeSourceUnitTests { assertThat(attr.getOutputParameterName(), is(StoredProcedureAttributes.SYNTHETIC_OUTPUT_PARAMETER_NAME)); } - /** - * @see DATAJPA-871 - */ - @Test + @Test // DATAJPA-871 public void aliasedStoredProcedure2() { StoredProcedureAttributes attr = creator @@ -180,42 +156,32 @@ public class StoredProcedureAttributeSourceUnitTests { /** * Explicitly mapped to a procedure with name "plus1inout" in database. - * - * @see DATAJPA-455 */ - @Procedure("plus1inout") + @Procedure("plus1inout") // DATAJPA-455 Integer explicitlyNamedPlus1inout(Integer arg); /** * Explicitly mapped to a procedure with name "plus1inout" in database via alias. - * - * @see DATAJPA-455 */ - @Procedure(procedureName = "plus1inout") + @Procedure(procedureName = "plus1inout") // DATAJPA-455 Integer explicitPlus1inoutViaProcedureNameAlias(Integer arg); /** * Implicitly mapped to a procedure with name "plus1inout" in database via alias. - * - * @see DATAJPA-455 */ - @Procedure + @Procedure // DATAJPA-455 Integer plus1inout(Integer arg); /** * Explicitly mapped to named stored procedure "User.plus1IO" in {@link EntityManager}. - * - * @see DATAJPA-455 */ - @Procedure(name = "User.plus1IO") + @Procedure(name = "User.plus1IO") // DATAJPA-455 Integer entityAnnotatedCustomNamedProcedurePlus1IO(@Param("arg") Integer arg); /** * Implicitly mapped to named stored procedure "User.plus1" in {@link EntityManager}. - * - * @see DATAJPA-455 */ - @Procedure + @Procedure // DATAJPA-455 Integer plus1(@Param("arg") Integer arg); @ComposedProcedureUsingAliasFor(explicitProcedureName = "plus1inout") diff --git a/src/test/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributesUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributesUnitTests.java index ddaff6454..81105148c 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributesUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/StoredProcedureAttributesUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 the original author or authors. + * Copyright 2015-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,10 +28,7 @@ import org.junit.Test; */ public class StoredProcedureAttributesUnitTests { - /** - * @see DATAJPA-681 - */ - @Test + @Test // DATAJPA-681 public void usesSyntheticOutputParameterNameForAdhocProcedureWithoutOutputName() { StoredProcedureAttributes attributes = new StoredProcedureAttributes("procedure", null, Long.class, false); diff --git a/src/test/java/org/springframework/data/jpa/repository/query/StringQueryUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/query/StringQueryUnitTests.java index f5e52ac9e..d4b582520 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/StringQueryUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/StringQueryUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,10 +39,7 @@ public class StringQueryUnitTests { public @Rule ExpectedException exception = ExpectedException.none(); - /** - * @see DATAJPA-341 - */ - @Test + @Test // DATAJPA-341 public void doesNotConsiderPlainLikeABinding() { String source = "select from User u where u.firstname like :firstname"; @@ -98,10 +95,7 @@ public class StringQueryUnitTests { assertThat(binding.getType(), is(Type.ENDING_WITH)); } - /** - * @see DATAJPA-461 - */ - @Test + @Test // DATAJPA-461 public void detectsNamedInParameterBindings() { String queryString = "select u from User u where u.id in :ids"; @@ -116,10 +110,7 @@ public class StringQueryUnitTests { assertNamedBinding(InParameterBinding.class, "ids", bindings.get(0)); } - /** - * @see DATAJPA-461 - */ - @Test + @Test // DATAJPA-461 public void detectsMultipleNamedInParameterBindings() { String queryString = "select u from User u where u.id in :ids and u.name in :names and foo = :bar"; @@ -136,10 +127,7 @@ public class StringQueryUnitTests { assertNamedBinding(ParameterBinding.class, "bar", bindings.get(2)); } - /** - * @see DATAJPA-461 - */ - @Test + @Test // DATAJPA-461 public void detectsPositionalInParameterBindings() { String queryString = "select u from User u where u.id in ?1"; @@ -154,10 +142,7 @@ public class StringQueryUnitTests { assertPositionalBinding(InParameterBinding.class, 1, bindings.get(0)); } - /** - * @see DATAJPA-461 - */ - @Test + @Test // DATAJPA-461 public void detectsMultiplePositionalInParameterBindings() { String queryString = "select u from User u where u.id in ?1 and u.names in ?2 and foo = ?3"; @@ -174,26 +159,17 @@ public class StringQueryUnitTests { assertPositionalBinding(ParameterBinding.class, 3, bindings.get(2)); } - /** - * @see DATAJPA-373 - */ - @Test + @Test // DATAJPA-373 public void handlesMultipleNamedLikeBindingsCorrectly() { new StringQuery("select u from User u where u.firstname like %:firstname or foo like :bar"); } - /** - * @see DATAJPA-292, DATAJPA-362 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-292, DATAJPA-362 public void rejectsDifferentBindingsForRepeatedParameter() { new StringQuery("select u from User u where u.firstname like %?1 and u.lastname like ?1%"); } - /** - * @see DATAJPA-461 - */ - @Test + @Test // DATAJPA-461 public void treatsGreaterThanBindingAsSimpleBinding() { StringQuery query = new StringQuery("select u from User u where u.createdDate > ?1"); @@ -203,10 +179,7 @@ public class StringQueryUnitTests { assertPositionalBinding(ParameterBinding.class, 1, bindings.get(0)); } - /** - * @see DATAJPA-473 - */ - @Test + @Test // DATAJPA-473 public void removesLikeBindingsFromQueryIfQueryContainsSimpleBinding() { StringQuery query = new StringQuery("SELECT a FROM Article a WHERE a.overview LIKE %:escapedWord% ESCAPE '~'" @@ -221,10 +194,7 @@ public class StringQueryUnitTests { + " OR a.content LIKE :escapedWord ESCAPE '~' OR a.title = :word ORDER BY a.articleId DESC")); } - /** - * @see DATAJPA-483 - */ - @Test + @Test // DATAJPA-483 public void detectsInBindingWithParentheses() { StringQuery query = new StringQuery("select count(we) from MyEntity we where we.status in (:statuses)"); @@ -235,10 +205,7 @@ public class StringQueryUnitTests { assertNamedBinding(InParameterBinding.class, "statuses", bindings.get(0)); } - /** - * @see DATAJPA-513 - */ - @Test + @Test // DATAJPA-513 public void rejectsNullParameterNameHintingTowardsAtParamForNullParameterName() { StringQuery query = new StringQuery("select x from X"); @@ -249,10 +216,7 @@ public class StringQueryUnitTests { query.getBindingFor(null); } - /** - * @see DATAJPA-545 - */ - @Test + @Test // DATAJPA-545 public void detectsInBindingWithSpecialFrenchCharactersInParentheses() { StringQuery query = new StringQuery("select * from MyEntity where abonnés in (:abonnés)"); @@ -263,10 +227,7 @@ public class StringQueryUnitTests { assertNamedBinding(InParameterBinding.class, "abonnés", bindings.get(0)); } - /** - * @see DATAJPA-545 - */ - @Test + @Test // DATAJPA-545 public void detectsInBindingWithSpecialCharactersInParentheses() { StringQuery query = new StringQuery("select * from MyEntity where øre in (:øre)"); @@ -277,10 +238,7 @@ public class StringQueryUnitTests { assertNamedBinding(InParameterBinding.class, "øre", bindings.get(0)); } - /** - * @see DATAJPA-545 - */ - @Test + @Test // DATAJPA-545 public void detectsInBindingWithSpecialAsianCharactersInParentheses() { StringQuery query = new StringQuery("select * from MyEntity where 생일 in (:생일)"); @@ -291,10 +249,7 @@ public class StringQueryUnitTests { assertNamedBinding(InParameterBinding.class, "생일", bindings.get(0)); } - /** - * @see DATAJPA-545 - */ - @Test + @Test // DATAJPA-545 public void detectsInBindingWithSpecialCharactersAndWordCharactersMixedInParentheses() { StringQuery query = new StringQuery("select * from MyEntity where foo in (:ab1babc생일233)"); @@ -305,18 +260,12 @@ public class StringQueryUnitTests { assertNamedBinding(InParameterBinding.class, "ab1babc생일233", bindings.get(0)); } - /** - * @see DATAJPA-362 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-362 public void rejectsDifferentBindingsForRepeatedParameter2() { new StringQuery("select u from User u where u.firstname like ?1 and u.lastname like %?1"); } - /** - * @see @DATAJPA-712 - */ - @Test + @Test // DATAJPA-712 public void shouldReplaceAllNamedExpressionParametersWithInClause() { StringQuery query = new StringQuery("select a from A a where a.b in :#{#bs} and a.c in :#{#cs}"); @@ -325,10 +274,7 @@ public class StringQueryUnitTests { assertThat(queryString, is("select a from A a where a.b in :__$synthetic$__1 and a.c in :__$synthetic$__2")); } - /** - * @see @DATAJPA-712 - */ - @Test + @Test // DATAJPA-712 public void shouldReplaceAllPositionExpressionParametersWithInClause() { StringQuery query = new StringQuery("select a from A a where a.b in ?#{#bs} and a.c in ?#{#cs}"); @@ -337,10 +283,7 @@ public class StringQueryUnitTests { assertThat(queryString, is("select a from A a where a.b in ?1 and a.c in ?2")); } - /** - * @see DATAJPA-864 - */ - @Test + @Test // DATAJPA-864 public void detectsConstructorExpressions() { assertThat(new StringQuery("select new Dto(a.foo, a.bar) from A a").hasConstructorExpression(), is(true)); @@ -349,10 +292,9 @@ public class StringQueryUnitTests { } /** - * @see DATAJPA-886 * @see JPA 2.1 specification, section 4.8 */ - @Test + @Test // DATAJPA-886 public void detectsConstructorExpressionForDefaultConstructor() { // Parentheses required diff --git a/src/test/java/org/springframework/data/jpa/repository/query/TupleConverterUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/query/TupleConverterUnitTests.java index c4d375f4c..4e6b17802 100644 --- a/src/test/java/org/springframework/data/jpa/repository/query/TupleConverterUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/query/TupleConverterUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,10 +61,7 @@ public class TupleConverterUnitTests { this.type = method.getResultProcessor().getReturnedType(); } - /** - * @see DATAJPA-984 - */ - @Test + @Test // DATAJPA-984 @SuppressWarnings("unchecked") public void returnsSingleTupleElementIfItMatchesExpectedType() throws Exception { @@ -76,10 +73,7 @@ public class TupleConverterUnitTests { assertThat(converter.convert(tuple), is((Object) "Foo")); } - /** - * @see DATAJPA-1024 - */ - @Test + @Test // DATAJPA-1024 @SuppressWarnings("unchecked") public void returnsNullForSingleElementTupleWithNullValue() throws Exception { diff --git a/src/test/java/org/springframework/data/jpa/repository/sample/ClassWithNestedRepository.java b/src/test/java/org/springframework/data/jpa/repository/sample/ClassWithNestedRepository.java index 95b9a6960..e8d4f0401 100644 --- a/src/test/java/org/springframework/data/jpa/repository/sample/ClassWithNestedRepository.java +++ b/src/test/java/org/springframework/data/jpa/repository/sample/ClassWithNestedRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -19,7 +19,6 @@ import org.springframework.data.jpa.domain.sample.User; import org.springframework.data.repository.Repository; /** - * @see DATAJPA-416 * @author Thomas Darimont * @author Oliver Gierke */ diff --git a/src/test/java/org/springframework/data/jpa/repository/sample/EmployeeRepositoryWithEmbeddedId.java b/src/test/java/org/springframework/data/jpa/repository/sample/EmployeeRepositoryWithEmbeddedId.java index 3454815fe..b9b239515 100644 --- a/src/test/java/org/springframework/data/jpa/repository/sample/EmployeeRepositoryWithEmbeddedId.java +++ b/src/test/java/org/springframework/data/jpa/repository/sample/EmployeeRepositoryWithEmbeddedId.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,8 +39,6 @@ public interface EmployeeRepositoryWithEmbeddedId List findAll(Predicate predicate, OrderSpecifier... orders); - /** - * @see DATAJPA-920 - */ + // DATAJPA-920 boolean existsByName(String name); } diff --git a/src/test/java/org/springframework/data/jpa/repository/sample/EmployeeRepositoryWithIdClass.java b/src/test/java/org/springframework/data/jpa/repository/sample/EmployeeRepositoryWithIdClass.java index a5228e523..4aff0410b 100644 --- a/src/test/java/org/springframework/data/jpa/repository/sample/EmployeeRepositoryWithIdClass.java +++ b/src/test/java/org/springframework/data/jpa/repository/sample/EmployeeRepositoryWithIdClass.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,8 +38,6 @@ public interface EmployeeRepositoryWithIdClass extends JpaRepository findAll(Predicate predicate, OrderSpecifier... orders); - /** - * @see DATAJPA-920 - */ + // DATAJPA-920 boolean existsByName(String name); } diff --git a/src/test/java/org/springframework/data/jpa/repository/sample/ItemRepository.java b/src/test/java/org/springframework/data/jpa/repository/sample/ItemRepository.java index 7211ef610..2bd9a2e7c 100755 --- a/src/test/java/org/springframework/data/jpa/repository/sample/ItemRepository.java +++ b/src/test/java/org/springframework/data/jpa/repository/sample/ItemRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import org.springframework.data.jpa.repository.JpaRepository; /** * @author Mark Paluch - * @see DATAJPA-413 * @see Final JPA 2.1 Specification 2.4.1.3 Derived Identities Example 2 */ public interface ItemRepository extends JpaRepository {} diff --git a/src/test/java/org/springframework/data/jpa/repository/sample/ItemSiteRepository.java b/src/test/java/org/springframework/data/jpa/repository/sample/ItemSiteRepository.java index 5579f8942..0b333d32c 100755 --- a/src/test/java/org/springframework/data/jpa/repository/sample/ItemSiteRepository.java +++ b/src/test/java/org/springframework/data/jpa/repository/sample/ItemSiteRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +21,6 @@ import org.springframework.data.jpa.repository.JpaRepository; /** * @author Mark Paluch - * @see DATAJPA-413 * @see Final JPA 2.1 Specification 2.4.1.3 Derived Identities Example 2 */ public interface ItemSiteRepository extends JpaRepository {} diff --git a/src/test/java/org/springframework/data/jpa/repository/sample/RepositoryMethodsWithEntityGraphConfigRepository.java b/src/test/java/org/springframework/data/jpa/repository/sample/RepositoryMethodsWithEntityGraphConfigRepository.java index 0d17a8c2b..b2a461a51 100644 --- a/src/test/java/org/springframework/data/jpa/repository/sample/RepositoryMethodsWithEntityGraphConfigRepository.java +++ b/src/test/java/org/springframework/data/jpa/repository/sample/RepositoryMethodsWithEntityGraphConfigRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2016 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -49,21 +49,15 @@ public interface RepositoryMethodsWithEntityGraphConfigRepository @EntityGraph(type = EntityGraphType.FETCH, value = "User.detail") User findOne(Integer id); - /** - * @see DATAJPA-696 - */ + // DATAJPA-696 @EntityGraph User getOneWithDefinedEntityGraphById(Integer id); - /** - * @see DATAJPA-696 - */ + // DATAJPA-696 @EntityGraph(attributePaths = { "roles", "colleagues.roles" }) User getOneWithAttributeNamesById(Integer id); - /** - * @see DATAJPA-790 - */ + // DATAJPA-790 @EntityGraph("User.detail") Page findAll(Predicate predicate, Pageable pageable); } diff --git a/src/test/java/org/springframework/data/jpa/repository/sample/RoleRepository.java b/src/test/java/org/springframework/data/jpa/repository/sample/RoleRepository.java index 94954e15d..bc43203bb 100644 --- a/src/test/java/org/springframework/data/jpa/repository/sample/RoleRepository.java +++ b/src/test/java/org/springframework/data/jpa/repository/sample/RoleRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2015 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -59,8 +59,6 @@ public interface RoleRepository extends CrudRepository, QueryDslP @QueryHints(@QueryHint(name = "foo", value = "bar")) Role findOne(Predicate predicate); - /** - * @see DATAJPA-509 - */ + // DATAJPA-509 long countByName(String name); } diff --git a/src/test/java/org/springframework/data/jpa/repository/sample/SiteRepository.java b/src/test/java/org/springframework/data/jpa/repository/sample/SiteRepository.java index 03f14d39d..2813718a1 100755 --- a/src/test/java/org/springframework/data/jpa/repository/sample/SiteRepository.java +++ b/src/test/java/org/springframework/data/jpa/repository/sample/SiteRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 the original author or authors. + * Copyright 2016-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -20,7 +20,6 @@ import org.springframework.data.jpa.repository.JpaRepository; /** * @author Mark Paluch - * @see DATAJPA-413 * @see Final JPA 2.1 Specification 2.4.1.3 Derived Identities Example 2 */ public interface SiteRepository extends JpaRepository {} diff --git a/src/test/java/org/springframework/data/jpa/repository/sample/UserRepository.java b/src/test/java/org/springframework/data/jpa/repository/sample/UserRepository.java index e9f7c2c5f..d7654d369 100644 --- a/src/test/java/org/springframework/data/jpa/repository/sample/UserRepository.java +++ b/src/test/java/org/springframework/data/jpa/repository/sample/UserRepository.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2014 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -71,10 +71,8 @@ public interface UserRepository /** * Redeclaration of {@link CrudRepository#delete(java.io.Serializable)}. to make sure the transaction configuration of * the original method is considered if the redeclaration does not carry a {@link Transactional} annotation. - * - * @see DATACMNS-649 */ - void delete(Integer id); + void delete(Integer id); // DATACMNS-649 /** * Retrieve users by their email address. The finder {@literal User.findByEmailAddress} is declared as annotation at @@ -141,15 +139,11 @@ public interface UserRepository List findByFirstnameNotIn(Collection firstnames); - /** - * @see DATAJPA-292 - */ + // DATAJPA-292 @Query("select u from User u where u.firstname like ?1%") List findByFirstnameLike(String firstname); - /** - * @see DATAJPA-292 - */ + // DATAJPA-292 @Query("select u from User u where u.firstname like :firstname%") List findByFirstnameLikeNamed(@Param("firstname") String firstname); @@ -222,20 +216,14 @@ public interface UserRepository @Query("select u.lastname from User u group by u.lastname") Page findByLastnameGrouped(Pageable pageable); - /** - * @see DATAJPA-117 - */ + // DATAJPA-117 @Query(value = "SELECT * FROM SD_User WHERE lastname = ?1", nativeQuery = true) List findNativeByLastname(String lastname); - /** - * @see DATAJPA-132 - */ + // DATAJPA-132 List findByActiveTrue(); - /** - * @see DATAJPA-132 - */ + // DATAJPA-132 List findByActiveFalse(); /** @@ -244,362 +232,238 @@ public interface UserRepository // @Query("select u.colleagues from User u where u = ?1") // List findColleaguesFor(User user); - /** - * @see DATAJPA-188 - */ + // DATAJPA-188 List findByCreatedAtBefore(Date date); - /** - * @see DATAJPA-188 - */ + // DATAJPA-188 List findByCreatedAtAfter(Date date); - /** - * @see DATAJPA-180 - */ + // DATAJPA-180 List findByFirstnameStartingWith(String firstname); - /** - * @see DATAJPA-180 - */ + // DATAJPA-180 List findByFirstnameEndingWith(String firstname); - /** - * @see DATAJPA-180 - */ + // DATAJPA-180 List findByFirstnameContaining(String firstname); @Query(value = "SELECT 1 FROM SD_User", nativeQuery = true) List findOnesByNativeQuery(); - /** - * @see DATAJPA-231 - */ + // DATAJPA-231 long countByLastname(String lastname); - /** - * @see DATAJPA-231 - */ + // DATAJPA-231 int countUsersByFirstname(String firstname); - /** - * @see DATAJPA-920 - */ + // DATAJPA-920 boolean existsByLastname(String lastname); - /** - * @see DATAJPA-391 - */ + // DATAJPA-391 @Query("select u.firstname from User u where u.lastname = ?1") List findFirstnamesByLastname(String lastname); - /** - * @see DATAJPA-415 - */ + // DATAJPA-415 Collection findByIdIn(@Param("ids") Integer... ids); - /** - * @see DATAJPA-461 - */ + // DATAJPA-461 @Query("select u from User u where u.id in ?1") Collection findByIdsCustomWithPositionalVarArgs(Integer... ids); - /** - * @see DATAJPA-461 - */ + // DATAJPA-461 @Query("select u from User u where u.id in :ids") Collection findByIdsCustomWithNamedVarArgs(@Param("ids") Integer... ids); - /** - * @see DATAJPA-415 - */ + // DATAJPA-415 @Modifying @Query("update #{#entityName} u set u.active = :activeState where u.id in :ids") void updateUserActiveState(@Param("activeState") boolean activeState, @Param("ids") Integer... ids); - /** - * @see DATAJPA-405 - */ + // DATAJPA-405 List findAllByOrderByLastnameAsc(); - /** - * @see DATAJPA-454 - */ + // DATAJPA-454 List findByBinaryData(byte[] data); - /** - * @see DATAJPA-486 - */ + // DATAJPA-486 Slice findSliceByLastname(String lastname, Pageable pageable); - /** - * @see DATAJPA-496 - */ + // DATAJPA-496 List findByAttributesIn(Set attributes); - /** - * @see DATAJPA-460 - */ + // DATAJPA-460 Long removeByLastname(String lastname); - /** - * @see DATAJPA-460 - */ + // DATAJPA-460 List deleteByLastname(String lastname); /** - * @see DATAJPA-505 * @see https://issues.apache.org/jira/browse/OPENJPA-2484 */ + // DATAJPA-505 // @Query(value = "select u.binaryData from User u where u.id = :id") // byte[] findBinaryDataByIdJpaQl(@Param("id") Integer id); /** * Explicitly mapped to a procedure with name "plus1inout" in database. - * - * @see DATAJPA-455 */ - @Procedure("plus1inout") + @Procedure("plus1inout") // DATAJPA-455 Integer explicitlyNamedPlus1inout(Integer arg); /** * Implicitly mapped to a procedure with name "plus1inout" in database via alias. - * - * @see DATAJPA-455 */ - @Procedure(procedureName = "plus1inout") + @Procedure(procedureName = "plus1inout") // DATAJPA-455 Integer plus1inout(Integer arg); /** * Explicitly mapped to named stored procedure "User.plus1IO" in {@link EntityManager}. - * - * @see DATAJPA-455 */ - @Procedure(name = "User.plus1IO") + @Procedure(name = "User.plus1IO") // DATAJPA-455 Integer entityAnnotatedCustomNamedProcedurePlus1IO(@Param("arg") Integer arg); /** * Implicitly mapped to named stored procedure "User.plus1" in {@link EntityManager}. - * - * @see DATAJPA-455 */ - @Procedure + @Procedure // DATAJPA-455 Integer plus1(@Param("arg") Integer arg); - /** - * @see DATAJPA-456 - */ + // DATAJPA-456 @Query(value = "select u from User u where u.firstname like ?1%", countProjection = "u.firstname") Page findAllByFirstnameLike(String firstname, Pageable page); - /** - * @see DATAJPA-456 - */ + // DATAJPA-456 @Query(name = "User.findBySpringDataNamedQuery", countProjection = "u.firstname") Page findByNamedQueryAndCountProjection(String firstname, Pageable page); - /** - * @see DATAJPA-551 - */ + // DATAJPA-551 User findFirstByOrderByAgeDesc(); - /** - * @see DATAJPA-551 - */ + // DATAJPA-551 User findFirst1ByOrderByAgeDesc(); - /** - * @see DATAJPA-551 - */ + // DATAJPA-551 User findTopByOrderByAgeDesc(); - /** - * @see DATAJPA-551 - */ + // DATAJPA-551 User findTopByOrderByAgeAsc(); - /** - * @see DATAJPA-551 - */ + // DATAJPA-551 User findTop1ByOrderByAgeAsc(); - /** - * @see DATAJPA-551 - */ + // DATAJPA-551 List findTop2ByOrderByAgeDesc(); - /** - * @see DATAJPA-551 - */ + // DATAJPA-551 List findFirst2ByOrderByAgeDesc(); - /** - * @see DATAJPA-551 - */ + // DATAJPA-551 List findFirst2UsersBy(Sort sort); - /** - * @see DATAJPA-551 - */ + // DATAJPA-551 List findTop2UsersBy(Sort sort); - /** - * @see DATAJPA-551 - */ + // DATAJPA-551 Page findFirst3UsersBy(Pageable page); - /** - * @see DATAJPA-551 - */ + // DATAJPA-551 Page findFirst2UsersBy(Pageable page); - /** - * @see DATAJPA-551 - */ + // DATAJPA-551 Slice findTop3UsersBy(Pageable page); - /** - * @see DATAJPA-551 - */ + // DATAJPA-551 Slice findTop2UsersBy(Pageable page); - /** - * @see DATAJPA-506 - */ + // DATAJPA-506 @Query(value = "select u.binaryData from SD_User u where u.id = ?1", nativeQuery = true) byte[] findBinaryDataByIdNative(Integer id); - /** - * @see DATAJPA-506 - */ + // DATAJPA-506 @Query("select u from User u where u.emailAddress = ?1") Optional findOptionalByEmailAddress(String emailAddress); - /** - * @see DATAJPA-564 - */ + // DATAJPA-564 @Query("select u from User u where u.firstname = ?#{[0]} and u.firstname = ?1 and u.lastname like %?#{[1]}% and u.lastname like %?2%") List findByFirstnameAndLastnameWithSpelExpression(String firstname, String lastname); - /** - * @see DATAJPA-564 - */ + // DATAJPA-564 @Query("select u from User u where u.lastname like %:#{[0]}% and u.lastname like %:lastname%") List findByLastnameWithSpelExpression(@Param("lastname") String lastname); - /** - * @see DATAJPA-564 - */ + // DATAJPA-564 @Query("select u from User u where u.firstname = ?#{'Oliver'}") List findOliverBySpELExpressionWithoutArgumentsWithQuestionmark(); - /** - * @see DATAJPA-564 - */ + // DATAJPA-564 @Query("select u from User u where u.firstname = :#{'Oliver'}") List findOliverBySpELExpressionWithoutArgumentsWithColon(); - /** - * @see DATAJPA-564 - */ + // DATAJPA-564 @Query("select u from User u where u.age = ?#{[0]}") List findUsersByAgeForSpELExpressionByIndexedParameter(int age); - /** - * @see DATAJPA-564 - */ + // DATAJPA-564 @Query("select u from User u where u.firstname = :firstname and u.firstname = :#{#firstname}") List findUsersByFirstnameForSpELExpression(@Param("firstname") String firstname); - /** - * @see DATAJPA-564 - */ + // DATAJPA-564 @Query("select u from User u where u.emailAddress = ?#{principal.emailAddress}") List findCurrentUserWithCustomQuery(); - /** - * @see DATAJPA-564 - */ + // DATAJPA-564 @Query("select u from User u where u.firstname = ?1 and u.firstname=?#{[0]} and u.emailAddress = ?#{principal.emailAddress}") List findByFirstnameAndCurrentUserWithCustomQuery(String firstname); - /** - * @see DATAJPA-564 - */ + // DATAJPA-564 @Query("select u from User u where u.firstname = :#{#firstname}") List findUsersByFirstnameForSpELExpressionWithParameterVariableOnly(@Param("firstname") String firstname); - /** - * @see DATAJPA-564 - */ + // DATAJPA-564 @Query("select u from User u where u.firstname = ?#{[0]}") List findUsersByFirstnameForSpELExpressionWithParameterIndexOnly(String firstname); - /** - * @see DATAJPA-564 - */ + // DATAJPA-564 @Query( value = "select * from (select rownum() as RN, u.* from SD_User u) where RN between ?#{ #pageable.offset -1} and ?#{#pageable.offset + #pageable.pageSize}", countQuery = "select count(u.id) from SD_User u", nativeQuery = true) Page findUsersInNativeQueryWithPagination(Pageable pageable); - /** - * @see DATAJPA-629 - */ + // DATAJPA-629 @Query("select u from #{#entityName} u where u.firstname = ?#{[0]} and u.lastname = ?#{[1]}") List findUsersByFirstnameForSpELExpressionWithParameterIndexOnlyWithEntityExpression(String firstname, String lastname); - /** - * @see DATAJPA-606 - */ + // DATAJPA-606 List findByAgeIn(Collection ages); - /** - * @see DATAJPA-606 - */ + // DATAJPA-606 List queryByAgeIn(Integer[] ages); - /** - * @see DATAJPA-606 - */ + // DATAJPA-606 List queryByAgeInOrFirstname(Integer[] ages, String firstname); - /** - * @see DATAJPA-677 - */ + // DATAJPA-677 @Query("select u from User u") Stream findAllByCustomQueryAndStream(); - /** - * @see DATAJPA-677 - */ + // DATAJPA-677 Stream readAllByFirstnameNotNull(); - /** - * @see DATAJPA-677 - */ + // DATAJPA-677 @Query("select u from User u") Stream streamAllPaged(Pageable pageable); - /** - * @see DATAJPA-830 - */ + // DATAJPA-830 List findByLastnameNotContaining(String part); - /** - * @see DATAJPA-829 - */ + // DATAJPA-829 List findByRolesContaining(Role role); - /** - * @see DATAJPA-829 - */ + // DATAJPA-829 List findByRolesNotContaining(Role role); - /** - * @see DATAJPA-858 - */ + // DATAJPA-858 List findByRolesNameContaining(String name); List findRolesAndFirstnameBy(); diff --git a/src/test/java/org/springframework/data/jpa/repository/support/CrudMethodMetadataPopulatingMethodInterceptorUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/support/CrudMethodMetadataPopulatingMethodInterceptorUnitTests.java index def986ad4..1e57215c9 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/CrudMethodMetadataPopulatingMethodInterceptorUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/CrudMethodMetadataPopulatingMethodInterceptorUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2014 the original author or authors. + * Copyright 2012-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,10 +45,7 @@ public class CrudMethodMetadataPopulatingMethodInterceptorUnitTests { @Mock MethodInvocation invocation; - /** - * @see DATAJPA-268 - */ - @Test + @Test // DATAJPA-268 public void cleansUpBoundResources() throws Throwable { Method method = prepareMethodInvocation("someMethod"); @@ -59,10 +56,7 @@ public class CrudMethodMetadataPopulatingMethodInterceptorUnitTests { assertThat(TransactionSynchronizationManager.getResource(method), is(nullValue())); } - /** - * @see DATAJPA-839 - */ - @Test + @Test // DATAJPA-839 public void looksUpCrudMethodMetadataForEveryInvocation() throws Throwable { CrudMethodMetadata metadata = new CrudMethodMetadataPostProcessor().getCrudMethodMetadata(); diff --git a/src/test/java/org/springframework/data/jpa/repository/support/DefaultJpaContextIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/support/DefaultJpaContextIntegrationTests.java index b92de1733..88dde3cce 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/DefaultJpaContextIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/DefaultJpaContextIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015-2016 the original author or authors. + * Copyright 2015-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -84,10 +84,7 @@ public class DefaultJpaContextIntegrationTests { this.jpaContext = new DefaultJpaContext(new HashSet(Arrays.asList(firstEm, secondEm))); } - /** - * @see DATAJPA-669 - */ - @Test + @Test // DATAJPA-669 public void rejectsUnmanagedType() { exception.expect(IllegalArgumentException.class); @@ -96,18 +93,12 @@ public class DefaultJpaContextIntegrationTests { jpaContext.getEntityManagerByManagedType(Object.class); } - /** - * @see DATAJPA-669 - */ - @Test + @Test // DATAJPA-669 public void returnsEntitymanagerForUniqueType() { assertThat(jpaContext.getEntityManagerByManagedType(Category.class), is(firstEm)); } - /** - * @see DATAJPA-669 - */ - @Test + @Test // DATAJPA-669 public void rejectsRequestForTypeManagedByMultipleEntityManagers() { exception.expect(IllegalArgumentException.class); @@ -116,11 +107,7 @@ public class DefaultJpaContextIntegrationTests { jpaContext.getEntityManagerByManagedType(User.class); } - /** - * @see DATAJPA-813 - * @see DATAJPA-956 - */ - @Test + @Test // DATAJPA-813, DATAJPA-956 public void bootstrapsDefaultJpaContextInSpringContainer() { ConfigurableApplicationContext context = new AnnotationConfigApplicationContext(Config.class); @@ -131,10 +118,7 @@ public class DefaultJpaContextIntegrationTests { context.close(); } - /** - * @see DATAJPA-813 - */ - @Test + @Test // DATAJPA-813 public void bootstrapsDefaultJpaContextInSpringContainerWithEntityManagerFromJndi() throws Exception { SimpleNamingContextBuilder builder = SimpleNamingContextBuilder.emptyActivatedContextBuilder(); @@ -179,8 +163,7 @@ public class DefaultJpaContextIntegrationTests { } // A non-EntityManagerFactory JNDI object to make sure the detection doesn't include it - // @see DATAJPA-956 - + // see DATAJPA-956 @Bean public JndiObjectFactoryBean jndiObject() throws NamingException { diff --git a/src/test/java/org/springframework/data/jpa/repository/support/DefaultJpaContextUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/support/DefaultJpaContextUnitTests.java index ebfb19c7d..e9171501e 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/DefaultJpaContextUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/DefaultJpaContextUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 the original author or authors. + * Copyright 2015-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -30,18 +30,12 @@ import org.junit.Test; */ public class DefaultJpaContextUnitTests { - /** - * @see DATAJPA-669 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-669 public void rejectsNullEntityManagers() { new DefaultJpaContext(null); } - /** - * @see DATAJPA-669 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-669 public void rejectsEmptyEntityManagers() { new DefaultJpaContext(Collections. emptySet()); } diff --git a/src/test/java/org/springframework/data/jpa/repository/support/DefaultJpaEntityMetadataUnitTest.java b/src/test/java/org/springframework/data/jpa/repository/support/DefaultJpaEntityMetadataUnitTest.java index f314efe39..fad62e489 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/DefaultJpaEntityMetadataUnitTest.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/DefaultJpaEntityMetadataUnitTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2013-2016 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -62,10 +62,7 @@ public class DefaultJpaEntityMetadataUnitTest { assertThat(metadata.getEntityName(), is("Entity")); } - /** - * @see DATAJPA-871 - */ - @Test + @Test // DATAJPA-871 public void returnsCustomizedEntityNameIfConfiguredViaComposedAnnotation() { DefaultJpaEntityMetadata metadata = new DefaultJpaEntityMetadata( diff --git a/src/test/java/org/springframework/data/jpa/repository/support/DefaultTransactionDisablingIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/support/DefaultTransactionDisablingIntegrationTests.java index 17311e12b..f0d95143f 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/DefaultTransactionDisablingIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/DefaultTransactionDisablingIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2015 the original author or authors. + * Copyright 2015-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -47,10 +47,7 @@ public abstract class DefaultTransactionDisablingIntegrationTests { @Autowired UserRepository repository; @Autowired DelegatingTransactionManager txManager; - /** - * @see DATAJPA-685 - */ - @Test + @Test // DATAJPA-685 public void considersExplicitConfigurationOnRepositoryInterface() { repository.findOne(1); @@ -58,10 +55,7 @@ public abstract class DefaultTransactionDisablingIntegrationTests { assertThat(txManager.getDefinition().isReadOnly(), is(false)); } - /** - * @see DATAJPA-685 - */ - @Test + @Test // DATAJPA-685 public void doesNotUseDefaultTransactionsOnNonRedeclaredMethod() { repository.findAll(new PageRequest(0, 10)); @@ -69,10 +63,7 @@ public abstract class DefaultTransactionDisablingIntegrationTests { assertThat(txManager.getDefinition(), is(nullValue())); } - /** - * @see DATAJPA-685 - */ - @Test + @Test // DATAJPA-685 public void persistingAnEntityShouldThrowExceptionDueToMissingTransaction() { exception.expect(InvalidDataAccessApiUsageException.class); diff --git a/src/test/java/org/springframework/data/jpa/repository/support/EntityManagerBeanDefinitionRegistrarPostProcessorIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/support/EntityManagerBeanDefinitionRegistrarPostProcessorIntegrationTests.java index 8011a5c9b..3b5a3b608 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/EntityManagerBeanDefinitionRegistrarPostProcessorIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/EntityManagerBeanDefinitionRegistrarPostProcessorIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -86,10 +86,7 @@ public class EntityManagerBeanDefinitionRegistrarPostProcessorIntegrationTests { @Autowired EntityManagerInjectionTarget target; - /** - * @see DATAJPA-445 - */ - @Test + @Test // DATAJPA-445 public void injectsEntityManagerIntoConstructors() { assertThat(target, is(notNullValue())); diff --git a/src/test/java/org/springframework/data/jpa/repository/support/EntityManagerBeanDefinitionRegistratPostProcessorUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/support/EntityManagerBeanDefinitionRegistratPostProcessorUnitTests.java index c9833a4a6..3abf39cf1 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/EntityManagerBeanDefinitionRegistratPostProcessorUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/EntityManagerBeanDefinitionRegistratPostProcessorUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -32,10 +32,7 @@ import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; */ public class EntityManagerBeanDefinitionRegistratPostProcessorUnitTests { - /** - * @see DATAJPA-453 - */ - @Test + @Test // DATAJPA-453 public void findsBeanDefinitionInParentBeanFactory() { DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory(); diff --git a/src/test/java/org/springframework/data/jpa/repository/support/JpaEntityInformationSupportUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/support/JpaEntityInformationSupportUnitTests.java index 6ff5b9ae0..f92c7ba53 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/JpaEntityInformationSupportUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/JpaEntityInformationSupportUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 the original author or authors. + * Copyright 2011-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -54,10 +54,7 @@ public class JpaEntityInformationSupportUnitTests { assertEquals("AnotherNamedUser", second.getEntityName()); } - /** - * @see DATAJPA-93 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-93 public void rejectsClassNotBeingFoundInMetamodel() { when(em.getMetamodel()).thenReturn(metaModel); diff --git a/src/test/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformationIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformationIntegrationTests.java index a4ba76ad0..31989d40b 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformationIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformationIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2015 the original author or authors. + * Copyright 2011-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,6 +39,7 @@ import org.hibernate.Version; import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; + import org.springframework.data.jpa.domain.AbstractPersistable; import org.springframework.data.jpa.domain.sample.ConcreteType1; import org.springframework.data.jpa.domain.sample.Item; @@ -85,9 +86,8 @@ public class JpaMetamodelEntityInformationIntegrationTests { * {@link MappedSuperclass}es correctly). * * @see https://hibernate.onjira.com/browse/HHH-6896 - * @see DATAJPA-141 */ - @Test + @Test // DATAJPA-141 @Ignore public void detectsIdTypeForMappedSuperclass() { @@ -95,20 +95,14 @@ public class JpaMetamodelEntityInformationIntegrationTests { assertEquals(Serializable.class, information.getIdType()); } - /** - * @see DATAJPA-50 - */ - @Test + @Test // DATAJPA-50 public void detectsIdClass() { EntityInformation information = getEntityInformation(PersistableWithIdClass.class, em); assertThat(information.getIdType(), is(typeCompatibleWith(PersistableWithIdClassPK.class))); } - /** - * @see DATAJPA-50 - */ - @Test + @Test // DATAJPA-50 public void returnsIdOfPersistableInstanceCorrectly() { PersistableWithIdClass entity = new PersistableWithIdClass(2L, 4L); @@ -121,10 +115,7 @@ public class JpaMetamodelEntityInformationIntegrationTests { assertThat(id, is((Object) new PersistableWithIdClassPK(2L, 4L))); } - /** - * @see DATAJPA-413 - */ - @Test + @Test // DATAJPA-413 public void returnsIdOfEntityWithIdClassCorrectly() { Item item = new Item(2, 1); @@ -136,10 +127,7 @@ public class JpaMetamodelEntityInformationIntegrationTests { assertThat(id, is((Object) new ItemId(2, 1))); } - /** - * @see DATAJPA-413 - */ - @Test + @Test // DATAJPA-413 public void returnsDerivedIdOfEntityWithIdClassCorrectly() { Item item = new Item(1, 2); @@ -154,10 +142,7 @@ public class JpaMetamodelEntityInformationIntegrationTests { assertThat(id, is((Object) new ItemSiteId(new ItemId(1, 2), 3))); } - /** - * @see DATAJPA-413 - */ - @Test + @Test // DATAJPA-413 public void returnsPartialEmptyDerivedIdOfEntityWithIdClassCorrectly() { Item item = new Item(1, null); @@ -172,10 +157,7 @@ public class JpaMetamodelEntityInformationIntegrationTests { assertThat(id, is((Object) new ItemSiteId(new ItemId(1, null), 3))); } - /** - * @see DATAJPA-119 - */ - @Test + @Test // DATAJPA-119 public void favoursVersionAnnotationIfPresent() { EntityInformation information = new JpaMetamodelEntityInformation( @@ -191,10 +173,7 @@ public class JpaMetamodelEntityInformationIntegrationTests { assertThat(information.isNew(entity), is(false)); } - /** - * @see DATAJPA-348 - */ - @Test + @Test // DATAJPA-348 public void findsIdClassOnMappedSuperclass() { EntityManagerFactory emf = Persistence.createEntityManagerFactory(getMetadadataPersitenceUnitName()); @@ -206,10 +185,7 @@ public class JpaMetamodelEntityInformationIntegrationTests { assertThat(information.getIdType(), is((Object) BaseIdClass.class)); } - /** - * @see DATACMNS-357 - */ - @Test + @Test // DATACMNS-357 public void detectsNewStateForEntityWithPrimitiveId() { EntityInformation information = new JpaMetamodelEntityInformation( @@ -222,10 +198,7 @@ public class JpaMetamodelEntityInformationIntegrationTests { assertThat(information.isNew(sample), is(false)); } - /** - * @see DATAJPA-509 - */ - @Test + @Test // DATAJPA-509 public void jpaMetamodelEntityInformationShouldRespectExplicitlyConfiguredEntityNameFromOrmXml() { JpaEntityInformation info = new JpaMetamodelEntityInformation(Role.class, @@ -234,10 +207,7 @@ public class JpaMetamodelEntityInformationIntegrationTests { assertThat(info.getEntityName(), is("ROLE")); } - /** - * @see DATAJPA-561 - */ - @Test + @Test // DATAJPA-561 public void considersEntityWithPrimitiveVersionPropertySetToDefaultNew() { EntityInformation information = new JpaMetamodelEntityInformation( @@ -246,10 +216,7 @@ public class JpaMetamodelEntityInformationIntegrationTests { assertThat(information.isNew(new PrimitiveVersionProperty()), is(true)); } - /** - * @see DATAJPA-568 - */ - @Test + @Test // DATAJPA-568 public void considersEntityAsNotNewWhenHavingIdSetAndUsingPrimitiveTypeForVersionProperty() { EntityInformation information = new JpaMetamodelEntityInformation( @@ -261,10 +228,7 @@ public class JpaMetamodelEntityInformationIntegrationTests { assertThat(information.isNew(pvp), is(false)); } - /** - * @see DATAJPA-568 - */ - @Test + @Test // DATAJPA-568 public void fallsBackToIdInspectionForAPrimitiveVersionProperty() { EntityInformation information = new JpaMetamodelEntityInformation( @@ -279,10 +243,7 @@ public class JpaMetamodelEntityInformationIntegrationTests { assertThat(information.isNew(pvp), is(false)); } - /** - * @see DATAJPA-582 - */ - @Test + @Test // DATAJPA-582 public void considersEntityWithUnsetCompundIdNew() { EntityInformation information = getEntityInformation(SampleWithIdClass.class, em); @@ -290,10 +251,7 @@ public class JpaMetamodelEntityInformationIntegrationTests { assertThat(information.isNew(new SampleWithIdClass()), is(true)); } - /** - * @see DATAJPA-582 - */ - @Test + @Test // DATAJPA-582 public void considersEntityWithSetTimestampVersionNotNew() { EntityInformation information = getEntityInformation( @@ -305,10 +263,7 @@ public class JpaMetamodelEntityInformationIntegrationTests { assertThat(information.isNew(entity), is(false)); } - /** - * @see DATAJPA-582, DATAJPA-581 - */ - @Test + @Test // DATAJPA-582, DATAJPA-581 public void considersEntityWithNonPrimitiveNonNullIdTypeNotNew() { EntityInformation information = getEntityInformation(User.class, em); @@ -321,10 +276,9 @@ public class JpaMetamodelEntityInformationIntegrationTests { } /** - * @see DATAJPA-820 - Ignored as Hibernate < 4.3 doesn't expose the version property properly if it's declared on the - * superclass. + * Ignored as Hibernate < 4.3 doesn't expose the version property properly if it's declared on the superclass. */ - @Test + @Test // DATAJPA-820 @Ignore public void detectsVersionPropertyOnMappedSuperClass() { diff --git a/src/test/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformationUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformationUnitTests.java index 04c95cca6..0147040bc 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformationUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/JpaMetamodelEntityInformationUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 the original author or authors. + * Copyright 2012-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,10 +70,7 @@ public class JpaMetamodelEntityInformationUnitTests { when(idType.getJavaType()).thenReturn(PersistableWithIdClassPK.class); } - /** - * @see DATAJPA-50 - */ - @Test + @Test // DATAJPA-50 public void doesNotCreateIdIfAllPartialAttributesAreNull() { JpaMetamodelEntityInformation information = new JpaMetamodelEntityInformation( diff --git a/src/test/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactoryUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactoryUnitTests.java index 4b327cf50..b614c5503 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactoryUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/JpaRepositoryFactoryUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2015 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -158,10 +158,7 @@ public class JpaRepositoryFactoryUnitTests { } } - /** - * @see DATAJPA-710, DATACMNS-542 - */ - @Test + @Test // DATAJPA-710, DATACMNS-542 public void usesConfiguredRepositoryBaseClass() { factory.setRepositoryBaseClass(CustomJpaRepository.class); @@ -170,10 +167,7 @@ public class JpaRepositoryFactoryUnitTests { assertEquals(CustomJpaRepository.class, ((Advised) repository).getTargetClass()); } - /** - * @see DATAJPA-819 - */ - @Test + @Test // DATAJPA-819 public void crudMethodMetadataPostProcessorUsesBeanClassLoader() { ClassLoader classLoader = new OverridingClassLoader(ClassUtils.getDefaultClassLoader()); diff --git a/src/test/java/org/springframework/data/jpa/repository/support/JpaRepositoryTests.java b/src/test/java/org/springframework/data/jpa/repository/support/JpaRepositoryTests.java index fc0d843b5..aafbdccaf 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/JpaRepositoryTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/JpaRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2014 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -73,10 +73,7 @@ public class JpaRepositoryTests { assertThat(repository.count(), is(0L)); } - /** - * @see DATAJPA-50 - */ - @Test + @Test // DATAJPA-50 public void executesCrudOperationsForEntityWithIdClass() { PersistableWithIdClass entity = new PersistableWithIdClass(1L, 1L); @@ -90,10 +87,7 @@ public class JpaRepositoryTests { assertThat(idClassRepository.findOne(id), is(entity)); } - /** - * @see DATAJPA-266 - */ - @Test + @Test // DATAJPA-266 public void testExistsForDomainObjectsWithCompositeKeys() throws Exception { PersistableWithIdClass s1 = idClassRepository.save(new PersistableWithIdClass(1L, 1L)); @@ -104,10 +98,7 @@ public class JpaRepositoryTests { assertThat(idClassRepository.exists(new PersistableWithIdClassPK(1L, 2L)), is(false)); } - /** - * @see DATAJPA-527 - */ - @Test + @Test // DATAJPA-527 public void executesExistsForEntityWithIdClass() { PersistableWithIdClass entity = new PersistableWithIdClass(1L, 1L); diff --git a/src/test/java/org/springframework/data/jpa/repository/support/MailMessageRepositoryIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/support/MailMessageRepositoryIntegrationTests.java index 37ae4052b..87d92decc 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/MailMessageRepositoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/MailMessageRepositoryIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2013 the original author or authors. + * Copyright 2013-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,10 +63,7 @@ public class MailMessageRepositoryIntegrationTests { @Autowired MailMessageRepository mailMessageRepository; - /** - * @see DATAJPA-12 - */ - @Test + @Test // DATAJPA-12 public void shouldSortMailWithPageRequestAndJpaSortCriteriaNullsFirst() { MailMessage message1 = new MailMessage(); @@ -89,10 +86,7 @@ public class MailMessageRepositoryIntegrationTests { assertThat(messages.get(1).getMailSender(), is(sender1)); } - /** - * @see DATAJPA-12 - */ - @Test + @Test // DATAJPA-12 public void shouldSortMailWithQueryDslRepositoryAndDslSortCriteriaNullsFirst() { MailMessage message1 = new MailMessage(); @@ -114,10 +108,7 @@ public class MailMessageRepositoryIntegrationTests { assertThat(messages.get(1).getMailSender(), is(sender1)); } - /** - * @see DATAJPA-491 - */ - @Test + @Test // DATAJPA-491 public void shouldSortMailWithNestedQueryDslSortCriteriaNullsFirst() { MailUser fooMailUser = new MailUser("foo"); @@ -143,10 +134,7 @@ public class MailMessageRepositoryIntegrationTests { assertThat(messages.get(1).getMailSender(), is(sender1)); } - /** - * @see DATAJPA-491 - */ - @Test + @Test // DATAJPA-491 public void shouldSortMailWithNestedStringBasedSortCriteriaNullsFirst() { MailUser fooMailUser = new MailUser("foo"); diff --git a/src/test/java/org/springframework/data/jpa/repository/support/QueryDslJpaRepositoryTests.java b/src/test/java/org/springframework/data/jpa/repository/support/QueryDslJpaRepositoryTests.java index 63f06c56b..b8188b135 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/QueryDslJpaRepositoryTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/QueryDslJpaRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2016 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -106,10 +106,7 @@ public class QueryDslJpaRepositoryTests { assertThat(result, hasItems(carter, dave)); } - /** - * @see DATAJPA-243 - */ - @Test + @Test // DATAJPA-243 public void considersSortingProvidedThroughPageable() { Predicate lastnameContainsE = user.lastname.contains("e"); @@ -126,10 +123,7 @@ public class QueryDslJpaRepositoryTests { assertThat(result.getContent().get(1), is(dave)); } - /** - * @see DATAJPA-296 - */ - @Test + @Test // DATAJPA-296 public void appliesIgnoreCaseOrdering() { Sort sort = new Sort(new Order(Direction.DESC, "lastname").ignoreCase(), new Order(Direction.ASC, "firstname")); @@ -141,10 +135,7 @@ public class QueryDslJpaRepositoryTests { assertThat(result.getContent().get(1), is(oliver)); } - /** - * @see DATAJPA-427 - */ - @Test + @Test // DATAJPA-427 public void findBySpecificationWithSortByPluralAssociationPropertyInPageableShouldUseSortNullValuesLast() { oliver.getColleagues().add(dave); @@ -159,10 +150,7 @@ public class QueryDslJpaRepositoryTests { assertThat(page.getContent(), hasItems(oliver, dave, carter)); } - /** - * @see DATAJPA-427 - */ - @Test + @Test // DATAJPA-427 public void findBySpecificationWithSortBySingularAssociationPropertyInPageableShouldUseSortNullValuesLast() { oliver.setManager(dave); @@ -177,10 +165,7 @@ public class QueryDslJpaRepositoryTests { assertThat(page.getContent(), hasItems(dave, oliver, carter)); } - /** - * @see DATAJPA-427 - */ - @Test + @Test // DATAJPA-427 public void findBySpecificationWithSortBySingularPropertyInPageableShouldUseSortNullValuesFirst() { QUser user = QUser.user; @@ -192,10 +177,7 @@ public class QueryDslJpaRepositoryTests { assertThat(page.getContent(), hasItems(carter, dave, oliver)); } - /** - * @see DATAJPA-427 - */ - @Test + @Test // DATAJPA-427 public void findBySpecificationWithSortByOrderIgnoreCaseBySingularPropertyInPageableShouldUseSortNullValuesFirst() { QUser user = QUser.user; @@ -207,10 +189,7 @@ public class QueryDslJpaRepositoryTests { assertThat(page.getContent(), hasItems(carter, dave, oliver)); } - /** - * @see DATAJPA-427 - */ - @Test + @Test // DATAJPA-427 public void findBySpecificationWithSortByNestedEmbeddedPropertyInPageableShouldUseSortNullValuesFirst() { oliver.setAddress(new Address("Germany", "Saarbrücken", "HaveItYourWay", "123")); @@ -225,10 +204,7 @@ public class QueryDslJpaRepositoryTests { assertThat(page.getContent().get(2), is(oliver)); } - /** - * @see DATAJPA-12 - */ - @Test + @Test // DATAJPA-12 public void findBySpecificationWithSortByQueryDslOrderSpecifierWithQPageRequestAndQSort() { QUser user = QUser.user; @@ -243,10 +219,7 @@ public class QueryDslJpaRepositoryTests { assertThat(page.getContent().get(2), is(oliver)); } - /** - * @see DATAJPA-12 - */ - @Test + @Test // DATAJPA-12 public void findBySpecificationWithSortByQueryDslOrderSpecifierWithQPageRequest() { QUser user = QUser.user; @@ -260,10 +233,7 @@ public class QueryDslJpaRepositoryTests { assertThat(page.getContent().get(2), is(oliver)); } - /** - * @see DATAJPA-12 - */ - @Test + @Test // DATAJPA-12 public void findBySpecificationWithSortByQueryDslOrderSpecifierForAssociationShouldGenerateLeftJoinWithQPageRequest() { oliver.setManager(dave); @@ -281,10 +251,7 @@ public class QueryDslJpaRepositoryTests { assertThat(page.getContent().get(2), is(oliver)); } - /** - * @see DATAJPA-491 - */ - @Test + @Test // DATAJPA-491 public void sortByNestedAssociationPropertyWithSpecificationAndSortInPageable() { oliver.setManager(dave); @@ -296,10 +263,7 @@ public class QueryDslJpaRepositoryTests { assertThat(page.getContent().get(0), is(dave)); } - /** - * @see DATAJPA-500, DATAJPA-635 - */ - @Test + @Test // DATAJPA-500, DATAJPA-635 public void sortByNestedEmbeddedAttribite() { carter.setAddress(new Address("U", "Z", "Y", "41")); @@ -312,10 +276,7 @@ public class QueryDslJpaRepositoryTests { assertThat(users, hasItems(dave, oliver, carter)); } - /** - * @see DATAJPA-566, DATAJPA-635 - */ - @Test + @Test // DATAJPA-566, DATAJPA-635 public void shouldSupportSortByOperatorWithDateExpressions() { carter.setDateOfBirth(new LocalDate(2000, 2, 1).toDate()); @@ -328,10 +289,7 @@ public class QueryDslJpaRepositoryTests { assertThat(users, hasItems(dave, carter, oliver)); } - /** - * @see DATAJPA-665 - */ - @Test + @Test // DATAJPA-665 public void shouldSupportExistsWithPredicate() throws Exception { assertThat(repository.exists(user.firstname.eq("Dave")), is(true)); @@ -339,10 +297,7 @@ public class QueryDslJpaRepositoryTests { assertThat(repository.exists((Predicate) null), is(true)); } - /** - * @see DATAJPA-679 - */ - @Test + @Test // DATAJPA-679 public void shouldSupportFindAllWithPredicateAndSort() { List users = repository.findAll(user.dateOfBirth.isNull(), new Sort(Direction.ASC, "firstname")); @@ -353,18 +308,12 @@ public class QueryDslJpaRepositoryTests { assertThat(users, hasItems(carter, dave, oliver)); } - /** - * @see DATAJPA-585 - */ - @Test + @Test // DATAJPA-585 public void worksWithNullPageable() { assertThat(repository.findAll(user.dateOfBirth.isNull(), (Pageable) null).getContent(), hasSize(3)); } - /** - * @see DATAJPA-912 - */ - @Test + @Test // DATAJPA-912 public void pageableQueryReportsTotalFromResult() { Page firstPage = repository.findAll(user.dateOfBirth.isNull(), new PageRequest(0, 10)); @@ -376,10 +325,7 @@ public class QueryDslJpaRepositoryTests { assertThat(secondPage.getTotalElements(), is(3L)); } - /** - * @see DATAJPA-912 - */ - @Test + @Test // DATAJPA-912 public void pageableQueryReportsTotalFromCount() { Page firstPage = repository.findAll(user.dateOfBirth.isNull(), new PageRequest(0, 3)); diff --git a/src/test/java/org/springframework/data/jpa/repository/support/QueryDslRepositorySupportIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/support/QueryDslRepositorySupportIntegrationTests.java index 665b02852..38e2ef44c 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/QueryDslRepositorySupportIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/QueryDslRepositorySupportIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2013 the original author or authors. + * Copyright 2011-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -91,10 +91,7 @@ public class QueryDslRepositorySupportIntegrationTests { assertThat(repository, is(notNullValue())); } - /** - * @see DATAJPA-135 - */ - @Test + @Test // DATAJPA-135 public void createsReconfiguredRepoAccordingly() { assertThat(reconfiguredRepo, is(notNullValue())); diff --git a/src/test/java/org/springframework/data/jpa/repository/support/QuerydslIntegrationTests.java b/src/test/java/org/springframework/data/jpa/repository/support/QuerydslIntegrationTests.java index 9f69d5a9d..284e2a743 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/QuerydslIntegrationTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/QuerydslIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014 the original author or authors. + * Copyright 2014-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -57,10 +57,7 @@ public class QuerydslIntegrationTests { userQuery = querydsl.createQuery().select(userPath); } - /** - * @see DATAJPA-499 - */ - @Test + @Test // DATAJPA-499 public void defaultOrderingShouldNotGenerateAnNullOrderingHint() { JPQLQuery result = querydsl.applySorting(new Sort(new Sort.Order("firstname")), userQuery); diff --git a/src/test/java/org/springframework/data/jpa/repository/support/SimpleJpaRepositoryUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/support/SimpleJpaRepositoryUnitTests.java index b4924f570..0cc8583b5 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/SimpleJpaRepositoryUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/SimpleJpaRepositoryUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2016 the original author or authors. + * Copyright 2011-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -79,11 +79,7 @@ public class SimpleJpaRepositoryUnitTests { repo.setRepositoryMethodMetadata(metadata); } - /** - * @see DATAJPA-124 - * @see DATAJPA-912 - */ - @Test + @Test // DATAJPA-124, DATAJPA-912 public void retrieveObjectsForPageableOutOfRange() { when(countQuery.getSingleResult()).thenReturn(20L); @@ -92,10 +88,7 @@ public class SimpleJpaRepositoryUnitTests { verify(query).getResultList(); } - /** - * @see DATAJPA-912 - */ - @Test + @Test // DATAJPA-912 public void doesNotRetrieveCountWithoutOffsetAndResultsWithinPageSize() { when(query.getResultList()).thenReturn(Arrays.asList(new User(), new User())); @@ -105,10 +98,7 @@ public class SimpleJpaRepositoryUnitTests { verify(countQuery, never()).getSingleResult(); } - /** - * @see DATAJPA-912 - */ - @Test + @Test // DATAJPA-912 public void doesNotRetrieveCountWithOffsetAndResultsWithinPageSize() { when(query.getResultList()).thenReturn(Arrays.asList(new User(), new User())); @@ -118,20 +108,13 @@ public class SimpleJpaRepositoryUnitTests { verify(countQuery, never()).getSingleResult(); } - /** - * @see DATAJPA-177 - */ - @Test(expected = EmptyResultDataAccessException.class) + @Test(expected = EmptyResultDataAccessException.class) // DATAJPA-177 public void throwsExceptionIfEntityToDeleteDoesNotExist() { repo.delete(4711); } - /** - * @see DATAJPA-689 - * @see DATAJPA-696 - */ - @Test + @Test // DATAJPA-689, DATAJPA-696 @SuppressWarnings({ "rawtypes", "unchecked" }) public void shouldPropagateConfiguredEntityGraphToFindOne() throws Exception { diff --git a/src/test/java/org/springframework/data/jpa/repository/support/TransactionalRepositoryTests.java b/src/test/java/org/springframework/data/jpa/repository/support/TransactionalRepositoryTests.java index aea022266..a02902cd3 100644 --- a/src/test/java/org/springframework/data/jpa/repository/support/TransactionalRepositoryTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/support/TransactionalRepositoryTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2015 the original author or authors. + * Copyright 2008-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -82,10 +82,7 @@ public class TransactionalRepositoryTests extends AbstractJUnit4SpringContextTes assertFalse(transactionManager.getDefinition().isReadOnly()); } - /** - * @see DATACMNS-649 - */ - @Test + @Test // DATACMNS-649 public void invokeRedeclaredDeleteMethodWithoutTransactionDeclaration() throws Exception { User user = repository.saveAndFlush(new User("foo", "bar", "foo@bar.de")); diff --git a/src/test/java/org/springframework/data/jpa/support/ClasspathScanningPersistenceUnitPostProcessorUnitTests.java b/src/test/java/org/springframework/data/jpa/support/ClasspathScanningPersistenceUnitPostProcessorUnitTests.java index f0d189d5f..f9af57bf1 100644 --- a/src/test/java/org/springframework/data/jpa/support/ClasspathScanningPersistenceUnitPostProcessorUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/support/ClasspathScanningPersistenceUnitPostProcessorUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2014 the original author or authors. + * Copyright 2011-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -83,10 +83,7 @@ public class ClasspathScanningPersistenceUnitPostProcessorUnitTests { verify(pui).addManagedClassName(SampleEntity.class.getName()); } - /** - * @see DATAJPA-407 - */ - @Test + @Test // DATAJPA-407 public void findsMappingFile() { ClasspathScanningPersistenceUnitPostProcessor processor = new ClasspathScanningPersistenceUnitPostProcessor( @@ -101,11 +98,7 @@ public class ClasspathScanningPersistenceUnitPostProcessorUnitTests { verify(pui).addMappingFileName(expected); } - /** - * @see DATAJPA-353 - * @see DATAJPA-407 - */ - @Test + @Test // DATAJPA-353, DATAJPA-407 public void shouldFindJpaMappingFilesFromMultipleLocationsOnClasspath() { ClasspathScanningPersistenceUnitPostProcessor processor = new ClasspathScanningPersistenceUnitPostProcessor( @@ -119,10 +112,7 @@ public class ClasspathScanningPersistenceUnitPostProcessorUnitTests { verify(pui).addMappingFileName("org/springframework/data/jpa/support/module2/module2-orm.xml"); } - /** - * @see DATAJPA-519 - */ - @Test + @Test // DATAJPA-519 public void shouldFindJpaMappingFilesFromNestedJarLocationsOnClasspath() { String nestedModule3Path = "org/springframework/data/jpa/support/module3/module3-orm.xml";