From 4eb1ae8de299b19d02c6a0110c063bc1ccadfda3 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Fri, 13 Jan 2017 08:45:25 +0100 Subject: [PATCH] DATACMNS-973 - Migrate ticket references in test code to Spring Framework style. --- .../data/annotation/TypeAliasUnitTests.java | 7 +- .../auditing/AuditingHandlerUnitTests.java | 7 +- ...tAuditableBeanWrapperFactoryUnitTests.java | 7 +- .../IsNewAwareAuditingHandlerUnitTests.java | 17 +- ...gAuditableBeanWrapperFactoryUnitTests.java | 52 +--- ...anDefinitionRegistrarSupportUnitTests.java | 7 +- .../UserCredentialsUnitTests.java | 38 +-- ...GeneratingEntityInstantiatorUnitTests.java | 47 +--- ...GeneratingEntityInstantiatorUnitTests.java | 47 +--- .../convert/DefaultTypeMapperUnitTests.java | 12 +- .../convert/Jsr310ConvertersUnitTests.java | 50 +--- ...ContextTypeInformationMapperUnitTests.java | 7 +- ...ReflectionEntityInstantiatorUnitTests.java | 17 +- .../ThreeTenBackPortConvertersUnitTests.java | 42 +-- .../domain/AbstractPageRequestUnitTests.java | 7 +- .../data/domain/ExampleMatcherUnitTests.java | 87 ++----- .../data/domain/ExampleUnitTests.java | 17 +- .../data/domain/PageImplUnitTests.java | 37 +-- .../data/domain/RangeUnitTests.java | 32 +-- .../data/domain/SortUnitTests.java | 44 +--- .../data/geo/BoxUnitTests.java | 22 +- .../data/geo/CircleUnitTests.java | 27 +- .../data/geo/DistanceUnitTests.java | 62 +---- .../data/geo/GeoModuleIntegrationTests.java | 27 +- .../data/geo/GeoResultUnitTests.java | 22 +- .../data/geo/GeoResultsUnitTests.java | 12 +- .../data/geo/PointUnitTests.java | 22 +- .../data/geo/PolygonUnitTests.java | 27 +- .../format/DistanceFormatterUnitTests.java | 22 +- .../geo/format/PointFormatterUnitTests.java | 27 +- .../data/history/RevisionUnitTests.java | 17 +- ...eferredConstructorDiscovererUnitTests.java | 7 +- .../data/mapping/PropertyPathUnitTests.java | 77 ++---- .../PropertyReferenceExceptionUnitTests.java | 7 +- .../mapping/SimpleTypeHolderUnitTests.java | 5 +- ...bstractMappingContextIntegrationTests.java | 22 +- .../AbstractMappingContextUnitTests.java | 77 ++---- ...DefaultPersistenPropertyPathUnitTests.java | 12 +- .../context/PersistentEntitiesUnitTests.java | 17 +- .../AbstractPersistentPropertyUnitTests.java | 87 ++----- ...ationBasedPersistentPropertyUnitTests.java | 97 ++----- .../model/BasicPersistentEntityUnitTests.java | 62 +---- ...reviatingFieldNamingStrategyUnitTests.java | 7 +- ...gPropertyAccessorFactoryDatatypeTests.java | 29 +-- ...ropertyAccessorFactoryEntityTypeTests.java | 12 +- ...eneratingPropertyAccessorFactoryTests.java | 59 +---- ...ingPropertyAccessorPackageDefaultType.java | 3 +- ...sGeneratingPropertyAccessorPublicType.java | 3 +- .../ConvertingPropertyAccessorUnitTests.java | 42 +-- ...IdPropertyIdentifierAccessorUnitTests.java | 17 +- ...EntityParameterValueProviderUnitTests.java | 7 +- ...SnakeCaseFieldNamingStrategyUnitTests.java | 7 +- .../model/subpackage/TypeInOtherPackage.java | 3 +- ...DefaultProjectionInformationUnitTests.java | 17 +- ...apAccessingMethodInterceptorUnitTests.java | 32 +-- .../ProjectingMethodInterceptorUnitTests.java | 42 +-- .../ProjectionIntegrationTests.java | 7 +- ...tyAccessingMethodInterceptorUnitTests.java | 37 +-- .../ProxyProjectionFactoryUnitTests.java | 87 ++----- ...lAwareProxyProjectionFactoryUnitTests.java | 27 +- ...lEvaluatingMethodInterceptorUnitTests.java | 27 +- .../data/querydsl/QSortUnitTests.java | 67 +---- .../data/querydsl/QueryDslUtilsUnitTests.java | 12 +- ...ydslRepositoryInvokerAdapterUnitTests.java | 17 +- .../QuerydslBindingsFactoryUnitTests.java | 17 +- .../binding/QuerydslBindingsUnitTests.java | 112 ++------ .../QuerydslDefaultBindingUnitTests.java | 22 +- .../QuerydslPredicateBuilderUnitTests.java | 67 +---- .../cdi/CdiRepositoryBeanUnitTests.java | 12 +- ...itoryExtensionSupportIntegrationTests.java | 7 +- ...epositoryConfigurationSourceUnitTests.java | 47 +--- ...itionRegistrarSupportIntegrationTests.java | 17 +- ...anDefinitionRegistrarSupportUnitTests.java | 7 +- .../RepositoryComponentProviderUnitTests.java | 7 +- ...ositoryConfigurationDelegateUnitTests.java | 7 +- ...onfigurationExtensionSupportUnitTests.java | 17 +- ...rBeanDefinitionParserIntegrationTests.java | 12 +- ...epositoryConfigurationSourceUnitTests.java | 7 +- .../AbstractEntityInformationUnitTests.java | 17 +- .../AbstractRepositoryMetadataUnitTests.java | 42 +-- .../support/DefaultCrudMethodsUnitTests.java | 52 +--- ...DefaultRepositoryInformationUnitTests.java | 57 +---- .../DefaultRepositoryMetadataUnitTests.java | 27 +- ...RepositoryProxyPostProcessorUnitTests.java | 57 +---- ...ExampleSpecificationAccessorUnitTests.java | 102 ++------ ...RepositoryProxyPostProcessorUnitTests.java | 12 +- .../PersistentEntityInformationUnitTests.java | 12 +- .../QueryExecutionResultHandlerUnitTests.java | 122 ++------- ...eactiveRepositoryInformationUnitTests.java | 25 +- ...pperRepositoryFactorySupportUnitTests.java | 20 +- .../ReflectionEntityInformationUnitTests.java | 12 +- ...RepositoryFactoryBeanSupportUnitTests.java | 12 +- .../RepositoryFactorySupportUnitTests.java | 55 +--- ...ionDetectorMethodInterceptorUnitTests.java | 12 +- ...RepositoryFactoryBeanSupportUnitTests.java | 12 +- ...RepositoryProxyPostProcessorUnitTests.java | 17 +- ...eReaderRepositoryInitializerUnitTests.java | 7 +- ...areEvaluationContextProviderUnitTests.java | 62 +---- .../ParametersParameterAccessorUnitTests.java | 7 +- .../repository/query/ParametersUnitTests.java | 37 +-- .../query/QueryMethodUnitTests.java | 91 ++----- .../query/ResultProcessorUnitTests.java | 95 ++----- .../query/ReturnedTypeUnitTests.java | 62 +---- .../StreamQueryResultHandlerUnitTests.java | 12 +- .../query/parser/OrderBySourceUnitTests.java | 7 +- .../query/parser/PartTreeUnitTests.java | 242 ++++-------------- .../support/AnnotationAttributeUnitTests.java | 17 +- .../CrudRepositoryInvokerUnitTests.java | 47 +--- ...ositoryInvokerFactoryIntegrationTests.java | 27 +- .../DomainClassConverterUnitTests.java | 40 +-- .../PageableExecutionUtilsUnitTests.java | 32 +-- ...nAndSortingRepositoryInvokerUnitTests.java | 22 +- .../ReflectionRepositoryInvokerUnitTests.java | 77 ++---- .../support/RepositoriesIntegrationTests.java | 7 +- .../support/RepositoriesUnitTests.java | 22 +- .../repository/util/ClassUtilsUnitTests.java | 7 +- .../QueryExecutionConvertersUnitTests.java | 115 ++------- .../ReactiveWrapperConvertersUnitTests.java | 140 ++-------- .../util/ReactiveWrappersUnitTests.java | 15 +- .../util/AnnotatedTypeScannerUnitTests.java | 7 +- ...tationDetectionFieldCallbackUnitTests.java | 17 +- ...ationDetectionMethodCallbackUnitTests.java | 12 +- .../util/ClassTypeInformationUnitTests.java | 78 ++---- .../data/util/DataCmns511Tests.java | 7 +- ...eldAccessFallbackBeanWrapperUnitTests.java | 22 +- .../data/util/PairUnitTests.java | 27 +- .../data/util/ParameterizedTypeUnitTests.java | 32 +-- .../data/util/ParsingUtilsUnitTests.java | 14 +- .../data/util/ReflectionUtilsUnitTests.java | 22 +- .../data/util/StreamUtilsTests.java | 7 +- .../data/util/TypeDiscovererUnitTests.java | 12 +- .../data/util/VersionUnitTests.java | 67 +---- ...andlerMethodArgumentResolverUnitTests.java | 27 +- ...andlerMethodArgumentResolverUnitTests.java | 12 +- ...tingMethodInterceptorFactoryUnitTests.java | 62 +---- .../data/web/MapDataBinderUnitTests.java | 22 +- ...andlerMethodArgumentResolverUnitTests.java | 72 ++---- ...cesAssemblerArgumentResolverUnitTests.java | 52 +--- .../web/PagedResourcesAssemblerUnitTests.java | 68 +---- ...Jackson2HttpMessageConverterUnitTests.java | 17 +- ...andlerMethodArgumentResolverUnitTests.java | 48 +--- .../XmlBeamHttpMessageConverterUnitTests.java | 32 +-- ...eSpringDataWebSupportIntegrationTests.java | 34 +-- ...bleResourcesAssemblerIntegrationTests.java | 12 +- .../SpringDataWebConfigurationUnitTests.java | 7 +- ...dslPredicateArgumentResolverUnitTests.java | 72 ++---- 146 files changed, 1080 insertions(+), 3893 deletions(-) diff --git a/src/test/java/org/springframework/data/annotation/TypeAliasUnitTests.java b/src/test/java/org/springframework/data/annotation/TypeAliasUnitTests.java index 5b0904379..04d4452a1 100644 --- a/src/test/java/org/springframework/data/annotation/TypeAliasUnitTests.java +++ b/src/test/java/org/springframework/data/annotation/TypeAliasUnitTests.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. @@ -30,10 +30,7 @@ import org.springframework.data.util.AnnotatedTypeScanner; */ public class TypeAliasUnitTests { - /** - * @see DATACMNS-547 - */ - @Test + @Test // DATACMNS-547 @SuppressWarnings("unchecked") public void scanningforAtPersistentFindsTypeAliasAnnotatedTypes() { diff --git a/src/test/java/org/springframework/data/auditing/AuditingHandlerUnitTests.java b/src/test/java/org/springframework/data/auditing/AuditingHandlerUnitTests.java index 8b506aec6..33da36f98 100644 --- a/src/test/java/org/springframework/data/auditing/AuditingHandlerUnitTests.java +++ b/src/test/java/org/springframework/data/auditing/AuditingHandlerUnitTests.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. @@ -142,10 +142,7 @@ public class AuditingHandlerUnitTests { assertNull(user.getLastModifiedDate()); } - /** - * @see DATAJPA-9 - */ - @Test + @Test // DATAJPA-9 public void usesDateTimeProviderIfConfigured() { DateTimeProvider provider = mock(DateTimeProvider.class); diff --git a/src/test/java/org/springframework/data/auditing/DefaultAuditableBeanWrapperFactoryUnitTests.java b/src/test/java/org/springframework/data/auditing/DefaultAuditableBeanWrapperFactoryUnitTests.java index ec20e0db5..bdb526701 100644 --- a/src/test/java/org/springframework/data/auditing/DefaultAuditableBeanWrapperFactoryUnitTests.java +++ b/src/test/java/org/springframework/data/auditing/DefaultAuditableBeanWrapperFactoryUnitTests.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. @@ -60,10 +60,7 @@ public class DefaultAuditableBeanWrapperFactoryUnitTests { assertThat(wrapper, is(nullValue())); } - /** - * @see DATACMNS-643 - */ - @Test + @Test // DATACMNS-643 public void setsJsr310AndThreeTenBpTypes() { Jsr310ThreeTenBpAuditedUser user = new Jsr310ThreeTenBpAuditedUser(); diff --git a/src/test/java/org/springframework/data/auditing/IsNewAwareAuditingHandlerUnitTests.java b/src/test/java/org/springframework/data/auditing/IsNewAwareAuditingHandlerUnitTests.java index 5e387aa9a..d3138ce7f 100644 --- a/src/test/java/org/springframework/data/auditing/IsNewAwareAuditingHandlerUnitTests.java +++ b/src/test/java/org/springframework/data/auditing/IsNewAwareAuditingHandlerUnitTests.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. @@ -72,26 +72,17 @@ public class IsNewAwareAuditingHandlerUnitTests extends AuditingHandlerUnitTests assertThat(user.modifiedDate, is(notNullValue())); } - /** - * @see DATACMNS-365 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-365 public void rejectsNullMappingContext() { new IsNewAwareAuditingHandler((PersistentEntities) null); } - /** - * @see DATACMNS-365 - */ - @Test + @Test // DATACMNS-365 public void setsUpHandlerWithMappingContext() { new IsNewAwareAuditingHandler(new PersistentEntities(Collections.> emptySet())); } - /** - * @see DATACMNS-638 - */ - @Test + @Test // DATACMNS-638 public void handlingNullIsANoOp() { IsNewAwareAuditingHandler handler = getHandler(); diff --git a/src/test/java/org/springframework/data/auditing/MappingAuditableBeanWrapperFactoryUnitTests.java b/src/test/java/org/springframework/data/auditing/MappingAuditableBeanWrapperFactoryUnitTests.java index 85b0ec534..592251dd1 100644 --- a/src/test/java/org/springframework/data/auditing/MappingAuditableBeanWrapperFactoryUnitTests.java +++ b/src/test/java/org/springframework/data/auditing/MappingAuditableBeanWrapperFactoryUnitTests.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. @@ -58,10 +58,7 @@ public class MappingAuditableBeanWrapperFactoryUnitTests { factory = new MappingAuditableBeanWrapperFactory(entities); } - /** - * @see DATACMNS-365 - */ - @Test + @Test // DATACMNS-365 public void discoversAuditingPropertyOnField() { Sample sample = new Sample(); @@ -73,10 +70,7 @@ public class MappingAuditableBeanWrapperFactoryUnitTests { assertThat(sample.createdBy, is(notNullValue())); } - /** - * @see DATACMNS-365 - */ - @Test + @Test // DATACMNS-365 public void discoversAuditingPropertyOnAccessor() { Sample sample = new Sample(); @@ -88,10 +82,7 @@ public class MappingAuditableBeanWrapperFactoryUnitTests { assertThat(sample.lastModifiedBy, is(notNullValue())); } - /** - * @see DATACMNS-365 - */ - @Test + @Test // DATACMNS-365 public void settingInavailablePropertyIsNoop() { Sample sample = new Sample(); @@ -100,28 +91,19 @@ public class MappingAuditableBeanWrapperFactoryUnitTests { wrapper.setLastModifiedDate(new GregorianCalendar()); } - /** - * @see DATACMNS-365 - */ - @Test + @Test // DATACMNS-365 public void doesNotReturnWrapperForEntityNotUsingAuditing() { assertThat(factory.getBeanWrapperFor(new NoAuditing()), is(nullValue())); } - /** - * @see DATACMNS-365 - */ - @Test + @Test // DATACMNS-365 public void returnsAuditableWrapperForAuditable() { assertThat(factory.getBeanWrapperFor(mock(ExtendingAuditable.class)), is(instanceOf(AuditableInterfaceBeanWrapper.class))); } - /** - * @see DATACMNS-638 - */ - @Test + @Test // DATACMNS-638 public void returnsLastModificationCalendarAsCalendar() { Date reference = new Date(); @@ -132,10 +114,7 @@ public class MappingAuditableBeanWrapperFactoryUnitTests { assertLastModificationDate(calendar, reference); } - /** - * @see DATACMNS-638 - */ - @Test + @Test // DATACMNS-638 public void returnsLastModificationDateTimeAsCalendar() { DateTime reference = new DateTime(); @@ -143,10 +122,7 @@ public class MappingAuditableBeanWrapperFactoryUnitTests { assertLastModificationDate(reference, reference.toDate()); } - /** - * @see DATACMNS-638 - */ - @Test + @Test // DATACMNS-638 public void returnsLastModificationDateAsCalendar() { Date reference = new Date(); @@ -154,10 +130,7 @@ public class MappingAuditableBeanWrapperFactoryUnitTests { assertLastModificationDate(reference, reference); } - /** - * @see DATACMNS-638, DATACMNS-43 - */ - @Test + @Test // DATACMNS-638, DATACMNS-43 public void returnsLastModificationJsr310DateTimeAsCalendar() { LocalDateTime reference = LocalDateTime.now(); @@ -165,10 +138,7 @@ public class MappingAuditableBeanWrapperFactoryUnitTests { assertLastModificationDate(reference, LocalDateTimeToDateConverter.INSTANCE.convert(reference)); } - /** - * @see DATACMNS-638, DATACMNS-43 - */ - @Test + @Test // DATACMNS-638, DATACMNS-43 public void returnsLastModificationThreeTenBpDateTimeAsCalendar() { org.threeten.bp.LocalDateTime reference = org.threeten.bp.LocalDateTime.now(); diff --git a/src/test/java/org/springframework/data/auditing/config/AuditingBeanDefinitionRegistrarSupportUnitTests.java b/src/test/java/org/springframework/data/auditing/config/AuditingBeanDefinitionRegistrarSupportUnitTests.java index ae1ccb846..0b7975d76 100644 --- a/src/test/java/org/springframework/data/auditing/config/AuditingBeanDefinitionRegistrarSupportUnitTests.java +++ b/src/test/java/org/springframework/data/auditing/config/AuditingBeanDefinitionRegistrarSupportUnitTests.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. * You may obtain a copy of the License at @@ -41,10 +41,7 @@ public class AuditingBeanDefinitionRegistrarSupportUnitTests { @Mock BeanDefinitionRegistry registry; - /** - * @see DATCMNS-389 - */ - @Test + @Test // DATCMNS-389 public void testRegisterBeanDefinitions() { AuditingBeanDefinitionRegistrarSupport registrar = new DummyAuditingBeanDefinitionRegistrarSupport(); diff --git a/src/test/java/org/springframework/data/authentication/UserCredentialsUnitTests.java b/src/test/java/org/springframework/data/authentication/UserCredentialsUnitTests.java index 3596f8185..9593afd8b 100644 --- a/src/test/java/org/springframework/data/authentication/UserCredentialsUnitTests.java +++ b/src/test/java/org/springframework/data/authentication/UserCredentialsUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011 by the original author(s). + * Copyright 2011-2017 by the original author(s). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -37,20 +37,14 @@ public class UserCredentialsUnitTests { assertThat(credentials.hasPassword(), is(false)); } - /** - * @see DATACMNS-142 - */ - @Test + @Test // DATACMNS-142 public void noCredentialsNullsUsernameAndPassword() { assertThat(UserCredentials.NO_CREDENTIALS.getUsername(), is(nullValue())); assertThat(UserCredentials.NO_CREDENTIALS.getPassword(), is(nullValue())); } - /** - * @see DATACMNS-142 - */ - @Test + @Test // DATACMNS-142 public void configuresUsernameCorrectly() { UserCredentials credentials = new UserCredentials("username", null); @@ -61,10 +55,7 @@ public class UserCredentialsUnitTests { assertThat(credentials.getPassword(), is(nullValue())); } - /** - * @see DATACMNS-142 - */ - @Test + @Test // DATACMNS-142 public void configuresPasswordCorrectly() { UserCredentials credentials = new UserCredentials(null, "password"); @@ -75,37 +66,24 @@ public class UserCredentialsUnitTests { assertThat(credentials.getPassword(), is("password")); } - /** - * @see DATACMNS-275 - */ - - @Test + @Test // DATACMNS-275 public void returnsNullForNotSetObfuscatedPassword() { assertThat(new UserCredentials(null, null).getObfuscatedPassword(), is(nullValue())); } - /** - * @see DATACMNS-275 - */ - @Test + @Test // DATACMNS-275 public void obfuscatesShortPasswordsEntirely() { assertThat(new UserCredentials(null, "sa").getObfuscatedPassword(), is("**")); assertThat(new UserCredentials(null, "s").getObfuscatedPassword(), is("*")); } - /** - * @see DATACMNS-275 - */ - @Test + @Test // DATACMNS-275 public void returnsObfuscatedPasswordCorrectly() { assertThat(new UserCredentials(null, "password").getObfuscatedPassword(), is("p******d")); } - /** - * @see DATACMNS-275 - */ - @Test + @Test // DATACMNS-275 public void toStringDoesNotExposePlainPassword() { UserCredentials credentials = new UserCredentials(null, "mypassword"); diff --git a/src/test/java/org/springframework/data/convert/BytecodeGeneratingEntityInstantiatorUnitTests.java b/src/test/java/org/springframework/data/convert/BytecodeGeneratingEntityInstantiatorUnitTests.java index 7c0a3b277..4a3375ff9 100644 --- a/src/test/java/org/springframework/data/convert/BytecodeGeneratingEntityInstantiatorUnitTests.java +++ b/src/test/java/org/springframework/data/convert/BytecodeGeneratingEntityInstantiatorUnitTests.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. @@ -89,10 +89,7 @@ public class BytecodeGeneratingEntityInstantiatorUnitTests

entity = new BasicPersistentEntity(from(Inner.class)); @@ -130,10 +124,7 @@ public class BytecodeGeneratingEntityInstantiatorUnitTests

entity = new BasicPersistentEntity(from(Inner.class)); @@ -130,10 +124,7 @@ public class ClassGeneratingEntityInstantiatorUnitTests

root = ClassTypeInformation.from(Foo.class); diff --git a/src/test/java/org/springframework/data/convert/Jsr310ConvertersUnitTests.java b/src/test/java/org/springframework/data/convert/Jsr310ConvertersUnitTests.java index 41aa1f5e2..f7c42a11b 100644 --- a/src/test/java/org/springframework/data/convert/Jsr310ConvertersUnitTests.java +++ b/src/test/java/org/springframework/data/convert/Jsr310ConvertersUnitTests.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. @@ -74,75 +74,51 @@ public class Jsr310ConvertersUnitTests { public static class CommonTests { - /** - * @see DATACMNS-606 - */ - @Test + @Test // DATACMNS-606 public void convertsDateToLocalDateTime() { assertThat(CONVERSION_SERVICE.convert(NOW, LocalDateTime.class).toString(), is(format(NOW, "yyyy-MM-dd'T'HH:mm:ss.SSS"))); } - /** - * @see DATACMNS-606 - */ - @Test + @Test // DATACMNS-606 public void convertsLocalDateTimeToDate() { LocalDateTime now = LocalDateTime.now(); assertThat(format(CONVERSION_SERVICE.convert(now, Date.class), "yyyy-MM-dd'T'HH:mm:ss.SSS"), is(now.toString())); } - /** - * @see DATACMNS-606 - */ - @Test + @Test // DATACMNS-606 public void convertsDateToLocalDate() { assertThat(CONVERSION_SERVICE.convert(NOW, LocalDate.class).toString(), is(format(NOW, "yyyy-MM-dd"))); } - /** - * @see DATACMNS-606 - */ - @Test + @Test // DATACMNS-606 public void convertsLocalDateToDate() { LocalDate now = LocalDate.now(); assertThat(format(CONVERSION_SERVICE.convert(now, Date.class), "yyyy-MM-dd"), is(now.toString())); } - /** - * @see DATACMNS-606 - */ - @Test + @Test // DATACMNS-606 public void convertsDateToLocalTime() { assertThat(CONVERSION_SERVICE.convert(NOW, LocalTime.class).toString(), is(format(NOW, "HH:mm:ss.SSS"))); } - /** - * @see DATACMNS-606 - */ - @Test + @Test // DATACMNS-606 public void convertsLocalTimeToDate() { LocalTime now = LocalTime.now(); assertThat(format(CONVERSION_SERVICE.convert(now, Date.class), "HH:mm:ss.SSS"), is(now.toString())); } - /** - * @see DATACMNS-623 - */ - @Test + @Test // DATACMNS-623 public void convertsDateToInstant() { Date now = new Date(); assertThat(CONVERSION_SERVICE.convert(now, Instant.class), is(now.toInstant())); } - /** - * @see DATACMNS-623 - */ - @Test + @Test // DATACMNS-623 public void convertsInstantToDate() { Date now = new Date(); @@ -170,9 +146,7 @@ public class Jsr310ConvertersUnitTests { @RunWith(Parameterized.class) public static class DurationConversionTests extends ConversionTest { - /** - * @see DATACMNS-951 - */ + // DATACMNS-951 @Parameters public static Collection data() { @@ -189,9 +163,7 @@ public class Jsr310ConvertersUnitTests { public static class PeriodConversionTests extends ConversionTest { - /** - * @see DATACMNS-951 - */ + // DATACMNS-951 @Parameters public static Collection data() { diff --git a/src/test/java/org/springframework/data/convert/MappingContextTypeInformationMapperUnitTests.java b/src/test/java/org/springframework/data/convert/MappingContextTypeInformationMapperUnitTests.java index 85350f413..e33f66182 100644 --- a/src/test/java/org/springframework/data/convert/MappingContextTypeInformationMapperUnitTests.java +++ b/src/test/java/org/springframework/data/convert/MappingContextTypeInformationMapperUnitTests.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. @@ -99,10 +99,7 @@ public class MappingContextTypeInformationMapperUnitTests { assertThat(mapper.resolveTypeFrom("foo"), is((TypeInformation) from(Entity.class))); } - /** - * @see DATACMNS-485 - */ - @Test + @Test // DATACMNS-485 @SuppressWarnings("unchecked") public void createsTypeMapperForGenericTypesWithDifferentBindings() { diff --git a/src/test/java/org/springframework/data/convert/ReflectionEntityInstantiatorUnitTests.java b/src/test/java/org/springframework/data/convert/ReflectionEntityInstantiatorUnitTests.java index 1a960f6b7..77b16999f 100644 --- a/src/test/java/org/springframework/data/convert/ReflectionEntityInstantiatorUnitTests.java +++ b/src/test/java/org/springframework/data/convert/ReflectionEntityInstantiatorUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 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. @@ -92,10 +92,7 @@ public class ReflectionEntityInstantiatorUnitTests

entity = new BasicPersistentEntity(from(Inner.class)); @@ -133,10 +127,7 @@ public class ReflectionEntityInstantiatorUnitTests

example = Example.of(person, matching().withIgnoreCase("firstname")); diff --git a/src/test/java/org/springframework/data/domain/PageImplUnitTests.java b/src/test/java/org/springframework/data/domain/PageImplUnitTests.java index 6365acd81..8a5f075fb 100644 --- a/src/test/java/org/springframework/data/domain/PageImplUnitTests.java +++ b/src/test/java/org/springframework/data/domain/PageImplUnitTests.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. @@ -115,10 +115,7 @@ public class PageImplUnitTests { assertThat(page.hasContent(), is(false)); } - /** - * @see DATACMNS-323 - */ - @Test + @Test // DATACMNS-323 public void returnsCorrectTotalPages() { Page page = new PageImpl(Arrays.asList("a")); @@ -128,10 +125,7 @@ public class PageImplUnitTests { assertThat(page.hasPrevious(), is(false)); } - /** - * @see DATACMNS-635 - */ - @Test + @Test // DATACMNS-635 public void transformsPageCorrectly() { Page transformed = new PageImpl(Arrays.asList("foo", "bar"), new PageRequest(0, 2), 10) @@ -146,44 +140,29 @@ public class PageImplUnitTests { assertThat(transformed.getContent(), contains(3, 3)); } - /** - * @see DATACMNS-713 - */ - @Test + @Test // DATACMNS-713 public void adaptsTotalForLastPageOnIntermediateDeletion() { assertThat(new PageImpl(Arrays.asList("foo", "bar"), new PageRequest(0, 5), 3).getTotalElements(), is(2L)); } - /** - * @see DATACMNS-713 - */ - @Test + @Test // DATACMNS-713 public void adaptsTotalForLastPageOnIntermediateInsertion() { assertThat(new PageImpl(Arrays.asList("foo", "bar"), new PageRequest(0, 5), 1).getTotalElements(), is(2L)); } - /** - * @see DATACMNS-713 - */ - @Test + @Test // DATACMNS-713 public void adaptsTotalForLastPageOnIntermediateDeletionOnLastPate() { assertThat(new PageImpl(Arrays.asList("foo", "bar"), new PageRequest(1, 10), 13).getTotalElements(), is(12L)); } - /** - * @see DATACMNS-713 - */ - @Test + @Test // DATACMNS-713 public void adaptsTotalForLastPageOnIntermediateInsertionOnLastPate() { assertThat(new PageImpl(Arrays.asList("foo", "bar"), new PageRequest(1, 10), 11).getTotalElements(), is(12L)); } - /** - * @see DATACMNS-713 - */ - @Test + @Test // DATACMNS-713 public void doesNotAdapttotalIfPageIsEmpty() { assertThat(new PageImpl(Collections. emptyList(), new PageRequest(1, 10), 0).getTotalElements(), diff --git a/src/test/java/org/springframework/data/domain/RangeUnitTests.java b/src/test/java/org/springframework/data/domain/RangeUnitTests.java index 086f09f9c..5f2495ee3 100644 --- a/src/test/java/org/springframework/data/domain/RangeUnitTests.java +++ b/src/test/java/org/springframework/data/domain/RangeUnitTests.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,18 +28,12 @@ import org.junit.Test; */ public class RangeUnitTests { - /** - * @see DATACMNS-651 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-651 public void rejectsNullReferenceValuesForContains() { new Range(10L, 20L).contains(null); } - /** - * @see DATACMNS-651 - */ - @Test + @Test // DATACMNS-651 public void usesBoundsInclusivelyByDefault() { Range range = new Range(10L, 20L); @@ -51,10 +45,7 @@ public class RangeUnitTests { assertThat(range.contains(25L), is(false)); } - /** - * @see DATACMNS-651 - */ - @Test + @Test // DATACMNS-651 public void excludesLowerBoundIfConfigured() { Range range = new Range(10L, 20L, false, true); @@ -66,10 +57,7 @@ public class RangeUnitTests { assertThat(range.contains(25L), is(false)); } - /** - * @see DATACMNS-651 - */ - @Test + @Test // DATACMNS-651 public void excludesUpperBoundIfConfigured() { Range range = new Range(10L, 20L, true, false); @@ -81,10 +69,7 @@ public class RangeUnitTests { assertThat(range.contains(25L), is(false)); } - /** - * @see DATACMNS-651 - */ - @Test + @Test // DATACMNS-651 public void handlesOpenUpperBoundCorrectly() { Range range = new Range(10L, null); @@ -96,10 +81,7 @@ public class RangeUnitTests { assertThat(range.contains(25L), is(true)); } - /** - * @see DATACMNS-651 - */ - @Test + @Test // DATACMNS-651 public void handlesOpenLowerBoundCorrectly() { Range range = new Range(null, 20L); diff --git a/src/test/java/org/springframework/data/domain/SortUnitTests.java b/src/test/java/org/springframework/data/domain/SortUnitTests.java index b44a48699..70f5f34bd 100644 --- a/src/test/java/org/springframework/data/domain/SortUnitTests.java +++ b/src/test/java/org/springframework/data/domain/SortUnitTests.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. @@ -102,28 +102,17 @@ public class SortUnitTests { assertThat(sort, hasItem(new Sort.Order("foo"))); } - /** - * @see DATACMNS-281 - * @author Kevin Raymond - */ - @Test + @Test // DATACMNS-281 public void configuresIgnoreCaseForOrder() { assertThat(new Order(Direction.ASC, "foo").ignoreCase().isIgnoreCase(), is(true)); } - /** - * @see DATACMNS-281 - * @author Kevin Raymond - */ - @Test + @Test // DATACMNS-281 public void orderDoesNotIgnoreCaseByDefault() { assertThat(new Order(Direction.ASC, "foo").isIgnoreCase(), is(false)); } - /** - * @see DATACMNS-436 - */ - @Test + @Test // DATACMNS-436 public void ordersWithDifferentIgnoreCaseDoNotEqual() { Order foo = new Order("foo"); @@ -133,42 +122,27 @@ public class SortUnitTests { assertThat(foo.hashCode(), is(not(fooIgnoreCase.hashCode()))); } - /** - * @see DATACMNS-491 - */ - @Test + @Test // DATACMNS-491 public void orderWithNullHandlingHintNullsFirst() { assertThat(new Order("foo").nullsFirst().getNullHandling(), is(NULLS_FIRST)); } - /** - * @see DATACMNS-491 - */ - @Test + @Test // DATACMNS-491 public void orderWithNullHandlingHintNullsLast() { assertThat(new Order("foo").nullsLast().getNullHandling(), is(NULLS_LAST)); } - /** - * @see DATACMNS-491 - */ - @Test + @Test // DATACMNS-491 public void orderWithNullHandlingHintNullsNative() { assertThat(new Order("foo").nullsNative().getNullHandling(), is(NATIVE)); } - /** - * @see DATACMNS-491 - */ - @Test + @Test // DATACMNS-491 public void orderWithDefaultNullHandlingHint() { assertThat(new Order("foo").getNullHandling(), is(NATIVE)); } - /** - * @see DATACMNS-908 - */ - @Test + @Test // DATACMNS-908 public void createsNewOrderForDifferentProperty() { Order source = new Order(Direction.DESC, "foo").nullsFirst().ignoreCase(); diff --git a/src/test/java/org/springframework/data/geo/BoxUnitTests.java b/src/test/java/org/springframework/data/geo/BoxUnitTests.java index dd6f5aaa2..d324897d8 100644 --- a/src/test/java/org/springframework/data/geo/BoxUnitTests.java +++ b/src/test/java/org/springframework/data/geo/BoxUnitTests.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. @@ -33,10 +33,7 @@ public class BoxUnitTests { Box second = new Box(new Point(1d, 1d), new Point(2d, 2d)); Box third = new Box(new Point(3d, 3d), new Point(1d, 1d)); - /** - * @see DATACMNS-437 - */ - @Test + @Test // DATACMNS-437 public void equalsWorksCorrectly() { assertThat(first.equals(second), is(true)); @@ -44,29 +41,20 @@ public class BoxUnitTests { assertThat(first.equals(third), is(false)); } - /** - * @see DATACMNS-437 - */ - @Test + @Test // DATACMNS-437 public void hashCodeWorksCorrectly() { assertThat(first.hashCode(), is(second.hashCode())); assertThat(first.hashCode(), is(not(third.hashCode()))); } - /** - * @see DATACMNS-437 - */ - @Test + @Test // DATACMNS-437 public void testToString() { assertThat(first.toString(), is("Box [Point [x=1.000000, y=1.000000], Point [x=2.000000, y=2.000000]]")); } - /** - * @see DATACMNS-482 - */ - @Test + @Test // DATACMNS-482 public void testSerialization() { Box serialized = (Box) SerializationUtils.deserialize(SerializationUtils.serialize(first)); diff --git a/src/test/java/org/springframework/data/geo/CircleUnitTests.java b/src/test/java/org/springframework/data/geo/CircleUnitTests.java index 8a056ee7c..b3cca7b15 100644 --- a/src/test/java/org/springframework/data/geo/CircleUnitTests.java +++ b/src/test/java/org/springframework/data/geo/CircleUnitTests.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. @@ -29,26 +29,17 @@ import org.springframework.util.SerializationUtils; */ public class CircleUnitTests { - /** - * @see DATACMNS-437 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-437 public void rejectsNullOrigin() { new Circle(null, new Distance(0)); } - /** - * @see DATACMNS-437 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-437 public void rejectsNegativeRadius() { new Circle(1, 1, -1); } - /** - * @see DATACMNS-437 - */ - @Test + @Test // DATACMNS-437 public void considersTwoCirclesEqualCorrectly() { Circle left = new Circle(1, 1, 1); @@ -63,19 +54,13 @@ public class CircleUnitTests { assertThat(right, is(left)); } - /** - * @see DATACMNS-437 - */ - @Test + @Test // DATACMNS-437 public void testToString() { assertThat(new Circle(1, 1, 1).toString(), is("Circle: [center=Point [x=1.000000, y=1.000000], radius=1.0]")); } - /** - * @see DATACMNS-482 - */ - @Test + @Test // DATACMNS-482 public void testSerialization() { Circle circle = new Circle(1, 1, 1); diff --git a/src/test/java/org/springframework/data/geo/DistanceUnitTests.java b/src/test/java/org/springframework/data/geo/DistanceUnitTests.java index f22037d57..8373f8fe5 100644 --- a/src/test/java/org/springframework/data/geo/DistanceUnitTests.java +++ b/src/test/java/org/springframework/data/geo/DistanceUnitTests.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. @@ -35,20 +35,14 @@ public class DistanceUnitTests { private static final double TEN_MILES_NORMALIZED = 0.002523219294755161; private static final double TEN_KM_NORMALIZED = 0.001567855942887398; - /** - * @see DATACMNS-437 - */ - @Test + @Test // DATACMNS-437 public void defaultsMetricToNeutralOne() { assertThat(new Distance(2.5).getMetric(), is((Metric) Metrics.NEUTRAL)); assertThat(new Distance(2.5, null).getMetric(), is((Metric) Metrics.NEUTRAL)); } - /** - * @see DATACMNS-437 - */ - @Test + @Test // DATACMNS-437 public void addsDistancesWithoutExplicitMetric() { Distance left = new Distance(2.5, KILOMETERS); @@ -57,10 +51,7 @@ public class DistanceUnitTests { assertThat(left.add(right), is(new Distance(5.0, KILOMETERS))); } - /** - * @see DATACMNS-437 - */ - @Test + @Test // DATACMNS-437 public void addsDistancesWithExplicitMetric() { Distance left = new Distance(2.5, KILOMETERS); @@ -69,10 +60,7 @@ public class DistanceUnitTests { assertThat(left.add(right, MILES), is(new Distance(3.106856281073925, MILES))); } - /** - * @see DATACMNS-474 - */ - @Test + @Test // DATACMNS-474 public void distanceWithSameMetricShoudEqualAfterConversion() { assertThat(new Distance(1).in(NEUTRAL), is(new Distance(1))); @@ -80,20 +68,14 @@ public class DistanceUnitTests { assertThat(new Distance(TEN_MILES_NORMALIZED).in(MILES), is(new Distance(10, MILES))); } - /** - * @see DATACMNS-474 - */ - @Test + @Test // DATACMNS-474 public void distanceWithDifferentMetricShoudEqualAfterConversion() { assertThat(new Distance(10, MILES), is(new Distance(TEN_MILES_NORMALIZED).in(MILES))); assertThat(new Distance(10, KILOMETERS), is(new Distance(TEN_KM_NORMALIZED).in(KILOMETERS))); } - /** - * @see DATACMNS-474 - */ - @Test + @Test // DATACMNS-474 public void conversionShouldProduceCorrectNormalizedValue() { assertThat(new Distance(TEN_KM_NORMALIZED, NEUTRAL).in(KILOMETERS).getNormalizedValue(), @@ -115,10 +97,7 @@ public class DistanceUnitTests { closeTo(new Distance(6.21371192, MILES).getNormalizedValue(), EPS)); } - /** - * @see DATACMNS-474 - */ - @Test + @Test // DATACMNS-474 public void toStringAfterConversion() { assertThat(new Distance(10, KILOMETERS).in(MILES).toString(), is(new Distance(6.21371256214785, MILES).toString())); @@ -126,10 +105,7 @@ public class DistanceUnitTests { is(new Distance(10, KILOMETERS).toString())); } - /** - * @see DATACMNS-482 - */ - @Test + @Test // DATACMNS-482 public void testSerialization() { Distance dist = new Distance(10, KILOMETERS); @@ -138,18 +114,12 @@ public class DistanceUnitTests { assertThat(serialized, is(dist)); } - /** - * @see DATACMNS-626 - */ - @Test + @Test // DATACMNS-626 public void returnsMetricsAbbreviationAsUnit() { assertThat(new Distance(10, KILOMETERS).getUnit(), is("km")); } - /** - * @see DATACMNS-651 - */ - @Test + @Test // DATACMNS-651 public void createsARangeCorrectly() { Distance twoKilometers = new Distance(2, KILOMETERS); @@ -162,10 +132,7 @@ public class DistanceUnitTests { assertThat(range.getUpperBound(), is(tenKilometers)); } - /** - * @see DATACMNS-651 - */ - @Test + @Test // DATACMNS-651 public void createsARangeFromPiecesCorrectly() { Distance twoKilometers = new Distance(2, KILOMETERS); @@ -178,10 +145,7 @@ public class DistanceUnitTests { assertThat(range.getUpperBound(), is(tenKilometers)); } - /** - * @see DATACMNS-651 - */ - @Test + @Test // DATACMNS-651 public void implementsComparableCorrectly() { Distance twoKilometers = new Distance(2, KILOMETERS); diff --git a/src/test/java/org/springframework/data/geo/GeoModuleIntegrationTests.java b/src/test/java/org/springframework/data/geo/GeoModuleIntegrationTests.java index 8d5fc52c7..5cf67ab15 100644 --- a/src/test/java/org/springframework/data/geo/GeoModuleIntegrationTests.java +++ b/src/test/java/org/springframework/data/geo/GeoModuleIntegrationTests.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. @@ -39,10 +39,7 @@ public class GeoModuleIntegrationTests { this.mapper.registerModule(new GeoModule()); } - /** - * @see DATACMNS-475 - */ - @Test + @Test // DATACMNS-475 public void deserializesDistance() throws Exception { String json = "{\"value\":10.0,\"metric\":\"KILOMETERS\"}"; @@ -52,10 +49,7 @@ public class GeoModuleIntegrationTests { assertThat(mapper.writeValueAsString(reference), is(json)); } - /** - * @see DATACMNS-475 - */ - @Test + @Test // DATACMNS-475 public void deserializesPoint() throws Exception { String json = "{\"x\":10.0,\"y\":20.0}"; @@ -65,10 +59,7 @@ public class GeoModuleIntegrationTests { assertThat(mapper.writeValueAsString(reference), is(json)); } - /** - * @see DATACMNS-475 - */ - @Test + @Test // DATACMNS-475 public void deserializesCircle() throws Exception { String json = "{\"center\":{\"x\":10.0,\"y\":20.0},\"radius\":{\"value\":10.0,\"metric\":\"KILOMETERS\"}}"; @@ -78,10 +69,7 @@ public class GeoModuleIntegrationTests { assertThat(mapper.writeValueAsString(reference), is(json)); } - /** - * @see DATACMNS-475 - */ - @Test + @Test // DATACMNS-475 public void deserializesBox() throws Exception { String json = "{\"first\":{\"x\":1.0,\"y\":2.0},\"second\":{\"x\":2.0,\"y\":3.0}}"; @@ -91,10 +79,7 @@ public class GeoModuleIntegrationTests { assertThat(mapper.writeValueAsString(reference), is(json)); } - /** - * @see DATACMNS-475 - */ - @Test + @Test // DATACMNS-475 public void deserializesPolygon() throws Exception { String json = "{\"points\":[{\"x\":1.0,\"y\":2.0},{\"x\":2.0,\"y\":3.0},{\"x\":3.0,\"y\":4.0}]}"; diff --git a/src/test/java/org/springframework/data/geo/GeoResultUnitTests.java b/src/test/java/org/springframework/data/geo/GeoResultUnitTests.java index dc01026e6..6eb7025bc 100644 --- a/src/test/java/org/springframework/data/geo/GeoResultUnitTests.java +++ b/src/test/java/org/springframework/data/geo/GeoResultUnitTests.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. @@ -34,19 +34,13 @@ public class GeoResultUnitTests { GeoResult third = new GeoResult("Bar", new Distance(2.5)); GeoResult fourth = new GeoResult("Foo", new Distance(5.2)); - /** - * @see DATACMNS-437 - */ - @Test + @Test // DATACMNS-437 public void considersSameInstanceEqual() { assertThat(first.equals(first), is(true)); } - /** - * @see DATACMNS-437 - */ - @Test + @Test // DATACMNS-437 public void considersSameValuesAsEqual() { assertThat(first.equals(second), is(true)); @@ -57,19 +51,13 @@ public class GeoResultUnitTests { assertThat(fourth.equals(first), is(false)); } - /** - * @see DATACMNS-437 - */ @SuppressWarnings({ "rawtypes", "unchecked" }) - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-437 public void rejectsNullContent() { new GeoResult(null, new Distance(2.5)); } - /** - * @see DATACMNS-482 - */ - @Test + @Test // DATACMNS-482 public void testSerialization() { GeoResult result = new GeoResult("test", new Distance(2)); diff --git a/src/test/java/org/springframework/data/geo/GeoResultsUnitTests.java b/src/test/java/org/springframework/data/geo/GeoResultsUnitTests.java index ae07aba0a..22b5fb4cb 100644 --- a/src/test/java/org/springframework/data/geo/GeoResultsUnitTests.java +++ b/src/test/java/org/springframework/data/geo/GeoResultsUnitTests.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. @@ -31,10 +31,7 @@ import org.springframework.util.SerializationUtils; */ public class GeoResultsUnitTests { - /** - * @see DATACMNS-437 - */ - @Test + @Test // DATACMNS-437 @SuppressWarnings("unchecked") public void calculatesAverageForGivenGeoResults() { @@ -45,10 +42,7 @@ public class GeoResultsUnitTests { assertThat(geoResults.getAverageDistance(), is(new Distance(3.5))); } - /** - * @see DATACMNS-482 - */ - @Test + @Test // DATACMNS-482 public void testSerialization() { GeoResult result = new GeoResult("test", new Distance(2)); diff --git a/src/test/java/org/springframework/data/geo/PointUnitTests.java b/src/test/java/org/springframework/data/geo/PointUnitTests.java index 834b6b03f..ee3c4f650 100644 --- a/src/test/java/org/springframework/data/geo/PointUnitTests.java +++ b/src/test/java/org/springframework/data/geo/PointUnitTests.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. @@ -29,18 +29,12 @@ import org.springframework.util.SerializationUtils; */ public class PointUnitTests { - /** - * @see DATACMNS-437 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-437 public void rejectsNullforCopyConstructor() { new Point(null); } - /** - * @see DATACMNS-437 - */ - @Test + @Test // DATACMNS-437 public void equalsIsImplementedCorrectly() { assertThat(new Point(1.5, 1.5), is(equalTo(new Point(1.5, 1.5)))); @@ -48,18 +42,12 @@ public class PointUnitTests { assertThat(new Point(2.0, 2.0), is(not(equalTo(new Point(1.5, 1.5))))); } - /** - * @see DATACMNS-437 - */ - @Test + @Test // DATACMNS-437 public void invokingToStringWorksCorrectly() { assertThat(new Point(1.5, 1.5).toString(), is("Point [x=1.500000, y=1.500000]")); } - /** - * @see DATACMNS-482 - */ - @Test + @Test // DATACMNS-482 public void testSerialization() { Point point = new Point(1.5, 1.5); diff --git a/src/test/java/org/springframework/data/geo/PolygonUnitTests.java b/src/test/java/org/springframework/data/geo/PolygonUnitTests.java index 299b6afd4..7a65d33de 100644 --- a/src/test/java/org/springframework/data/geo/PolygonUnitTests.java +++ b/src/test/java/org/springframework/data/geo/PolygonUnitTests.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. @@ -33,18 +33,12 @@ public class PolygonUnitTests { Point second = new Point(2, 2); Point third = new Point(3, 3); - /** - * @see DATACMNS-437 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-437 public void rejectsNullPoints() { new Polygon(null, null, null); } - /** - * @see DATACMNS-437 - */ - @Test + @Test // DATACMNS-437 public void createsSimplePolygon() { Polygon polygon = new Polygon(third, second, first); @@ -52,10 +46,7 @@ public class PolygonUnitTests { assertThat(polygon, is(notNullValue())); } - /** - * @see DATACMNS-437 - */ - @Test + @Test // DATACMNS-437 public void isEqualForSamePoints() { Polygon left = new Polygon(third, second, first); @@ -65,20 +56,14 @@ public class PolygonUnitTests { assertThat(right, is(left)); } - /** - * @see DATACMNS-437 - */ - @Test + @Test // DATACMNS-437 public void testToString() { assertThat(new Polygon(third, second, first).toString(), is("Polygon: [Point [x=3.000000, y=3.000000],Point [x=2.000000, y=2.000000],Point [x=1.000000, y=1.000000]]")); } - /** - * @see DATACMNS-482 - */ - @Test + @Test // DATACMNS-482 public void testSerialization() { Polygon polygon = new Polygon(third, second, first); diff --git a/src/test/java/org/springframework/data/geo/format/DistanceFormatterUnitTests.java b/src/test/java/org/springframework/data/geo/format/DistanceFormatterUnitTests.java index 13f6f2549..a979c59e9 100644 --- a/src/test/java/org/springframework/data/geo/format/DistanceFormatterUnitTests.java +++ b/src/test/java/org/springframework/data/geo/format/DistanceFormatterUnitTests.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,26 +50,17 @@ public class DistanceFormatterUnitTests { public static class UnparameterizedTests { - /** - * @see DATAREST-279, DATACMNS-626 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAREST-279, DATACMNS-626 public void rejectsArbitraryNonsense() { INSTANCE.convert("foo"); } - /** - * @see DATAREST-279, DATACMNS-626 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAREST-279, DATACMNS-626 public void rejectsUnsupportedMetric() { INSTANCE.convert("10.8cm"); } - /** - * @see DATAREST-279, DATACMNS-626 - */ - @Test + @Test // DATAREST-279, DATACMNS-626 public void printsDistance() { assertThat(INSTANCE.print(REFERENCE, Locale.US), is("10.8km")); } @@ -87,10 +78,7 @@ public class DistanceFormatterUnitTests { public @Parameter String source; - /** - * @see DATAREST-279, DATACMNS-626 - */ - @Test + @Test // DATAREST-279, DATACMNS-626 public void parsesDistanceFromString() { assertThat(INSTANCE.convert(source), is(REFERENCE)); } diff --git a/src/test/java/org/springframework/data/geo/format/PointFormatterUnitTests.java b/src/test/java/org/springframework/data/geo/format/PointFormatterUnitTests.java index 722c30c6e..0ff290049 100644 --- a/src/test/java/org/springframework/data/geo/format/PointFormatterUnitTests.java +++ b/src/test/java/org/springframework/data/geo/format/PointFormatterUnitTests.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. @@ -53,10 +53,7 @@ public class PointFormatterUnitTests { public @Rule ExpectedException exception = ExpectedException.none(); - /** - * @see DATAREST-279, DATACMNS-626 - */ - @Test + @Test // DATAREST-279, DATACMNS-626 public void rejectsArbitraryNonsense() { exception.expect(IllegalArgumentException.class); @@ -65,18 +62,12 @@ public class PointFormatterUnitTests { INSTANCE.convert("foo"); } - /** - * @see DATAREST-279, DATACMNS-626 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAREST-279, DATACMNS-626 public void rejectsMoreThanTwoCoordinates() { INSTANCE.convert("10.8,20.9,30.10"); } - /** - * @see DATAREST-279, DATACMNS-626 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAREST-279, DATACMNS-626 public void rejectsInvalidCoordinate() { INSTANCE.convert("10.8,foo"); } @@ -93,18 +84,12 @@ public class PointFormatterUnitTests { public @Parameter String source; - /** - * @see DATAREST-279, DATACMNS-626 - */ - @Test + @Test // DATAREST-279, DATACMNS-626 public void convertsPointFromString() { assertThat(INSTANCE.convert(source), is(REFERENCE)); } - /** - * @see DATAREST-279, DATACMNS-626 - */ - @Test + @Test // DATAREST-279, DATACMNS-626 public void parsesPoint() throws ParseException { assertThat(INSTANCE.parse(source, Locale.US), is(REFERENCE)); } diff --git a/src/test/java/org/springframework/data/history/RevisionUnitTests.java b/src/test/java/org/springframework/data/history/RevisionUnitTests.java index a5a4ba0cd..0a7b39c01 100755 --- a/src/test/java/org/springframework/data/history/RevisionUnitTests.java +++ b/src/test/java/org/springframework/data/history/RevisionUnitTests.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. @@ -57,10 +57,7 @@ public class RevisionUnitTests { assertThat(revisions.get(1), is(second)); } - /** - * @see DATACMNS-187 - */ - @Test + @Test // DATACMNS-187 public void returnsRevisionNumber() { when(firstMetadata.getRevisionNumber()).thenReturn(4711); @@ -70,10 +67,7 @@ public class RevisionUnitTests { assertThat(revision.getRevisionNumber(), is(4711)); } - /** - * @see DATACMNS-187 - */ - @Test + @Test // DATACMNS-187 public void returnsRevisionDate() { DateTime reference = new DateTime(); @@ -84,10 +78,7 @@ public class RevisionUnitTests { assertThat(revision.getRevisionDate(), is(reference)); } - /** - * @see DATACMNS-218 - */ - @Test + @Test // DATACMNS-218 public void returnsRevisionMetadata() { Revision revision = new Revision(firstMetadata, new Object()); diff --git a/src/test/java/org/springframework/data/mapping/PreferredConstructorDiscovererUnitTests.java b/src/test/java/org/springframework/data/mapping/PreferredConstructorDiscovererUnitTests.java index 4ad4a8559..9f280baef 100644 --- a/src/test/java/org/springframework/data/mapping/PreferredConstructorDiscovererUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/PreferredConstructorDiscovererUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2012 by the original author(s). + * Copyright 2011-2017 by the original author(s). * * 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 PreferredConstructorDiscovererUnitTests

entity = new BasicPersistentEntity(ClassTypeInformation.from(Inner.class)); diff --git a/src/test/java/org/springframework/data/mapping/PropertyPathUnitTests.java b/src/test/java/org/springframework/data/mapping/PropertyPathUnitTests.java index 7ede4f994..4e62e9edf 100644 --- a/src/test/java/org/springframework/data/mapping/PropertyPathUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/PropertyPathUnitTests.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. @@ -147,10 +147,7 @@ public class PropertyPathUnitTests { assertThat(from.getLeafProperty(), is(PropertyPath.from("name", FooBar.class))); } - /** - * @see DATACMNS-45 - */ - @Test + @Test // DATACMNS-45 public void handlesEmptyUnderscoresCorrectly() { PropertyPath propertyPath = PropertyPath.from("_foo", Sample2.class); @@ -195,10 +192,7 @@ public class PropertyPathUnitTests { assertThat(iterator.hasNext(), is(false)); } - /** - * @see DATACMNS-139 - */ - @Test + @Test // DATACMNS-139 public void rejectsInvalidPropertyWithLeadingUnderscore() { try { PropertyPath.from("_id", Foo.class); @@ -208,10 +202,7 @@ public class PropertyPathUnitTests { } } - /** - * @see DATACMNS-139 - */ - @Test + @Test // DATACMNS-139 public void rejectsNestedInvalidPropertyWithLeadingUnderscore() { try { PropertyPath.from("_foo_id", Sample2.class); @@ -221,10 +212,7 @@ public class PropertyPathUnitTests { } } - /** - * @see DATACMNS-139 - */ - @Test + @Test // DATACMNS-139 public void rejectsNestedInvalidPropertyExplictlySplitWithLeadingUnderscore() { try { PropertyPath.from("_foo__id", Sample2.class); @@ -234,10 +222,7 @@ public class PropertyPathUnitTests { } } - /** - * @see DATACMNS 158 - */ - @Test(expected = PropertyReferenceException.class) + @Test(expected = PropertyReferenceException.class) // DATACMNS 158 public void rejectsInvalidPathsContainingDigits() { PropertyPath.from("PropertyThatWillFail4Sure", Foo.class); } @@ -281,10 +266,7 @@ public class PropertyPathUnitTests { assertThat(left.hashCode(), is(not(shortPath.hashCode()))); } - /** - * @see DATACMNS-257 - */ - @Test + @Test // DATACMNS-257 public void findsAllUppercaseProperty() { PropertyPath path = PropertyPath.from("UUID", Foo.class); @@ -293,10 +275,7 @@ public class PropertyPathUnitTests { assertThat(path.getSegment(), is("UUID")); } - /** - * @see DATACMNS-257 - */ - @Test + @Test // DATACMNS-257 public void findsNestedAllUppercaseProperty() { PropertyPath path = PropertyPath.from("_fooUUID", Sample2.class); @@ -307,10 +286,7 @@ public class PropertyPathUnitTests { assertThat(path.next().getSegment(), is("UUID")); } - /** - * @see DATACMNS-381 - */ - @Test + @Test // DATACMNS-381 public void exposesPreviouslyReferencedPathInExceptionMessage() { exception.expect(PropertyReferenceException.class); @@ -321,42 +297,27 @@ public class PropertyPathUnitTests { PropertyPath.from("userNameBar", Bar.class); } - /** - * @see DATACMNS-387 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-387 public void rejectsNullSource() { from(null, Foo.class); } - /** - * @see DATACMNS-387 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-387 public void rejectsEmptySource() { from("", Foo.class); } - /** - * @see DATACMNS-387 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-387 public void rejectsNullClass() { from("foo", (Class) null); } - /** - * @see DATACMNS-387 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-387 public void rejectsNullTypeInformation() { from("foo", (TypeInformation) null); } - /** - * @see DATACMNS-546 - */ - @Test + @Test // DATACMNS-546 public void returnsCompletePathIfResolutionFailedCompletely() { exception.expect(PropertyReferenceException.class); @@ -365,10 +326,7 @@ public class PropertyPathUnitTests { from("somethingDifferent", Foo.class); } - /** - * @see DATACMNS-546 - */ - @Test + @Test // DATACMNS-546 public void includesResolvedPathInExceptionMessage() { exception.expect(PropertyReferenceException.class); @@ -379,10 +337,7 @@ public class PropertyPathUnitTests { from("userFooName", Bar.class); } - /** - * @see DATACMNS-703 - */ - @Test + @Test // DATACMNS-703 public void includesPropertyHintsOnTypos() { exception.expect(PropertyReferenceException.class); diff --git a/src/test/java/org/springframework/data/mapping/PropertyReferenceExceptionUnitTests.java b/src/test/java/org/springframework/data/mapping/PropertyReferenceExceptionUnitTests.java index 923160e7a..80ff3f016 100644 --- a/src/test/java/org/springframework/data/mapping/PropertyReferenceExceptionUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/PropertyReferenceExceptionUnitTests.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. @@ -67,10 +67,7 @@ public class PropertyReferenceExceptionUnitTests { new PropertyReferenceException("nme", TYPE_INFO, null); } - /** - * @see DATACMNS-801 - */ - @Test + @Test // DATACMNS-801 public void exposesPotentialMatch() { PropertyReferenceException exception = new PropertyReferenceException("nme", TYPE_INFO, NO_PATHS); diff --git a/src/test/java/org/springframework/data/mapping/SimpleTypeHolderUnitTests.java b/src/test/java/org/springframework/data/mapping/SimpleTypeHolderUnitTests.java index b23db2657..7636f1a38 100644 --- a/src/test/java/org/springframework/data/mapping/SimpleTypeHolderUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/SimpleTypeHolderUnitTests.java @@ -41,10 +41,7 @@ public class SimpleTypeHolderUnitTests { new SimpleTypeHolder(new HashSet>(), null); } - /** - * @see DATACMNS-31 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-31 public void rejectsNullTypeForIsSimpleTypeCall() { SimpleTypeHolder holder = new SimpleTypeHolder(); holder.isSimpleType(null); diff --git a/src/test/java/org/springframework/data/mapping/context/AbstractMappingContextIntegrationTests.java b/src/test/java/org/springframework/data/mapping/context/AbstractMappingContextIntegrationTests.java index bbf1e0a56..2eec2f268 100644 --- a/src/test/java/org/springframework/data/mapping/context/AbstractMappingContextIntegrationTests.java +++ b/src/test/java/org/springframework/data/mapping/context/AbstractMappingContextIntegrationTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2011-2014 by the original author(s). + * Copyright 2011-2017 by the original author(s). * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -40,10 +40,7 @@ import org.springframework.data.util.TypeInformation; */ public class AbstractMappingContextIntegrationTests> { - /** - * @see DATACMNS-457 - */ - @Test + @Test // DATACMNS-457 public void returnsManagedType() { SampleMappingContext context = new SampleMappingContext(); @@ -53,10 +50,7 @@ public class AbstractMappingContextIntegrationTests) null); } - /** - * @see DATACMNS-214 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-214 public void rejectsNullValueForGetPersistentEntityOfTypeInformation() { context.getPersistentEntity((TypeInformation) null); } - /** - * @see DATACMNS-228 - */ - @Test + @Test // DATACMNS-228 public void doesNotCreatePersistentPropertyForGroovyMetaClass() { SampleMappingContext mappingContext = new SampleMappingContext(); @@ -150,10 +135,7 @@ public class AbstractMappingContextUnitTests { assertThat(entity.getPersistentProperty("metaClass"), is(nullValue())); } - /** - * @see DATACMNS-332 - */ - @Test + @Test // DATACMNS-332 public void usesMostConcreteProperty() { SampleMappingContext mappingContext = new SampleMappingContext(); @@ -161,10 +143,7 @@ public class AbstractMappingContextUnitTests { assertThat(entity.getPersistentProperty("foo").isIdProperty(), is(true)); } - /** - * @see DATACMNS-345 - */ - @Test + @Test // DATACMNS-345 @SuppressWarnings("rawtypes") public void returnsEntityForComponentType() { @@ -177,10 +156,7 @@ public class AbstractMappingContextUnitTests { assertThat(propertyEntity.getType(), is(equalTo((Class) Person.class))); } - /** - * @see DATACMNS-380 - */ - @Test + @Test // DATACMNS-380 public void returnsPersistentPropertyPathForDotPath() { PersistentPropertyPath path = context.getPersistentPropertyPath("persons.name", @@ -191,18 +167,12 @@ public class AbstractMappingContextUnitTests { assertThat(path.getLeafProperty().getName(), is("name")); } - /** - * @see DATACMNS-380 - */ - @Test(expected = MappingException.class) + @Test(expected = MappingException.class) // DATACMNS-380 public void rejectsInvalidPropertyReferenceWithMappingException() { context.getPersistentPropertyPath("foo", Sample.class); } - /** - * @see DATACMNS-390 - */ - @Test + @Test // DATACMNS-390 public void exposesCopyOfPersistentEntitiesToAvoidConcurrentModificationException() { SampleMappingContext context = new SampleMappingContext(); @@ -217,49 +187,34 @@ public class AbstractMappingContextUnitTests { } } - /** - * @see DATACMNS-447 - */ - @Test + @Test // DATACMNS-447 public void shouldReturnNullForSimpleTypesIfInStrictIsEnabled() { context.setStrict(true); assertThat(context.getPersistentEntity(Integer.class), is(nullValue())); } - /** - * @see DATACMNS-462 - */ - @Test + @Test // DATACMNS-462 public void hasPersistentEntityForCollectionPropertiesAfterInitialization() { context.getPersistentEntity(Sample.class); assertHasEntityFor(Person.class, context, true); } - /** - * @see DATACMNS-479 - */ - @Test + @Test // DATACMNS-479 public void doesNotAddMapImplementationClassesAsPersistentEntity() { context.getPersistentEntity(Sample.class); assertHasEntityFor(TreeMap.class, context, false); } - /** - * @see DATACMNS-695 - */ - @Test + @Test // DATACMNS-695 public void persistentPropertyPathTraversesGenericTypesCorrectly() { assertThat(context.getPersistentPropertyPath("field.wrapped.field", Outer.class), is(Matchers. iterableWithSize(3))); } - /** - * @see DATACMNS-727 - */ - @Test + @Test // DATACMNS-727 public void exposesContextForFailingPropertyPathLookup() { try { diff --git a/src/test/java/org/springframework/data/mapping/context/DefaultPersistenPropertyPathUnitTests.java b/src/test/java/org/springframework/data/mapping/context/DefaultPersistenPropertyPathUnitTests.java index 66607e171..932c2676c 100644 --- a/src/test/java/org/springframework/data/mapping/context/DefaultPersistenPropertyPathUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/context/DefaultPersistenPropertyPathUnitTests.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. @@ -120,10 +120,7 @@ public class DefaultPersistenPropertyPathUnitTests() { @@ -137,10 +134,7 @@ public class DefaultPersistenPropertyPathUnitTests() { diff --git a/src/test/java/org/springframework/data/mapping/context/PersistentEntitiesUnitTests.java b/src/test/java/org/springframework/data/mapping/context/PersistentEntitiesUnitTests.java index f302c23ea..c372c0a74 100644 --- a/src/test/java/org/springframework/data/mapping/context/PersistentEntitiesUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/context/PersistentEntitiesUnitTests.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. @@ -39,18 +39,12 @@ public class PersistentEntitiesUnitTests { @Mock SampleMappingContext first; @Mock SampleMappingContext second; - /** - * @see DATACMNS-458 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-458 public void rejectsNullMappingContexts() { new PersistentEntities(null); } - /** - * @see DATACMNS-458 - */ - @Test + @Test // DATACMNS-458 public void returnsPersistentEntitiesFromMappingContexts() { when(first.hasPersistentEntityFor(Sample.class)).thenReturn(false); @@ -65,10 +59,7 @@ public class PersistentEntitiesUnitTests { verify(second, times(1)).getPersistentEntity(Sample.class); } - /** - * @see DATACMNS-458 - */ - @Test + @Test // DATACMNS-458 public void indicatesManagedType() { SampleMappingContext context = new SampleMappingContext(); diff --git a/src/test/java/org/springframework/data/mapping/model/AbstractPersistentPropertyUnitTests.java b/src/test/java/org/springframework/data/mapping/model/AbstractPersistentPropertyUnitTests.java index df63d816d..6a2007827 100644 --- a/src/test/java/org/springframework/data/mapping/model/AbstractPersistentPropertyUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/model/AbstractPersistentPropertyUnitTests.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. @@ -58,10 +58,7 @@ public class AbstractPersistentPropertyUnitTests { typeHolder = new SimpleTypeHolder(); } - /** - * @see DATACMNS-68 - */ - @Test + @Test // DATACMNS-68 public void discoversComponentTypeCorrectly() throws Exception { Field field = ReflectionUtils.findField(TestClassComplex.class, "testClassSet"); @@ -70,10 +67,7 @@ public class AbstractPersistentPropertyUnitTests { property.getComponentType(); } - /** - * @see DATACMNS-101 - */ - @Test + @Test // DATACMNS-101 public void returnsNestedEntityTypeCorrectly() { Field field = ReflectionUtils.findField(TestClassComplex.class, "testClassSet"); @@ -82,10 +76,7 @@ public class AbstractPersistentPropertyUnitTests { assertThat(property.getPersistentEntityType().iterator().hasNext(), is(false)); } - /** - * @see DATACMNS-132 - */ - @Test + @Test // DATACMNS-132 public void isEntityWorksForUntypedMaps() throws Exception { Field field = ReflectionUtils.findField(TestClassComplex.class, "map"); @@ -93,10 +84,7 @@ public class AbstractPersistentPropertyUnitTests { assertThat(property.isEntity(), is(false)); } - /** - * @see DATACMNS-132 - */ - @Test + @Test // DATACMNS-132 public void isEntityWorksForUntypedCollection() throws Exception { Field field = ReflectionUtils.findField(TestClassComplex.class, "collection"); @@ -104,10 +92,7 @@ public class AbstractPersistentPropertyUnitTests { assertThat(property.isEntity(), is(false)); } - /** - * @see DATACMNS-121 - */ - @Test + @Test // DATACMNS-121 public void considersPropertiesEqualIfFieldEquals() { Field first = ReflectionUtils.findField(FirstConcrete.class, "genericField"); @@ -120,10 +105,7 @@ public class AbstractPersistentPropertyUnitTests { assertThat(firstProperty.hashCode(), is(secondProperty.hashCode())); } - /** - * @see DATACMNS-180 - */ - @Test + @Test // DATACMNS-180 public void doesNotConsiderJavaTransientFieldsTransient() { Field transientField = ReflectionUtils.findField(TestClassComplex.class, "transientField"); @@ -132,10 +114,7 @@ public class AbstractPersistentPropertyUnitTests { assertThat(property.isTransient(), is(false)); } - /** - * @see DATACMNS-206 - */ - @Test + @Test // DATACMNS-206 public void findsSimpleGettersAndASetters() { Field field = ReflectionUtils.findField(AccessorTestClass.class, "id"); @@ -146,10 +125,7 @@ public class AbstractPersistentPropertyUnitTests { assertThat(property.getSetter(), is(notNullValue())); } - /** - * @see DATACMNS-206 - */ - @Test + @Test // DATACMNS-206 public void doesNotUseInvalidGettersAndASetters() { Field field = ReflectionUtils.findField(AccessorTestClass.class, "anotherId"); @@ -160,10 +136,7 @@ public class AbstractPersistentPropertyUnitTests { assertThat(property.getSetter(), is(nullValue())); } - /** - * @see DATACMNS-206 - */ - @Test + @Test // DATACMNS-206 public void usesCustomGetter() { Field field = ReflectionUtils.findField(AccessorTestClass.class, "yetAnotherId"); @@ -174,10 +147,7 @@ public class AbstractPersistentPropertyUnitTests { assertThat(property.getSetter(), is(nullValue())); } - /** - * @see DATACMNS-206 - */ - @Test + @Test // DATACMNS-206 public void usesCustomSetter() { Field field = ReflectionUtils.findField(AccessorTestClass.class, "yetYetAnotherId"); @@ -188,10 +158,7 @@ public class AbstractPersistentPropertyUnitTests { assertThat(property.getSetter(), is(notNullValue())); } - /** - * @see DATACMNS-206 - */ - @Test + @Test // DATACMNS-206 public void returnsNullGetterAndSetterIfNoPropertyDescriptorGiven() { Field field = ReflectionUtils.findField(AccessorTestClass.class, "id"); @@ -202,10 +169,7 @@ public class AbstractPersistentPropertyUnitTests { assertThat(property.getSetter(), is(nullValue())); } - /** - * @see DATACMNS-337 - */ - @Test + @Test // DATACMNS-337 public void resolvesActualType() { SamplePersistentProperty property = getProperty(Sample.class, "person"); @@ -221,50 +185,35 @@ public class AbstractPersistentPropertyUnitTests { assertThat(property.getActualType(), is((Object) Person.class)); } - /** - * @see DATACMNS-462 - */ - @Test + @Test // DATACMNS-462 public void considersCollectionPropertyEntitiesIfComponentTypeIsEntity() { SamplePersistentProperty property = getProperty(Sample.class, "persons"); assertThat(property.isEntity(), is(true)); } - /** - * @see DATACMNS-462 - */ - @Test + @Test // DATACMNS-462 public void considersMapPropertyEntitiesIfValueTypeIsEntity() { SamplePersistentProperty property = getProperty(Sample.class, "personMap"); assertThat(property.isEntity(), is(true)); } - /** - * @see DATACMNS-462 - */ - @Test + @Test // DATACMNS-462 public void considersArrayPropertyEntitiesIfComponentTypeIsEntity() { SamplePersistentProperty property = getProperty(Sample.class, "personArray"); assertThat(property.isEntity(), is(true)); } - /** - * @see DATACMNS-462 - */ - @Test + @Test // DATACMNS-462 public void considersCollectionPropertySimpleIfComponentTypeIsSimple() { SamplePersistentProperty property = getProperty(Sample.class, "strings"); assertThat(property.isEntity(), is(false)); } - /** - * @see DATACMNS-562 - */ - @Test + @Test // DATACMNS-562 public void doesNotConsiderPropertyWithTreeMapMapValueAnEntity() { SamplePersistentProperty property = getProperty(TreeMapWrapper.class, "map"); diff --git a/src/test/java/org/springframework/data/mapping/model/AnnotationBasedPersistentPropertyUnitTests.java b/src/test/java/org/springframework/data/mapping/model/AnnotationBasedPersistentPropertyUnitTests.java index 7011f57c7..4671fbdc8 100644 --- a/src/test/java/org/springframework/data/mapping/model/AnnotationBasedPersistentPropertyUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/model/AnnotationBasedPersistentPropertyUnitTests.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. @@ -58,44 +58,29 @@ public class AnnotationBasedPersistentPropertyUnitTests

> { assertThat(entity.getTypeAlias(), is((Object) "foo")); } - /** - * @see DATACMNS-50 - */ - @Test + @Test // DATACMNS-50 @SuppressWarnings("unchecked") public void considersComparatorForPropertyOrder() { @@ -130,10 +127,7 @@ public class BasicPersistentEntityUnitTests> { assertThat(iterator.next(), is(entity.getPersistentProperty("ssn"))); } - /** - * @see DATACMNS-186 - */ - @Test + @Test // DATACMNS-186 public void addingAndIdPropertySetsIdPropertyInternally() { MutablePersistentEntity entity = createEntity(Person.class); @@ -144,10 +138,7 @@ public class BasicPersistentEntityUnitTests> { assertThat(entity.getIdProperty(), is(property)); } - /** - * @see DATACMNS-186 - */ - @Test + @Test // DATACMNS-186 public void rejectsIdPropertyIfAlreadySet() { MutablePersistentEntity entity = createEntity(Person.class); @@ -160,10 +151,7 @@ public class BasicPersistentEntityUnitTests> { entity.addPersistentProperty(anotherProperty); } - /** - * @see DATACMNS-365 - */ - @Test + @Test // DATACMNS-365 public void detectsPropertyWithAnnotation() { SampleMappingContext context = new SampleMappingContext(); @@ -180,10 +168,7 @@ public class BasicPersistentEntityUnitTests> { assertThat(entity.getPersistentProperty(CreatedDate.class), is(nullValue())); } - /** - * @see DATACMNS-596 - */ - @Test + @Test // DATACMNS-596 public void returnsBeanWrapperForPropertyAccessor() { assumeThat(System.getProperty("java.version"), CoreMatchers.startsWith("1.6")); @@ -198,10 +183,7 @@ public class BasicPersistentEntityUnitTests> { assertThat(accessor.getBean(), is((Object) value)); } - /** - * @see DATACMNS-809 - */ - @Test + @Test // DATACMNS-809 public void returnsGeneratedPropertyAccessorForPropertyAccessor() { assumeThat(System.getProperty("java.version"), not(CoreMatchers.startsWith("1.6"))); @@ -217,10 +199,7 @@ public class BasicPersistentEntityUnitTests> { assertThat(accessor.getBean(), is((Object) value)); } - /** - * @see DATACMNS-596 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-596 public void rejectsNullBeanForPropertyAccessor() { SampleMappingContext context = new SampleMappingContext(); @@ -229,10 +208,7 @@ public class BasicPersistentEntityUnitTests> { entity.getPropertyAccessor(null); } - /** - * @see DATACMNS-596 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-596 public void rejectsNonMatchingBeanForPropertyAccessor() { SampleMappingContext context = new SampleMappingContext(); @@ -241,10 +217,7 @@ public class BasicPersistentEntityUnitTests> { entity.getPropertyAccessor("foo"); } - /** - * @see DATACMNS-597 - */ - @Test + @Test // DATACMNS-597 public void supportsSubtypeInstancesOnPropertyAccessorLookup() { SampleMappingContext context = new SampleMappingContext(); @@ -253,10 +226,7 @@ public class BasicPersistentEntityUnitTests> { assertThat(entity.getPropertyAccessor(new Subtype()), is(notNullValue())); } - /** - * @see DATACMNS-825 - */ - @Test + @Test // DATACMNS-825 public void returnsTypeAliasIfAnnotatedUsingComposedAnnotation() { PersistentEntity entity = createEntity( @@ -264,10 +234,7 @@ public class BasicPersistentEntityUnitTests> { assertThat(entity.getTypeAlias(), is((Object) "bar")); } - /** - * @see DATACMNS-866 - */ - @Test + @Test // DATACMNS-866 public void invalidBeanAccessCreatesDescriptiveErrorMessage() { PersistentEntity entity = createEntity(Entity.class); @@ -278,10 +245,7 @@ public class BasicPersistentEntityUnitTests> { entity.getPropertyAccessor(new Object()); } - /** - * @see DATACMNS-934 - */ - @Test + @Test // DATACMNS-934 public void doesNotThrowAnExceptionForNullAssociation() { BasicPersistentEntity entity = createEntity(Entity.class); diff --git a/src/test/java/org/springframework/data/mapping/model/CamelCaseAbbreviatingFieldNamingStrategyUnitTests.java b/src/test/java/org/springframework/data/mapping/model/CamelCaseAbbreviatingFieldNamingStrategyUnitTests.java index e998e5c35..2021fabc1 100644 --- a/src/test/java/org/springframework/data/mapping/model/CamelCaseAbbreviatingFieldNamingStrategyUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/model/CamelCaseAbbreviatingFieldNamingStrategyUnitTests.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. @@ -38,10 +38,7 @@ public class CamelCaseAbbreviatingFieldNamingStrategyUnitTests { @Mock PersistentProperty property; - /** - * @see DATACMNS-523 - */ - @Test + @Test // DATACMNS-523 public void abbreviatesToCamelCase() { assertFieldNameForPropertyName("fooBar", "fb"); diff --git a/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactoryDatatypeTests.java b/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactoryDatatypeTests.java index c9a6925f2..b7a28103e 100644 --- a/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactoryDatatypeTests.java +++ b/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactoryDatatypeTests.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. @@ -44,7 +44,6 @@ import org.springframework.test.util.ReflectionTestUtils; * * @author Mark Paluch * @author Oliver Gierke - * @see DATACMNS-809 */ @RunWith(Parameterized.class) public class ClassGeneratingPropertyAccessorFactoryDatatypeTests { @@ -124,10 +123,7 @@ public class ClassGeneratingPropertyAccessorFactoryDatatypeTests { return parameters; } - /** - * @see DATACMNS-809 - */ - @Test + @Test // DATACMNS-809 public void shouldSetAndGetProperty() throws Exception { PersistentProperty property = getProperty(bean, propertyName); @@ -137,10 +133,7 @@ public class ClassGeneratingPropertyAccessorFactoryDatatypeTests { assertThat(persistentPropertyAccessor.getProperty(property), is(equalTo((Object) value))); } - /** - * @see DATACMNS-809 - */ - @Test + @Test // DATACMNS-809 public void shouldUseClassPropertyAccessorFactory() throws Exception { BasicPersistentEntity persistentEntity = mappingContext @@ -161,9 +154,7 @@ public class ClassGeneratingPropertyAccessorFactoryDatatypeTests { return persistentEntity.getPersistentProperty(name); } - /** - * @see DATACMNS-809 - */ + // DATACMNS-809 @AccessType(Type.FIELD) public static class FieldAccess { @@ -211,9 +202,7 @@ public class ClassGeneratingPropertyAccessorFactoryDatatypeTests { String stringArray[]; } - /** - * @see DATACMNS-809 - */ + // DATACMNS-809 @AccessType(Type.PROPERTY) @Data public static class PropertyAccess { @@ -262,9 +251,7 @@ public class ClassGeneratingPropertyAccessorFactoryDatatypeTests { String stringArray[]; } - /** - * @see DATACMNS-916 - */ + // DATACMNS-916 @AccessType(Type.FIELD) private final static class PrivateFinalFieldAccess { @@ -312,9 +299,7 @@ public class ClassGeneratingPropertyAccessorFactoryDatatypeTests { String stringArray[]; } - /** - * @see DATACMNS-916 - */ + // DATACMNS-916 @AccessType(Type.PROPERTY) @Data private final static class PrivateFinalPropertyAccess { diff --git a/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactoryEntityTypeTests.java b/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactoryEntityTypeTests.java index ecd8bd498..1bf5938d8 100644 --- a/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactoryEntityTypeTests.java +++ b/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactoryEntityTypeTests.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. @@ -38,10 +38,7 @@ public class ClassGeneratingPropertyAccessorFactoryEntityTypeTests { SampleMappingContext mappingContext = new SampleMappingContext(); - /** - * @see DATACMNS-853 - */ - @Test + @Test // DATACMNS-853 public void getIdentifierOfInterfaceBasedEntity() { Algorithm quickSort = new QuickSort(); @@ -49,10 +46,7 @@ public class ClassGeneratingPropertyAccessorFactoryEntityTypeTests { assertThat(getEntityInformation(Algorithm.class).getId(quickSort), is((Object) quickSort.getName())); } - /** - * @see DATACMNS-853 - */ - @Test + @Test // DATACMNS-853 public void getIdentifierOfClassBasedEntity() { Person jonDoe = new Person("JonDoe"); diff --git a/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactoryTests.java b/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactoryTests.java index a10b915c4..d6e32ac34 100644 --- a/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactoryTests.java +++ b/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorFactoryTests.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. @@ -43,7 +43,6 @@ import org.springframework.test.util.ReflectionTestUtils; * Unit tests for {@link ClassGeneratingPropertyAccessorFactory} * * @author Mark Paluch - * @see DATACMNS-809 */ @RunWith(Parameterized.class) public class ClassGeneratingPropertyAccessorFactoryTests { @@ -96,11 +95,7 @@ public class ClassGeneratingPropertyAccessorFactoryTests { return parameters; } - /** - * @see DATACMNS-809 - * @throws Exception - */ - @Test + @Test // DATACMNS-809 public void shouldSetAndGetProperty() throws Exception { PersistentProperty property = getProperty(bean, propertyName); @@ -110,11 +105,7 @@ public class ClassGeneratingPropertyAccessorFactoryTests { assertThat(persistentPropertyAccessor.getProperty(property), is(equalTo((Object) "value"))); } - /** - * @see DATACMNS-809 - * @throws Exception - */ - @Test + @Test // DATACMNS-809 @SuppressWarnings("rawtypes") public void accessorShouldDeclareConstructor() throws Exception { @@ -126,18 +117,12 @@ public class ClassGeneratingPropertyAccessorFactoryTests { assertThat(declaredConstructors[0].getParameterTypes()[0], is(equalTo((Class) expectedConstructorType))); } - /** - * @see DATACMNS-809 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-809 public void shouldFailOnNullBean() { factory.getPropertyAccessor(mappingContext.getPersistentEntity(bean.getClass()), null); } - /** - * @see DATACMNS-809 - */ - @Test(expected = UnsupportedOperationException.class) + @Test(expected = UnsupportedOperationException.class) // DATACMNS-809 public void getPropertyShouldFailOnUnhandledProperty() { PersistentProperty property = getProperty(new Dummy(), "dummy"); @@ -146,10 +131,7 @@ public class ClassGeneratingPropertyAccessorFactoryTests { persistentPropertyAccessor.getProperty(property); } - /** - * @see DATACMNS-809 - */ - @Test(expected = UnsupportedOperationException.class) + @Test(expected = UnsupportedOperationException.class) // DATACMNS-809 public void setPropertyShouldFailOnUnhandledProperty() { PersistentProperty property = getProperty(new Dummy(), "dummy"); @@ -158,10 +140,7 @@ public class ClassGeneratingPropertyAccessorFactoryTests { persistentPropertyAccessor.setProperty(property, null); } - /** - * @see DATACMNS-809 - */ - @Test + @Test // DATACMNS-809 public void shouldUseClassPropertyAccessorFactory() throws Exception { BasicPersistentEntity persistentEntity = mappingContext @@ -182,9 +161,7 @@ public class ClassGeneratingPropertyAccessorFactoryTests { return persistentEntity.getPersistentProperty(name); } - /** - * @see DATACMNS-809 - */ + // DATACMNS-809 @SuppressWarnings("unused") private static class InnerPrivateType { @@ -244,16 +221,12 @@ public class ClassGeneratingPropertyAccessorFactoryTests { } } - /** - * @see DATACMNS-809 - */ + // DATACMNS-809 public static class InnerTypeWithPrivateAncestor extends InnerPrivateType { } - /** - * @see DATACMNS-809 - */ + // DATACMNS-809 @SuppressWarnings("unused") static class InnerPackageDefaultType { @@ -313,9 +286,7 @@ public class ClassGeneratingPropertyAccessorFactoryTests { } } - /** - * @see DATACMNS-809 - */ + // DATACMNS-809 @SuppressWarnings("unused") protected static class InnerProtectedType { @@ -375,9 +346,7 @@ public class ClassGeneratingPropertyAccessorFactoryTests { } } - /** - * @see DATACMNS-809 - */ + // DATACMNS-809 @SuppressWarnings("unused") public static class InnerPublicType { @@ -439,9 +408,7 @@ public class ClassGeneratingPropertyAccessorFactoryTests { public static class SubtypeOfTypeInOtherPackage extends TypeInOtherPackage {} - /** - * @see DATACMNS-809 - */ + // DATACMNS-809 @SuppressWarnings("unused") private static class Dummy { diff --git a/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorPackageDefaultType.java b/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorPackageDefaultType.java index bcc934bb8..846bb0cf6 100644 --- a/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorPackageDefaultType.java +++ b/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorPackageDefaultType.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.annotation.AccessType.Type; /** * @author Mark Paluch * @author Oliver Gierke - * @see DATACMNS-809 */ @SuppressWarnings("unused") class ClassGeneratingPropertyAccessorPackageDefaultType { diff --git a/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorPublicType.java b/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorPublicType.java index 45b447f8e..bf2d26df8 100644 --- a/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorPublicType.java +++ b/src/test/java/org/springframework/data/mapping/model/ClassGeneratingPropertyAccessorPublicType.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.annotation.AccessType.Type; /** * @author Mark Paluch * @author Oliver Gierke - * @see DATACMNS-809 */ @SuppressWarnings("unused") public class ClassGeneratingPropertyAccessorPublicType { diff --git a/src/test/java/org/springframework/data/mapping/model/ConvertingPropertyAccessorUnitTests.java b/src/test/java/org/springframework/data/mapping/model/ConvertingPropertyAccessorUnitTests.java index c1835b331..555ec265d 100644 --- a/src/test/java/org/springframework/data/mapping/model/ConvertingPropertyAccessorUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/model/ConvertingPropertyAccessorUnitTests.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. @@ -35,36 +35,24 @@ public class ConvertingPropertyAccessorUnitTests { static final ConversionService CONVERSION_SERVICE = new DefaultFormattingConversionService(); - /** - * @see DATACMNS-596 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-596 public void rejectsNullPropertyAccessorDelegate() { new ConvertingPropertyAccessor(null, CONVERSION_SERVICE); } - /** - * @see DATACMNS-596 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-596 public void rejectsNullConversionService() { new ConvertingPropertyAccessor(new BeanWrapper(new Object()), null); } - /** - * @see DATACMNS-596 - */ - @Test + @Test // DATACMNS-596 public void returnsBeanFromDelegate() { Object entity = new Entity(); assertThat(getAccessor(entity, CONVERSION_SERVICE).getBean(), is(entity)); } - /** - * @see DATACMNS-596 - */ - @Test + @Test // DATACMNS-596 public void convertsPropertyValueToExpectedType() { Entity entity = new Entity(); @@ -75,10 +63,7 @@ public class ConvertingPropertyAccessorUnitTests { assertThat(accessor.getProperty(getIdProperty(), String.class), is("1")); } - /** - * @see DATACMNS-596 - */ - @Test + @Test // DATACMNS-596 public void doesNotInvokeConversionForNullValues() { ConversionService conversionService = mock(ConversionService.class); @@ -88,10 +73,7 @@ public class ConvertingPropertyAccessorUnitTests { verify(conversionService, times(0)).convert(1L, Number.class); } - /** - * @see DATACMNS-596 - */ - @Test + @Test // DATACMNS-596 public void doesNotInvokeConversionIfTypeAlreadyMatches() { Entity entity = new Entity(); @@ -104,10 +86,7 @@ public class ConvertingPropertyAccessorUnitTests { verify(conversionService, times(0)).convert(1L, Number.class); } - /** - * @see DATACMNS-596 - */ - @Test + @Test // DATACMNS-596 public void convertsValueOnSetIfTypesDontMatch() { Entity entity = new Entity(); @@ -118,10 +97,7 @@ public class ConvertingPropertyAccessorUnitTests { assertThat(entity.id, is(1L)); } - /** - * @see DATACMNS-596 - */ - @Test + @Test // DATACMNS-596 public void doesNotInvokeConversionIfTypeAlreadyMatchesOnSet() { ConvertingPropertyAccessor accessor = getAccessor(new Entity(), mock(ConversionService.class)); diff --git a/src/test/java/org/springframework/data/mapping/model/IdPropertyIdentifierAccessorUnitTests.java b/src/test/java/org/springframework/data/mapping/model/IdPropertyIdentifierAccessorUnitTests.java index f9cb56f92..be4759113 100644 --- a/src/test/java/org/springframework/data/mapping/model/IdPropertyIdentifierAccessorUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/model/IdPropertyIdentifierAccessorUnitTests.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. @@ -30,28 +30,19 @@ public class IdPropertyIdentifierAccessorUnitTests { SampleMappingContext mappingContext = new SampleMappingContext(); - /** - * @see DATACMNS-599 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-599 public void rejectsEntityWithoutIdentifierProperty() { new IdPropertyIdentifierAccessor(mappingContext.getPersistentEntity(Sample.class), new Sample()); } - /** - * @see DATACMNS-599 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-599 public void rejectsNullBean() { new IdPropertyIdentifierAccessor(mappingContext.getPersistentEntity(SampleWithId.class), null); } - /** - * @see DATACMNS-599 - */ - @Test + @Test // DATACMNS-599 public void returnsIdentifierValue() { SampleWithId sample = new SampleWithId(); diff --git a/src/test/java/org/springframework/data/mapping/model/PersistentEntityParameterValueProviderUnitTests.java b/src/test/java/org/springframework/data/mapping/model/PersistentEntityParameterValueProviderUnitTests.java index c6a720950..98f32e555 100644 --- a/src/test/java/org/springframework/data/mapping/model/PersistentEntityParameterValueProviderUnitTests.java +++ b/src/test/java/org/springframework/data/mapping/model/PersistentEntityParameterValueProviderUnitTests.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. @@ -49,10 +49,7 @@ public class PersistentEntityParameterValueProviderUnitTests

property; - /** - * @see DATACMNS-523 - */ - @Test + @Test // DATACMNS-523 public void rendersSnakeCaseFieldNames() { assertFieldNameForPropertyName("fooBar", "foo_bar"); diff --git a/src/test/java/org/springframework/data/mapping/model/subpackage/TypeInOtherPackage.java b/src/test/java/org/springframework/data/mapping/model/subpackage/TypeInOtherPackage.java index ae65b6f04..e8f931f9e 100644 --- a/src/test/java/org/springframework/data/mapping/model/subpackage/TypeInOtherPackage.java +++ b/src/test/java/org/springframework/data/mapping/model/subpackage/TypeInOtherPackage.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.annotation.AccessType.Type; /** * @author Mark Paluch - * @see DATACMNS-809 */ public class TypeInOtherPackage { diff --git a/src/test/java/org/springframework/data/projection/DefaultProjectionInformationUnitTests.java b/src/test/java/org/springframework/data/projection/DefaultProjectionInformationUnitTests.java index ffa557c07..50caaab5d 100644 --- a/src/test/java/org/springframework/data/projection/DefaultProjectionInformationUnitTests.java +++ b/src/test/java/org/springframework/data/projection/DefaultProjectionInformationUnitTests.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.junit.Test; */ public class DefaultProjectionInformationUnitTests { - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void discoversInputProperties() { ProjectionInformation information = new DefaultProjectionInformation(CustomerProjection.class); @@ -42,10 +39,7 @@ public class DefaultProjectionInformationUnitTests { assertThat(toNames(information.getInputProperties()), contains("firstname", "lastname")); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void discoversAllInputProperties() { ProjectionInformation information = new DefaultProjectionInformation(ExtendedProjection.class); @@ -53,10 +47,7 @@ public class DefaultProjectionInformationUnitTests { assertThat(toNames(information.getInputProperties()), hasItems("age", "firstname", "lastname")); } - /** - * @see DATACMNS-967 - */ - @Test + @Test // DATACMNS-967 public void doesNotConsiderDefaultMethodInputProperties() throws Exception { ProjectionInformation information = new DefaultProjectionInformation(WithDefaultMethod.class); diff --git a/src/test/java/org/springframework/data/projection/MapAccessingMethodInterceptorUnitTests.java b/src/test/java/org/springframework/data/projection/MapAccessingMethodInterceptorUnitTests.java index ae6be604f..575772aed 100644 --- a/src/test/java/org/springframework/data/projection/MapAccessingMethodInterceptorUnitTests.java +++ b/src/test/java/org/springframework/data/projection/MapAccessingMethodInterceptorUnitTests.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. @@ -39,18 +39,12 @@ public class MapAccessingMethodInterceptorUnitTests { @Mock MethodInvocation invocation; - /** - * @see DATACMNS-630 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-630 public void rejectsNullMap() { new MapAccessingMethodInterceptor(null); } - /** - * @see DATACMNS-630 - */ - @Test + @Test // DATACMNS-630 public void forwardsObjectMethodsToBackingMap() throws Throwable { Map map = Collections.emptyMap(); @@ -64,10 +58,7 @@ public class MapAccessingMethodInterceptorUnitTests { assertThat(result, is((Object) map.toString())); } - /** - * @see DATACMNS-630 - */ - @Test + @Test // DATACMNS-630 public void setterInvocationStoresValueInMap() throws Throwable { Map map = new HashMap(); @@ -81,10 +72,7 @@ public class MapAccessingMethodInterceptorUnitTests { assertThat(map.get("name"), is((Object) "Foo")); } - /** - * @see DATACMNS-630 - */ - @Test + @Test // DATACMNS-630 public void getterInvocationReturnsValueFromMap() throws Throwable { Map map = new HashMap(); @@ -97,10 +85,7 @@ public class MapAccessingMethodInterceptorUnitTests { assertThat(result, is((Object) "Foo")); } - /** - * @see DATACMNS-630 - */ - @Test + @Test // DATACMNS-630 public void getterReturnsNullIfMapDoesNotContainValue() throws Throwable { Map map = new HashMap(); @@ -110,10 +95,7 @@ public class MapAccessingMethodInterceptorUnitTests { assertThat(new MapAccessingMethodInterceptor(map).invoke(invocation), is(nullValue())); } - /** - * @see DATACMNS-630 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-630 public void rejectsNonAccessorInvocation() throws Throwable { when(invocation.getMethod()).thenReturn(Sample.class.getMethod("someMethod")); diff --git a/src/test/java/org/springframework/data/projection/ProjectingMethodInterceptorUnitTests.java b/src/test/java/org/springframework/data/projection/ProjectingMethodInterceptorUnitTests.java index 3f34aa9cf..5f869124b 100644 --- a/src/test/java/org/springframework/data/projection/ProjectingMethodInterceptorUnitTests.java +++ b/src/test/java/org/springframework/data/projection/ProjectingMethodInterceptorUnitTests.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. @@ -49,10 +49,7 @@ public class ProjectingMethodInterceptorUnitTests { @Mock MethodInvocation invocation; @Mock ProjectionFactory factory; - /** - * @see DATAREST-221 - */ - @Test + @Test // DATAREST-221 public void wrapsDelegateResultInProxyIfTypesDontMatch() throws Throwable { MethodInterceptor methodInterceptor = new ProjectingMethodInterceptor(new ProxyProjectionFactory(), interceptor); @@ -63,10 +60,7 @@ public class ProjectingMethodInterceptorUnitTests { assertThat(methodInterceptor.invoke(invocation), is(instanceOf(Helper.class))); } - /** - * @see DATAREST-221 - */ - @Test + @Test // DATAREST-221 public void retunsDelegateResultAsIsIfTypesMatch() throws Throwable { MethodInterceptor methodInterceptor = new ProjectingMethodInterceptor(factory, interceptor); @@ -77,10 +71,7 @@ public class ProjectingMethodInterceptorUnitTests { assertThat(methodInterceptor.invoke(invocation), is((Object) "Foo")); } - /** - * @see DATAREST-221 - */ - @Test + @Test // DATAREST-221 public void returnsNullAsIs() throws Throwable { MethodInterceptor methodInterceptor = new ProjectingMethodInterceptor(factory, interceptor); @@ -90,10 +81,7 @@ public class ProjectingMethodInterceptorUnitTests { assertThat(methodInterceptor.invoke(invocation), is(nullValue())); } - /** - * @see DATAREST-221 - */ - @Test + @Test // DATAREST-221 public void considersPrimitivesAsWrappers() throws Throwable { MethodInterceptor methodInterceptor = new ProjectingMethodInterceptor(factory, interceptor); @@ -105,10 +93,7 @@ public class ProjectingMethodInterceptorUnitTests { verify(factory, times(0)).createProjection((Class) anyObject(), anyObject()); } - /** - * @see DATAREST-394, DATAREST-408 - */ - @Test + @Test // DATAREST-394, DATAREST-408 @SuppressWarnings("unchecked") public void appliesProjectionToNonEmptySets() throws Throwable { @@ -123,10 +108,7 @@ public class ProjectingMethodInterceptorUnitTests { assertThat(projections, hasItem(instanceOf(HelperProjection.class))); } - /** - * @see DATAREST-394, DATAREST-408 - */ - @Test + @Test // DATAREST-394, DATAREST-408 @SuppressWarnings("unchecked") public void appliesProjectionToNonEmptyLists() throws Throwable { @@ -142,10 +124,7 @@ public class ProjectingMethodInterceptorUnitTests { assertThat(projections, hasItem(instanceOf(HelperProjection.class))); } - /** - * @see DATAREST-394, DATAREST-408 - */ - @Test + @Test // DATAREST-394, DATAREST-408 @SuppressWarnings("unchecked") public void allowsMaskingAnArrayIntoACollection() throws Throwable { @@ -160,10 +139,7 @@ public class ProjectingMethodInterceptorUnitTests { assertThat(projections, hasItem(instanceOf(HelperProjection.class))); } - /** - * @see DATAREST-394, DATAREST-408 - */ - @Test + @Test // DATAREST-394, DATAREST-408 @SuppressWarnings("unchecked") public void appliesProjectionToNonEmptyMap() throws Throwable { diff --git a/src/test/java/org/springframework/data/projection/ProjectionIntegrationTests.java b/src/test/java/org/springframework/data/projection/ProjectionIntegrationTests.java index c015758f7..0bea30085 100644 --- a/src/test/java/org/springframework/data/projection/ProjectionIntegrationTests.java +++ b/src/test/java/org/springframework/data/projection/ProjectionIntegrationTests.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. @@ -34,10 +34,7 @@ import com.jayway.jsonpath.ParseContext; */ public class ProjectionIntegrationTests { - /** - * @see DATACMNS-909 - */ - @Test + @Test // DATACMNS-909 public void jacksonSerializationDoesNotExposeDecoratedClass() throws Exception { ProxyProjectionFactory factory = new ProxyProjectionFactory(); diff --git a/src/test/java/org/springframework/data/projection/PropertyAccessingMethodInterceptorUnitTests.java b/src/test/java/org/springframework/data/projection/PropertyAccessingMethodInterceptorUnitTests.java index e240a2a79..f6394bd73 100644 --- a/src/test/java/org/springframework/data/projection/PropertyAccessingMethodInterceptorUnitTests.java +++ b/src/test/java/org/springframework/data/projection/PropertyAccessingMethodInterceptorUnitTests.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. @@ -39,10 +39,7 @@ public class PropertyAccessingMethodInterceptorUnitTests { @Mock MethodInvocation invocation; - /** - * @see DATAREST-221 - */ - @Test + @Test // DATAREST-221 public void triggersPropertyAccessOnTarget() throws Throwable { Source source = new Source(); @@ -54,20 +51,14 @@ public class PropertyAccessingMethodInterceptorUnitTests { assertThat(interceptor.invoke(invocation), is((Object) "Dave")); } - /** - * @see DATAREST-221 - */ - @Test(expected = NotReadablePropertyException.class) + @Test(expected = NotReadablePropertyException.class) // DATAREST-221 public void throwsAppropriateExceptionIfThePropertyCannotBeFound() throws Throwable { when(invocation.getMethod()).thenReturn(Projection.class.getMethod("getLastname")); new PropertyAccessingMethodInterceptor(new Source()).invoke(invocation); } - /** - * @see DATAREST-221 - */ - @Test + @Test // DATAREST-221 public void forwardsObjectMethodInvocation() throws Throwable { when(invocation.getMethod()).thenReturn(Object.class.getMethod("toString")); @@ -75,10 +66,7 @@ public class PropertyAccessingMethodInterceptorUnitTests { new PropertyAccessingMethodInterceptor(new Source()).invoke(invocation); } - /** - * @see DATACMNS-630 - */ - @Test(expected = IllegalStateException.class) + @Test(expected = IllegalStateException.class) // DATACMNS-630 public void rejectsNonAccessorMethod() throws Throwable { when(invocation.getMethod()).thenReturn(Projection.class.getMethod("someGarbage")); @@ -86,10 +74,7 @@ public class PropertyAccessingMethodInterceptorUnitTests { new PropertyAccessingMethodInterceptor(new Source()).invoke(invocation); } - /** - * @see DATACMNS-820 - */ - @Test + @Test // DATACMNS-820 public void triggersWritePropertyAccessOnTarget() throws Throwable { Source source = new Source(); @@ -103,10 +88,7 @@ public class PropertyAccessingMethodInterceptorUnitTests { assertThat(source.firstname, is((Object) "Carl")); } - /** - * @see DATACMNS-820 - */ - @Test(expected = IllegalStateException.class) + @Test(expected = IllegalStateException.class) // DATACMNS-820 public void throwsAppropriateExceptionIfTheInvocationHasNoArguments() throws Throwable { Source source = new Source(); @@ -117,10 +99,7 @@ public class PropertyAccessingMethodInterceptorUnitTests { new PropertyAccessingMethodInterceptor(source).invoke(invocation); } - /** - * @see DATACMNS-820 - */ - @Test(expected = NotWritablePropertyException.class) + @Test(expected = NotWritablePropertyException.class) // DATACMNS-820 public void throwsAppropriateExceptionIfThePropertyCannotWritten() throws Throwable { when(invocation.getMethod()).thenReturn(Projection.class.getMethod("setGarbage", String.class)); diff --git a/src/test/java/org/springframework/data/projection/ProxyProjectionFactoryUnitTests.java b/src/test/java/org/springframework/data/projection/ProxyProjectionFactoryUnitTests.java index 2c683c8ca..1670bce81 100644 --- a/src/test/java/org/springframework/data/projection/ProxyProjectionFactoryUnitTests.java +++ b/src/test/java/org/springframework/data/projection/ProxyProjectionFactoryUnitTests.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. @@ -40,42 +40,27 @@ public class ProxyProjectionFactoryUnitTests { ProjectionFactory factory = new ProxyProjectionFactory(); - /** - * @see DATACMNS-630 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-630 public void rejectsNullProjectionType() { factory.createProjection(null); } - /** - * @see DATACMNS-630 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-630 public void rejectsNullProjectionTypeWithSource() { factory.createProjection(null, new Object()); } - /** - * @see DATACMNS-630 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-630 public void rejectsNullProjectionTypeForInputProperties() { factory.getInputProperties(null); } - /** - * @see DATACMNS-630 - */ - @Test + @Test // DATACMNS-630 public void returnsNullForNullSource() { assertThat(factory.createProjection(CustomerExcerpt.class, null), is(nullValue())); } - /** - * @see DATAREST-221, DATACMNS-630 - */ - @Test + @Test // DATAREST-221, DATACMNS-630 public void createsProjectingProxy() { Customer customer = new Customer(); @@ -92,10 +77,7 @@ public class ProxyProjectionFactoryUnitTests { assertThat(excerpt.getAddress().getZipCode(), is("ZIP")); } - /** - * @see DATAREST-221, DATACMNS-630 - */ - @Test + @Test // DATAREST-221, DATACMNS-630 @SuppressWarnings("rawtypes") public void proxyExposesTargetClassAware() { @@ -105,18 +87,12 @@ public class ProxyProjectionFactoryUnitTests { assertThat(((TargetClassAware) proxy).getTargetClass(), is(equalTo((Class) HashMap.class))); } - /** - * @see DATAREST-221, DATACMNS-630 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAREST-221, DATACMNS-630 public void rejectsNonInterfacesAsProjectionTarget() { factory.createProjection(Object.class, new Object()); } - /** - * @see DATACMNS-630 - */ - @Test + @Test // DATACMNS-630 public void createsMapBasedProxyFromSource() { HashMap addressSource = new HashMap(); @@ -137,10 +113,7 @@ public class ProxyProjectionFactoryUnitTests { assertThat(address.getZipCode(), is("ZIP")); } - /** - * @see DATACMNS-630 - */ - @Test + @Test // DATACMNS-630 public void createsEmptyMapBasedProxy() { CustomerProxy proxy = factory.createProjection(CustomerProxy.class); @@ -151,10 +124,7 @@ public class ProxyProjectionFactoryUnitTests { assertThat(proxy.getFirstname(), is("Dave")); } - /** - * @see DATACMNS-630 - */ - @Test + @Test // DATACMNS-630 public void returnsAllPropertiesAsInputProperties() { ProjectionInformation projectionInformation = factory.getProjectionInformation(CustomerExcerpt.class); @@ -163,10 +133,7 @@ public class ProxyProjectionFactoryUnitTests { assertThat(result, hasSize(6)); } - /** - * @see DATACMNS-655 - */ - @Test + @Test // DATACMNS-655 public void invokesDefaultMethodOnProxy() { CustomerExcerpt excerpt = factory.createProjection(CustomerExcerpt.class); @@ -178,10 +145,7 @@ public class ProxyProjectionFactoryUnitTests { assertThat(advisors[0].getAdvice(), is(instanceOf(DefaultMethodInvokingMethodInterceptor.class))); } - /** - * @see DATACMNS-648 - */ - @Test + @Test // DATACMNS-648 public void exposesProxyTarget() { CustomerExcerpt excerpt = factory.createProjection(CustomerExcerpt.class); @@ -190,10 +154,7 @@ public class ProxyProjectionFactoryUnitTests { assertThat(((TargetAware) excerpt).getTarget(), is(instanceOf(Map.class))); } - /** - * @see DATACMNS-722 - */ - @Test + @Test // DATACMNS-722 public void doesNotProjectPrimitiveArray() { Customer customer = new Customer(); @@ -204,10 +165,7 @@ public class ProxyProjectionFactoryUnitTests { assertThat(excerpt.getPicture(), is(customer.picture)); } - /** - * @see DATACMNS-722 - */ - @Test + @Test // DATACMNS-722 public void projectsNonPrimitiveArray() { Address address = new Address(); @@ -222,10 +180,7 @@ public class ProxyProjectionFactoryUnitTests { assertThat(excerpt.getShippingAddresses(), is(arrayWithSize(1))); } - /** - * @see DATACMNS-782 - */ - @Test + @Test // DATACMNS-782 public void convertsPrimitiveValues() { Customer customer = new Customer(); @@ -236,10 +191,7 @@ public class ProxyProjectionFactoryUnitTests { assertThat(excerpt.getId(), is(customer.id.toString())); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void exposesProjectionInformationCorrectly() { ProjectionInformation information = factory.getProjectionInformation(CustomerExcerpt.class); @@ -248,10 +200,7 @@ public class ProxyProjectionFactoryUnitTests { assertThat(information.isClosed(), is(true)); } - /** - * @see DATACMNS-829 - */ - @Test + @Test // DATACMNS-829 public void projectsMapOfStringToObjectCorrectly() { Customer customer = new Customer(); diff --git a/src/test/java/org/springframework/data/projection/SpelAwareProxyProjectionFactoryUnitTests.java b/src/test/java/org/springframework/data/projection/SpelAwareProxyProjectionFactoryUnitTests.java index 4e106d138..97ad68580 100644 --- a/src/test/java/org/springframework/data/projection/SpelAwareProxyProjectionFactoryUnitTests.java +++ b/src/test/java/org/springframework/data/projection/SpelAwareProxyProjectionFactoryUnitTests.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. @@ -45,10 +45,7 @@ public class SpelAwareProxyProjectionFactoryUnitTests { factory = new SpelAwareProxyProjectionFactory(); } - /** - * @see DATAREST-221, DATACMNS-630 - */ - @Test + @Test // DATAREST-221, DATACMNS-630 public void exposesSpelInvokingMethod() { Customer customer = new Customer(); @@ -59,10 +56,7 @@ public class SpelAwareProxyProjectionFactoryUnitTests { assertThat(excerpt.getFullName(), is("Dave Matthews")); } - /** - * @see DATACMNS-630 - */ - @Test + @Test // DATACMNS-630 public void excludesAtValueAnnotatedMethodsForInputProperties() { List properties = factory.getInputProperties(CustomerExcerpt.class); @@ -71,10 +65,7 @@ public class SpelAwareProxyProjectionFactoryUnitTests { assertThat(properties, hasItem("firstname")); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void considersProjectionUsingAtValueNotClosed() { ProjectionInformation information = factory.getProjectionInformation(CustomerExcerpt.class); @@ -82,10 +73,7 @@ public class SpelAwareProxyProjectionFactoryUnitTests { assertThat(information.isClosed(), is(false)); } - /** - * @see DATACMNS-820 - */ - @Test + @Test // DATACMNS-820 public void setsValueUsingProjection() { Customer customer = new Customer(); @@ -97,10 +85,7 @@ public class SpelAwareProxyProjectionFactoryUnitTests { assertThat(customer.firstname, is("Carl")); } - /** - * @see DATACMNS-820 - */ - @Test + @Test // DATACMNS-820 public void settingNotWriteablePropertyFails() { Customer customer = new Customer(); diff --git a/src/test/java/org/springframework/data/projection/SpelEvaluatingMethodInterceptorUnitTests.java b/src/test/java/org/springframework/data/projection/SpelEvaluatingMethodInterceptorUnitTests.java index 42ca68d0e..b96ac952d 100644 --- a/src/test/java/org/springframework/data/projection/SpelEvaluatingMethodInterceptorUnitTests.java +++ b/src/test/java/org/springframework/data/projection/SpelEvaluatingMethodInterceptorUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2014-2105 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. @@ -46,10 +46,7 @@ public class SpelEvaluatingMethodInterceptorUnitTests { SpelExpressionParser parser = new SpelExpressionParser(); - /** - * @see DATAREST-221, DATACMNS-630 - */ - @Test + @Test // DATAREST-221, DATACMNS-630 public void invokesMethodOnTarget() throws Throwable { when(invocation.getMethod()).thenReturn(Projection.class.getMethod("propertyFromTarget")); @@ -60,10 +57,7 @@ public class SpelEvaluatingMethodInterceptorUnitTests { assertThat(interceptor.invoke(invocation), is((Object) "property")); } - /** - * @see DATAREST-221, DATACMNS-630 - */ - @Test + @Test // DATAREST-221, DATACMNS-630 public void invokesMethodOnBean() throws Throwable { when(invocation.getMethod()).thenReturn(Projection.class.getMethod("invokeBean")); @@ -77,10 +71,7 @@ public class SpelEvaluatingMethodInterceptorUnitTests { assertThat(interceptor.invoke(invocation), is((Object) "value")); } - /** - * @see DATACMNS-630 - */ - @Test + @Test // DATACMNS-630 public void forwardNonAtValueAnnotatedMethodToDelegate() throws Throwable { when(invocation.getMethod()).thenReturn(Projection.class.getMethod("getName")); @@ -93,10 +84,7 @@ public class SpelEvaluatingMethodInterceptorUnitTests { verify(delegate).invoke(invocation); } - /** - * @see DATACMNS-630 - */ - @Test(expected = IllegalStateException.class) + @Test(expected = IllegalStateException.class) // DATACMNS-630 public void rejectsEmptySpelExpression() throws Throwable { when(invocation.getMethod()).thenReturn(InvalidProjection.class.getMethod("getAddress")); @@ -107,10 +95,7 @@ public class SpelEvaluatingMethodInterceptorUnitTests { interceptor.invoke(invocation); } - /** - * @see DATACMNS-630 - */ - @Test + @Test // DATACMNS-630 public void allowsMapAccessViaPropertyExpression() throws Throwable { Map map = new HashMap(); diff --git a/src/test/java/org/springframework/data/querydsl/QSortUnitTests.java b/src/test/java/org/springframework/data/querydsl/QSortUnitTests.java index f35b39689..f6027a381 100644 --- a/src/test/java/org/springframework/data/querydsl/QSortUnitTests.java +++ b/src/test/java/org/springframework/data/querydsl/QSortUnitTests.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. @@ -43,27 +43,18 @@ import com.querydsl.core.types.dsl.StringPath; */ public class QSortUnitTests { - /** - * @see DATACMNS-402 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-402 public void shouldThrowIfNoOrderSpecifiersAreGiven() { new QSort(); } - /** - * @see DATACMNS-402 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-402 public void shouldThrowIfNullIsGiven() { new QSort((List>) null); } - /** - * @see DATACMNS-402 - */ @SuppressWarnings("unchecked") - @Test + @Test // DATACMNS-402 public void sortBySingleProperty() { QUser user = QUser.user; @@ -74,11 +65,8 @@ public class QSortUnitTests { assertThat(qsort.getOrderFor("firstname"), is(new Sort.Order(Sort.Direction.ASC, "firstname"))); } - /** - * @see DATACMNS-402 - */ @SuppressWarnings("unchecked") - @Test + @Test // DATACMNS-402 public void sortByMultiplyProperties() { QUser user = QUser.user; @@ -91,11 +79,8 @@ public class QSortUnitTests { assertThat(qsort.getOrderFor("lastname"), is(new Sort.Order(Sort.Direction.DESC, "lastname"))); } - /** - * @see DATACMNS-402 - */ @SuppressWarnings("unchecked") - @Test + @Test // DATACMNS-402 public void sortByMultiplyPropertiesWithAnd() { QUser user = QUser.user; @@ -108,11 +93,8 @@ public class QSortUnitTests { assertThat(qsort.getOrderFor("lastname"), is(new Sort.Order(Sort.Direction.DESC, "lastname"))); } - /** - * @see DATACMNS-402 - */ @SuppressWarnings("unchecked") - @Test + @Test // DATACMNS-402 public void sortByMultiplyPropertiesWithAndAndVarArgs() { QUser user = QUser.user; @@ -125,10 +107,7 @@ public class QSortUnitTests { assertThat(qsort.getOrderFor("lastname"), is(new Sort.Order(Sort.Direction.DESC, "lastname"))); } - /** - * @see DATACMNS-402 - */ - @Test + @Test // DATACMNS-402 public void ensureInteroperabilityWithSort() { QUser user = QUser.user; @@ -140,10 +119,7 @@ public class QSortUnitTests { assertThat(sort.getOrderFor("lastname"), is(new Sort.Order(Sort.Direction.DESC, "lastname"))); } - /** - * @see DATACMNS-402 - */ - @Test + @Test // DATACMNS-402 public void concatenatesPlainSortCorrectly() { QUser user = QUser.user; @@ -154,10 +130,7 @@ public class QSortUnitTests { assertThat(result, hasItems(new Order(Direction.ASC, "lastname"), new Order(Direction.ASC, "firstname"))); } - /** - * @see DATACMNS-566 - */ - @Test + @Test // DATACMNS-566 public void shouldSupportSortByOperatorExpressions() { QUser user = QUser.user; @@ -169,10 +142,7 @@ public class QSortUnitTests { new Order(Direction.ASC, user.dateOfBirth.yearMonth().toString()))); } - /** - * @see DATACMNS-621 - */ - @Test + @Test // DATACMNS-621 public void shouldCreateSortForNestedPathCorrectly() { QSort sort = new QSort(userWrapper.user.firstname.asc()); @@ -180,10 +150,7 @@ public class QSortUnitTests { assertThat(sort, hasItems(new Order(Direction.ASC, "user.firstname"))); } - /** - * @see DATACMNS-621 - */ - @Test + @Test // DATACMNS-621 public void shouldCreateSortForDeepNestedPathCorrectly() { QSort sort = new QSort(wrapperForUserWrapper.wrapper.user.firstname.asc()); @@ -191,10 +158,7 @@ public class QSortUnitTests { assertThat(sort, hasItems(new Order(Direction.ASC, "wrapper.user.firstname"))); } - /** - * @see DATACMNS-621 - */ - @Test + @Test // DATACMNS-621 public void shouldCreateSortForReallyDeepNestedPathCorrectly() { QSort sort = new QSort(wrapperToWrapWrapperForUserWrapper.wrapperForUserWrapper.wrapper.user.firstname.asc()); @@ -202,10 +166,7 @@ public class QSortUnitTests { assertThat(sort, hasItems(new Order(Direction.ASC, "wrapperForUserWrapper.wrapper.user.firstname"))); } - /** - * @see DATACMNS-755 - */ - @Test + @Test // DATACMNS-755 public void handlesPlainStringPathsCorrectly() { StringPath path = new PathBuilderFactory().create(User.class).getString("firstname"); diff --git a/src/test/java/org/springframework/data/querydsl/QueryDslUtilsUnitTests.java b/src/test/java/org/springframework/data/querydsl/QueryDslUtilsUnitTests.java index 88e57fd93..2c36fb55c 100644 --- a/src/test/java/org/springframework/data/querydsl/QueryDslUtilsUnitTests.java +++ b/src/test/java/org/springframework/data/querydsl/QueryDslUtilsUnitTests.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. @@ -28,18 +28,12 @@ import org.junit.Test; */ public class QueryDslUtilsUnitTests { - /** - * @see DATACMNS-883 - */ - @Test + @Test // DATACMNS-883 public void rendersDotPathForPathTraversalContainingAnyExpression() { assertThat(toDotPath(QUser.user.addresses.any().street), is("addresses.street")); } - /** - * @see DATACMNS-941 - */ - @Test + @Test // DATACMNS-941 public void skipsIntermediateDelegates() { assertThat(toDotPath(QUser.user.as(QSpecialUser.class).as(QSpecialUser.class).specialProperty), diff --git a/src/test/java/org/springframework/data/querydsl/QuerydslRepositoryInvokerAdapterUnitTests.java b/src/test/java/org/springframework/data/querydsl/QuerydslRepositoryInvokerAdapterUnitTests.java index 188954ef4..860111116 100644 --- a/src/test/java/org/springframework/data/querydsl/QuerydslRepositoryInvokerAdapterUnitTests.java +++ b/src/test/java/org/springframework/data/querydsl/QuerydslRepositoryInvokerAdapterUnitTests.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 QuerydslRepositoryInvokerAdapterUnitTests { this.adapter = new QuerydslRepositoryInvokerAdapter(delegate, executor, predicate); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void forwardsFindAllToExecutorWithPredicate() { Sort sort = new Sort("firstname"); @@ -68,10 +65,7 @@ public class QuerydslRepositoryInvokerAdapterUnitTests { verify(delegate, times(0)).invokeFindAll(sort); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void forwardsFindAllWithPageableToExecutorWithPredicate() { PageRequest pageable = new PageRequest(0, 10); @@ -81,10 +75,7 @@ public class QuerydslRepositoryInvokerAdapterUnitTests { verify(delegate, times(0)).invokeFindAll(pageable); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 @SuppressWarnings({ "deprecation", "unchecked" }) public void forwardsMethodsToDelegate() { diff --git a/src/test/java/org/springframework/data/querydsl/binding/QuerydslBindingsFactoryUnitTests.java b/src/test/java/org/springframework/data/querydsl/binding/QuerydslBindingsFactoryUnitTests.java index 105ff77e9..b79f52832 100644 --- a/src/test/java/org/springframework/data/querydsl/binding/QuerydslBindingsFactoryUnitTests.java +++ b/src/test/java/org/springframework/data/querydsl/binding/QuerydslBindingsFactoryUnitTests.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. @@ -58,10 +58,7 @@ public class QuerydslBindingsFactoryUnitTests { this.factory = new QuerydslBindingsFactory(SimpleEntityPathResolver.INSTANCE); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 @SuppressWarnings({ "unchecked", "rawtypes" }) public void createBindingsShouldHonorQuerydslBinderCustomizerHookWhenPresent() { @@ -81,10 +78,7 @@ public class QuerydslBindingsFactoryUnitTests { is((Predicate) QUser.user.firstname.contains("rand"))); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 @SuppressWarnings({ "unchecked", "rawtypes" }) public void shouldReuseExistingQuerydslBinderCustomizer() { @@ -102,10 +96,7 @@ public class QuerydslBindingsFactoryUnitTests { is((Predicate) QUser.user.firstname.eq("RAND"))); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void rejectsPredicateResolutionIfDomainTypeCantBeAutoDetected() { exception.expect(IllegalStateException.class); diff --git a/src/test/java/org/springframework/data/querydsl/binding/QuerydslBindingsUnitTests.java b/src/test/java/org/springframework/data/querydsl/binding/QuerydslBindingsUnitTests.java index 808f2224b..ae260e8d5 100644 --- a/src/test/java/org/springframework/data/querydsl/binding/QuerydslBindingsUnitTests.java +++ b/src/test/java/org/springframework/data/querydsl/binding/QuerydslBindingsUnitTests.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. @@ -58,18 +58,12 @@ public class QuerydslBindingsUnitTests { this.bindings = new QuerydslBindings(); } - /** - * @see DATACMNS-669 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-669 public void rejectsNullPath() { bindings.getBindingForPath(null); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void returnsNullIfNoBindingRegisteredForPath() { PathInformation path = PropertyPathInformation.of("lastname", User.class); @@ -77,10 +71,7 @@ public class QuerydslBindingsUnitTests { assertThat(bindings.getBindingForPath(path), nullValue()); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void returnsRegisteredBindingForSimplePath() { bindings.bind(QUser.user.firstname).first(CONTAINS_BINDING); @@ -90,10 +81,7 @@ public class QuerydslBindingsUnitTests { assertAdapterWithTargetBinding(bindings.getBindingForPath(path), CONTAINS_BINDING); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void getBindingForPathShouldReturnSpeficicBindingForNestedElementsWhenAvailable() { bindings.bind(QUser.user.address.street).first(CONTAINS_BINDING); @@ -103,10 +91,7 @@ public class QuerydslBindingsUnitTests { assertAdapterWithTargetBinding(bindings.getBindingForPath(path), CONTAINS_BINDING); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void getBindingForPathShouldReturnSpeficicBindingForTypes() { bindings.bind(String.class).first(CONTAINS_BINDING); @@ -116,10 +101,7 @@ public class QuerydslBindingsUnitTests { assertAdapterWithTargetBinding(bindings.getBindingForPath(path), CONTAINS_BINDING); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void propertyNotExplicitlyIncludedAndWithoutTypeBindingIsInvisible() { bindings.bind(String.class).first(CONTAINS_BINDING); @@ -129,10 +111,7 @@ public class QuerydslBindingsUnitTests { assertThat(bindings.getBindingForPath(path), nullValue()); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void pathIsVisibleIfTypeBasedBindingWasRegistered() { bindings.bind(String.class).first(CONTAINS_BINDING); @@ -140,10 +119,7 @@ public class QuerydslBindingsUnitTests { assertThat(bindings.isPathAvailable("inceptionYear", User.class), is(true)); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void explicitlyIncludedPathIsVisible() { bindings.including(QUser.user.inceptionYear); @@ -151,10 +127,7 @@ public class QuerydslBindingsUnitTests { assertThat(bindings.isPathAvailable("inceptionYear", User.class), is(true)); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void notExplicitlyIncludedPathIsInvisible() { bindings.including(QUser.user.inceptionYear); @@ -162,10 +135,7 @@ public class QuerydslBindingsUnitTests { assertThat(bindings.isPathAvailable("firstname", User.class), is(false)); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void excludedPathIsInvisible() { bindings.excluding(QUser.user.inceptionYear); @@ -173,10 +143,7 @@ public class QuerydslBindingsUnitTests { assertThat(bindings.isPathAvailable("inceptionYear", User.class), is(false)); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void pathIsVisibleIfNotExplicitlyExcluded() { bindings.excluding(QUser.user.inceptionYear); @@ -184,10 +151,7 @@ public class QuerydslBindingsUnitTests { assertThat(bindings.isPathAvailable("firstname", User.class), is(true)); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void pathIsVisibleIfItsBothBlackAndWhitelisted() { bindings.excluding(QUser.user.firstname); @@ -196,10 +160,7 @@ public class QuerydslBindingsUnitTests { assertThat(bindings.isPathAvailable("firstname", User.class), is(true)); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void nestedPathIsInvisibleIfAParanetPathWasExcluded() { bindings.excluding(QUser.user.address); @@ -207,10 +168,7 @@ public class QuerydslBindingsUnitTests { assertThat(bindings.isPathAvailable("address.city", User.class), is(false)); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void pathIsVisibleIfConcretePathIsVisibleButParentExcluded() { bindings.excluding(QUser.user.address); @@ -219,10 +177,7 @@ public class QuerydslBindingsUnitTests { assertThat(bindings.isPathAvailable("address.city", User.class), is(true)); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void isPathVisibleShouldReturnFalseWhenPartialPathContainedInExcludingAndConcretePathToDifferentPropertyIsIncluded() { bindings.excluding(QUser.user.address); @@ -231,10 +186,7 @@ public class QuerydslBindingsUnitTests { assertThat(bindings.isPathAvailable("address.street", User.class), is(false)); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void whitelistsPropertiesCorrectly() { bindings.including(QUser.user.firstname, QUser.user.address.street); @@ -245,26 +197,17 @@ public class QuerydslBindingsUnitTests { assertThat(bindings.isPathAvailable("address.city", User.class), is(false)); } - /** - * @see DATACMNS-787 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-787 public void rejectsNullAlias() { bindings.bind(QUser.user.address).as(null); } - /** - * @see DATACMNS-787 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-787 public void rejectsEmptyAlias() { bindings.bind(QUser.user.address).as(""); } - /** - * @see DATACMNS-787 - */ - @Test + @Test // DATACMNS-787 public void aliasesBinding() { bindings.bind(QUser.user.address.city).as("city").first(CONTAINS_BINDING); @@ -278,10 +221,7 @@ public class QuerydslBindingsUnitTests { assertThat(bindings.isPathAvailable("address.city", User.class), is(false)); } - /** - * @see DATACMNS-787 - */ - @Test + @Test // DATACMNS-787 public void explicitlyIncludesOriginalBindingDespiteAlias() { bindings.including(QUser.user.address.city); @@ -300,10 +240,7 @@ public class QuerydslBindingsUnitTests { assertAdapterWithTargetBinding(bindings.getBindingForPath(propertyPath), CONTAINS_BINDING); } - /** - * @see DATACMNS-787 - */ - @Test + @Test // DATACMNS-787 public void registedAliasWithNullBinding() { bindings.bind(QUser.user.address.city).as("city").withDefaultBinding(); @@ -315,10 +252,7 @@ public class QuerydslBindingsUnitTests { assertThat(binding, is(nullValue())); } - /** - * @see DATACMNS-941 - */ - @Test + @Test // DATACMNS-941 public void registersBindingForPropertyOfSubtype() { bindings.bind(QUser.user.as(QSpecialUser.class).specialProperty).first(ContainsBinding.INSTANCE); diff --git a/src/test/java/org/springframework/data/querydsl/binding/QuerydslDefaultBindingUnitTests.java b/src/test/java/org/springframework/data/querydsl/binding/QuerydslDefaultBindingUnitTests.java index 043f46977..1bd596411 100644 --- a/src/test/java/org/springframework/data/querydsl/binding/QuerydslDefaultBindingUnitTests.java +++ b/src/test/java/org/springframework/data/querydsl/binding/QuerydslDefaultBindingUnitTests.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. @@ -44,10 +44,7 @@ public class QuerydslDefaultBindingUnitTests { binding = new QuerydslDefaultBinding(); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void shouldCreatePredicateCorrectlyWhenPropertyIsInRoot() { Predicate predicate = binding.bind(QUser.user.firstname, Collections.singleton("tam")); @@ -55,10 +52,7 @@ public class QuerydslDefaultBindingUnitTests { assertPredicate(predicate, is(QUser.user.firstname.eq("tam"))); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void shouldCreatePredicateCorrectlyWhenPropertyIsInNestedElement() { Predicate predicate = binding.bind(QUser.user.address.city, Collections.singleton("two rivers")); @@ -66,10 +60,7 @@ public class QuerydslDefaultBindingUnitTests { Assert.assertThat(predicate.toString(), is(QUser.user.address.city.eq("two rivers").toString())); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void shouldCreatePredicateWithContainingWhenPropertyIsCollectionLikeAndValueIsObject() { Predicate predicate = binding.bind(QUser.user.nickNames, Collections.singleton("dragon reborn")); @@ -77,10 +68,7 @@ public class QuerydslDefaultBindingUnitTests { assertPredicate(predicate, is(QUser.user.nickNames.contains("dragon reborn"))); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void shouldCreatePredicateWithInWhenPropertyIsAnObjectAndValueIsACollection() { Predicate predicate = binding.bind(QUser.user.firstname, Arrays.asList("dragon reborn", "shadowkiller")); diff --git a/src/test/java/org/springframework/data/querydsl/binding/QuerydslPredicateBuilderUnitTests.java b/src/test/java/org/springframework/data/querydsl/binding/QuerydslPredicateBuilderUnitTests.java index 46098be98..48ad47fc4 100644 --- a/src/test/java/org/springframework/data/querydsl/binding/QuerydslPredicateBuilderUnitTests.java +++ b/src/test/java/org/springframework/data/querydsl/binding/QuerydslPredicateBuilderUnitTests.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. @@ -64,35 +64,23 @@ public class QuerydslPredicateBuilderUnitTests { this.values = new LinkedMultiValueMap(); } - /** - * @see DATACMNS-669 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-669 public void rejectsNullConversionService() { new QuerydslPredicateBuilder(null, SimpleEntityPathResolver.INSTANCE); } - /** - * @see DATACMNS-669 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-669 public void getPredicateShouldThrowErrorWhenBindingContextIsNull() { builder.getPredicate(null, values, null); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void getPredicateShouldReturnEmptyPredicateWhenPropertiesAreEmpty() { assertThat(builder.getPredicate(ClassTypeInformation.OBJECT, values, DEFAULT_BINDINGS), is(nullValue())); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void resolveArgumentShouldCreateSingleStringParameterPredicateCorrectly() throws Exception { values.add("firstname", "Oliver"); @@ -107,10 +95,7 @@ public class QuerydslPredicateBuilderUnitTests { assertThat(result, hasItem(Users.OLIVER)); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void resolveArgumentShouldCreateNestedStringParameterPredicateCorrectly() throws Exception { values.add("address.city", "Linz"); @@ -125,10 +110,7 @@ public class QuerydslPredicateBuilderUnitTests { assertThat(result, hasItem(Users.CHRISTOPH)); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void ignoresNonDomainTypeProperties() { values.add("firstname", "rand"); @@ -139,10 +121,7 @@ public class QuerydslPredicateBuilderUnitTests { assertThat(predicate, is((Predicate) QUser.user.firstname.eq("rand"))); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void forwardsNullForEmptyParameterToSingleValueBinder() { values.add("lastname", null); @@ -159,10 +138,7 @@ public class QuerydslPredicateBuilderUnitTests { builder.getPredicate(USER_TYPE, values, bindings); } - /** - * @see DATACMNS-734 - */ - @Test + @Test // DATACMNS-734 @SuppressWarnings("unchecked") public void resolvesCommaSeparatedArgumentToArrayCorrectly() { @@ -176,10 +152,7 @@ public class QuerydslPredicateBuilderUnitTests { assertThat((Double[]) (constant.getConstant()), arrayContaining(40.740337D, -73.995146D)); } - /** - * @see DATACMNS-734 - */ - @Test + @Test // DATACMNS-734 @SuppressWarnings("unchecked") public void leavesCommaSeparatedArgumentUntouchedWhenTargetIsNotAnArray() { @@ -193,10 +166,7 @@ public class QuerydslPredicateBuilderUnitTests { assertThat((String) (constant.getConstant()), equalTo("rivers,two")); } - /** - * @see DATACMNS-734 - */ - @Test + @Test // DATACMNS-734 public void bindsDateCorrectly() throws ParseException { DateTimeFormatter format = DateTimeFormat.forPattern("yyyy-MM-dd"); @@ -209,10 +179,7 @@ public class QuerydslPredicateBuilderUnitTests { assertThat(predicate, is((Predicate) QUser.user.dateOfBirth.eq(format.parseDateTime(date).toDate()))); } - /** - * @see DATACMNS-883 - */ - @Test + @Test // DATACMNS-883 public void automaticallyInsertsAnyStepInCollectionReference() { values.add("addresses.street", "VALUE"); @@ -222,10 +189,7 @@ public class QuerydslPredicateBuilderUnitTests { assertThat(predicate, is((Predicate) QUser.user.addresses.any().street.eq("VALUE"))); } - /** - * @see DATACMNS-941 - */ - @Test + @Test // DATACMNS-941 public void buildsPredicateForBindingUsingDowncast() { values.add("specialProperty", "VALUE"); @@ -239,10 +203,7 @@ public class QuerydslPredicateBuilderUnitTests { assertThat(predicate, is((Predicate) QUser.user.as(QSpecialUser.class).specialProperty.contains("VALUE"))); } - /** - * @see DATACMNS-941 - */ - @Test + @Test // DATACMNS-941 public void buildsPredicateForBindingUsingNestedDowncast() { values.add("user.specialProperty", "VALUE"); diff --git a/src/test/java/org/springframework/data/repository/cdi/CdiRepositoryBeanUnitTests.java b/src/test/java/org/springframework/data/repository/cdi/CdiRepositoryBeanUnitTests.java index 24c2b70a7..3b0f87929 100644 --- a/src/test/java/org/springframework/data/repository/cdi/CdiRepositoryBeanUnitTests.java +++ b/src/test/java/org/springframework/data/repository/cdi/CdiRepositoryBeanUnitTests.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. @@ -102,10 +102,7 @@ public class CdiRepositoryBeanUnitTests { assertThat(stereotypes, hasItem(StereotypeAnnotation.class)); } - /** - * @see DATACMNS-299 - */ - @Test + @Test // DATACMNS-299 @SuppressWarnings("rawtypes") public void scopeDefaultsToApplicationScoped() { @@ -114,10 +111,7 @@ public class CdiRepositoryBeanUnitTests { assertThat(bean.getScope(), equalTo((Class) ApplicationScoped.class)); } - /** - * @see DATACMNS-322 - */ - @Test + @Test // DATACMNS-322 public void createsPassivationId() { CdiRepositoryBean bean = new DummyCdiRepositoryBean(SINGLE_ANNOTATION, diff --git a/src/test/java/org/springframework/data/repository/cdi/CdiRepositoryExtensionSupportIntegrationTests.java b/src/test/java/org/springframework/data/repository/cdi/CdiRepositoryExtensionSupportIntegrationTests.java index feabed15f..defacfe20 100644 --- a/src/test/java/org/springframework/data/repository/cdi/CdiRepositoryExtensionSupportIntegrationTests.java +++ b/src/test/java/org/springframework/data/repository/cdi/CdiRepositoryExtensionSupportIntegrationTests.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. @@ -36,10 +36,7 @@ public abstract class CdiRepositoryExtensionSupportIntegrationTests { assertThat(client.repository, is(notNullValue())); } - /** - * @see DATACMNS-557 - */ - @Test + @Test // DATACMNS-557 public void createsSpringDataRepositoryWithCustimImplBean() { assertThat(getBean(AnotherRepository.class), is(notNullValue())); diff --git a/src/test/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSourceUnitTests.java b/src/test/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSourceUnitTests.java index 793a6a312..050bf1ced 100644 --- a/src/test/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSourceUnitTests.java +++ b/src/test/java/org/springframework/data/repository/config/AnnotationRepositoryConfigurationSourceUnitTests.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. @@ -56,20 +56,14 @@ public class AnnotationRepositoryConfigurationSourceUnitTests { environment); } - /** - * @see DATACMNS-47 - */ - @Test + @Test // DATACMNS-47 public void findsBasePackagesForClasses() { Iterable basePackages = source.getBasePackages(); assertThat(basePackages, hasItem(AnnotationRepositoryConfigurationSourceUnitTests.class.getPackage().getName())); } - /** - * @see DATACMNS-47 - */ - @Test + @Test // DATACMNS-47 public void evaluatesExcludeFiltersCorrectly() { Collection candidates = source.getCandidates(new DefaultResourceLoader()); @@ -79,10 +73,7 @@ public class AnnotationRepositoryConfigurationSourceUnitTests { assertThat(candidate.getBeanClassName(), is(MyRepository.class.getName())); } - /** - * @see DATACMNS-47 - */ - @Test + @Test // DATACMNS-47 public void defaultsToPackageOfAnnotatedClass() { AnnotationRepositoryConfigurationSource source = getConfigSource(DefaultConfiguration.class); @@ -92,10 +83,7 @@ public class AnnotationRepositoryConfigurationSourceUnitTests { assertThat(source.shouldConsiderNestedRepositories(), is(false)); } - /** - * @see DATACMNS-47 - */ - @Test + @Test // DATACMNS-47 public void returnsConfiguredBasePackage() { AnnotationRepositoryConfigurationSource source = getConfigSource(DefaultConfigurationWithBasePackage.class); @@ -104,30 +92,21 @@ public class AnnotationRepositoryConfigurationSourceUnitTests { assertThat(packages, hasItem("foo")); } - /** - * @see DATACMNS-90 - */ - @Test + @Test // DATACMNS-90 public void returnsConsiderNestedRepositories() { AnnotationRepositoryConfigurationSource source = getConfigSource(DefaultConfigurationWithNestedRepositories.class); assertThat(source.shouldConsiderNestedRepositories(), is(true)); } - /** - * @see DATACMNS-456 - */ - @Test + @Test // DATACMNS-456 public void findsStringAttributeByName() { RepositoryConfigurationSource source = getConfigSource(DefaultConfigurationWithBasePackage.class); assertThat(source.getAttribute("namedQueriesLocation"), is("bar")); } - /** - * @see DATACMNS-502 - */ - @Test + @Test // DATACMNS-502 public void returnsEmptyStringForBasePackage() throws Exception { StandardAnnotationMetadata metadata = new StandardAnnotationMetadata(getClass().getClassLoader().loadClass( @@ -138,20 +117,14 @@ public class AnnotationRepositoryConfigurationSourceUnitTests { assertThat(configurationSource.getBasePackages(), hasItem("")); } - /** - * @see DATACMNS-526 - */ - @Test + @Test // DATACMNS-526 public void detectsExplicitFilterConfiguration() { assertThat(getConfigSource(ConfigurationWithExplicitFilter.class).usesExplicitFilters(), is(true)); assertThat(getConfigSource(DefaultConfiguration.class).usesExplicitFilters(), is(false)); } - /** - * @see DATACMNS-542 - */ - @Test + @Test // DATACMNS-542 public void ignoresMissingRepositoryBaseClassNameAttribute() { AnnotationMetadata metadata = new StandardAnnotationMetadata(ConfigWithSampleAnnotation.class, true); diff --git a/src/test/java/org/springframework/data/repository/config/RepositoryBeanDefinitionRegistrarSupportIntegrationTests.java b/src/test/java/org/springframework/data/repository/config/RepositoryBeanDefinitionRegistrarSupportIntegrationTests.java index 92739218e..4a901e14a 100644 --- a/src/test/java/org/springframework/data/repository/config/RepositoryBeanDefinitionRegistrarSupportIntegrationTests.java +++ b/src/test/java/org/springframework/data/repository/config/RepositoryBeanDefinitionRegistrarSupportIntegrationTests.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. @@ -59,30 +59,21 @@ public class RepositoryBeanDefinitionRegistrarSupportIntegrationTests { } } - /** - * @see DATACMNS-47 - */ - @Test + @Test // DATACMNS-47 public void testBootstrappingWithInheritedConfigClasses() { assertThat(context.getBean(MyRepository.class), is(notNullValue())); assertThat(context.getBean(MyOtherRepository.class), is(notNullValue())); } - /** - * @see DATACMNS-47 - */ - @Test + @Test // DATACMNS-47 public void beanDefinitionSourceIsSetForJavaConfigScannedBeans() { BeanDefinition definition = context.getBeanDefinition("myRepository"); assertThat(definition.getSource(), is(notNullValue())); } - /** - * @see DATACMNS-544 - */ - @Test + @Test // DATACMNS-544 public void registersExtensionAsBeanDefinition() { assertThat(context.getBean(DummyConfigurationExtension.class), is(notNullValue())); } diff --git a/src/test/java/org/springframework/data/repository/config/RepositoryBeanDefinitionRegistrarSupportUnitTests.java b/src/test/java/org/springframework/data/repository/config/RepositoryBeanDefinitionRegistrarSupportUnitTests.java index 8e39c46a3..a96a7ab55 100644 --- a/src/test/java/org/springframework/data/repository/config/RepositoryBeanDefinitionRegistrarSupportUnitTests.java +++ b/src/test/java/org/springframework/data/repository/config/RepositoryBeanDefinitionRegistrarSupportUnitTests.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. @@ -66,10 +66,7 @@ public class RepositoryBeanDefinitionRegistrarSupportUnitTests { assertNoBeanDefinitionRegisteredFor("profileRepository"); } - /** - * @see DATACMNS-360 - */ - @Test + @Test // DATACMNS-360 public void registeredProfileRepositoriesIfProfileActivated() { StandardAnnotationMetadata metadata = new StandardAnnotationMetadata(SampleConfiguration.class, true); diff --git a/src/test/java/org/springframework/data/repository/config/RepositoryComponentProviderUnitTests.java b/src/test/java/org/springframework/data/repository/config/RepositoryComponentProviderUnitTests.java index 5ed65adb9..9bcdef1b2 100644 --- a/src/test/java/org/springframework/data/repository/config/RepositoryComponentProviderUnitTests.java +++ b/src/test/java/org/springframework/data/repository/config/RepositoryComponentProviderUnitTests.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. @@ -64,10 +64,7 @@ public class RepositoryComponentProviderUnitTests { assertThat(components, hasItem(BeanDefinitionOfTypeMatcher.beanDefinitionOfType(MyOtherRepository.class))); } - /** - * @DATACMNS-90 - */ - @Test + @Test // DATACMNS-90 public void shouldConsiderNestedRepositoryInterfacesIfEnabled() { RepositoryComponentProvider provider = new RepositoryComponentProvider(Collections. emptyList()); diff --git a/src/test/java/org/springframework/data/repository/config/RepositoryConfigurationDelegateUnitTests.java b/src/test/java/org/springframework/data/repository/config/RepositoryConfigurationDelegateUnitTests.java index 89fcabca8..26ea72dc7 100644 --- a/src/test/java/org/springframework/data/repository/config/RepositoryConfigurationDelegateUnitTests.java +++ b/src/test/java/org/springframework/data/repository/config/RepositoryConfigurationDelegateUnitTests.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. @@ -40,10 +40,7 @@ public class RepositoryConfigurationDelegateUnitTests { @Mock RepositoryConfigurationExtension extension; - /** - * @see DATACMNS-892 - */ - @Test + @Test // DATACMNS-892 public void registersRepositoryBeanNameAsAttribute() { StandardEnvironment environment = new StandardEnvironment(); diff --git a/src/test/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupportUnitTests.java b/src/test/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupportUnitTests.java index 4a92fe771..cc1dd137a 100644 --- a/src/test/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupportUnitTests.java +++ b/src/test/java/org/springframework/data/repository/config/RepositoryConfigurationExtensionSupportUnitTests.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. @@ -38,30 +38,21 @@ public class RepositoryConfigurationExtensionSupportUnitTests { RepositoryConfigurationExtensionSupport extension = new SampleRepositoryConfigurationExtension(); - /** - * @see DATACMNS-526 - */ - @Test + @Test // DATACMNS-526 public void doesNotConsiderRepositoryForPlainTypeStrictMatch() { RepositoryMetadata metadata = AbstractRepositoryMetadata.getMetadata(PlainTypeRepository.class); assertThat(extension.isStrictRepositoryCandidate(metadata), is(false)); } - /** - * @see DATACMNS-526 - */ - @Test + @Test // DATACMNS-526 public void considersRepositoryWithAnnotatedTypeStrictMatch() { RepositoryMetadata metadata = AbstractRepositoryMetadata.getMetadata(AnnotatedTypeRepository.class); assertThat(extension.isStrictRepositoryCandidate(metadata), is(true)); } - /** - * @see DATACMNS-526 - */ - @Test + @Test // DATACMNS-526 public void considersRepositoryInterfaceExtendingStoreInterfaceStrictMatch() { RepositoryMetadata metadata = AbstractRepositoryMetadata.getMetadata(ExtendingInterface.class); diff --git a/src/test/java/org/springframework/data/repository/config/ResourceReaderRepositoryPopulatorBeanDefinitionParserIntegrationTests.java b/src/test/java/org/springframework/data/repository/config/ResourceReaderRepositoryPopulatorBeanDefinitionParserIntegrationTests.java index 8323bb831..9f65ca477 100644 --- a/src/test/java/org/springframework/data/repository/config/ResourceReaderRepositoryPopulatorBeanDefinitionParserIntegrationTests.java +++ b/src/test/java/org/springframework/data/repository/config/ResourceReaderRepositoryPopulatorBeanDefinitionParserIntegrationTests.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. @@ -39,10 +39,7 @@ import org.springframework.test.util.ReflectionTestUtils; */ public class ResourceReaderRepositoryPopulatorBeanDefinitionParserIntegrationTests { - /** - * @see DATACMNS-333 - */ - @Test + @Test // DATACMNS-333 public void registersJackson2InitializerCorrectly() { DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory(); @@ -61,10 +58,7 @@ public class ResourceReaderRepositoryPopulatorBeanDefinitionParserIntegrationTes assertIsListOfClasspathResourcesWithPath(resources, "org/springframework/data/repository/init/data.json"); } - /** - * @see DATACMNS-58 - */ - @Test + @Test // DATACMNS-58 public void registersXmlInitializerCorrectly() { DefaultListableBeanFactory beanFactory = new DefaultListableBeanFactory(); diff --git a/src/test/java/org/springframework/data/repository/config/XmlRepositoryConfigurationSourceUnitTests.java b/src/test/java/org/springframework/data/repository/config/XmlRepositoryConfigurationSourceUnitTests.java index 1e0d6c441..2de2e1317 100644 --- a/src/test/java/org/springframework/data/repository/config/XmlRepositoryConfigurationSourceUnitTests.java +++ b/src/test/java/org/springframework/data/repository/config/XmlRepositoryConfigurationSourceUnitTests.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. @@ -37,10 +37,7 @@ public class XmlRepositoryConfigurationSourceUnitTests { @Mock Element element; - /** - * @see DATACMNS-456 - */ - @Test + @Test // DATACMNS-456 public void translatesCamelCaseAttributeNameIntoXmlEquivalent() { RepositoryConfigurationSource source = mock(XmlRepositoryConfigurationSource.class); diff --git a/src/test/java/org/springframework/data/repository/core/support/AbstractEntityInformationUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/AbstractEntityInformationUnitTests.java index 32c63597a..09a0cff78 100644 --- a/src/test/java/org/springframework/data/repository/core/support/AbstractEntityInformationUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/AbstractEntityInformationUnitTests.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. @@ -52,10 +52,7 @@ public class AbstractEntityInformationUnitTests { assertThat(metadata.isNew(new Object()), is(false)); } - /** - * @see DATACMNS-357 - */ - @Test + @Test // DATACMNS-357 public void detectsNewStateForPrimitiveIds() { FooEn fooEn = new FooEn(PrimitiveIdEntity.class); @@ -67,10 +64,7 @@ public class AbstractEntityInformationUnitTests { assertThat(fooEn.isNew(entity), is(false)); } - /** - * @see DATACMNS-357 - */ - @Test + @Test // DATACMNS-357 public void detectsNewStateForPrimitiveWrapperIds() { FooEn fooEn = new FooEn( @@ -83,10 +77,7 @@ public class AbstractEntityInformationUnitTests { assertThat(fooEn.isNew(entity), is(false)); } - /** - * @see DATACMNS-357 - */ - @Test + @Test // DATACMNS-357 public void rejectsUnsupportedPrimitiveIdType() { FooEn information = new FooEn( diff --git a/src/test/java/org/springframework/data/repository/core/support/AbstractRepositoryMetadataUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/AbstractRepositoryMetadataUnitTests.java index 5724edcf6..10e88b627 100644 --- a/src/test/java/org/springframework/data/repository/core/support/AbstractRepositoryMetadataUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/AbstractRepositoryMetadataUnitTests.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. @@ -40,10 +40,7 @@ import org.springframework.data.repository.core.RepositoryMetadata; */ public class AbstractRepositoryMetadataUnitTests { - /** - * @see DATACMNS-98 - */ - @Test + @Test // DATACMNS-98 public void discoversSimpleReturnTypeCorrectly() throws Exception { RepositoryMetadata metadata = new DummyRepositoryMetadata(UserRepository.class); @@ -51,20 +48,14 @@ public class AbstractRepositoryMetadataUnitTests { assertThat(metadata.getReturnedDomainClass(method), is(typeCompatibleWith(User.class))); } - /** - * @see DATACMNS-98 - */ - @Test + @Test // DATACMNS-98 public void resolvesTypeParameterReturnType() throws Exception { RepositoryMetadata metadata = new DummyRepositoryMetadata(ConcreteRepository.class); Method method = ConcreteRepository.class.getMethod("intermediateMethod"); assertThat(metadata.getReturnedDomainClass(method), is(typeCompatibleWith(User.class))); } - /** - * @see DATACMNS-98 - */ - @Test + @Test // DATACMNS-98 public void determinesReturnTypeFromPageable() throws Exception { RepositoryMetadata metadata = new DummyRepositoryMetadata(ExtendingRepository.class); @@ -72,40 +63,28 @@ public class AbstractRepositoryMetadataUnitTests { assertThat(metadata.getReturnedDomainClass(method), is(typeCompatibleWith(User.class))); } - /** - * @see DATACMNS-453 - */ - @Test + @Test // DATACMNS-453 public void nonPageableRepository() { RepositoryMetadata metadata = new DummyRepositoryMetadata(UserRepository.class); assertThat(metadata.isPagingRepository(), is(false)); } - /** - * @see DATACMNS-453 - */ - @Test + @Test // DATACMNS-453 public void pageableRepository() { RepositoryMetadata metadata = new DummyRepositoryMetadata(PagedRepository.class); assertThat(metadata.isPagingRepository(), is(true)); } - /** - * @see DATACMNS-98 - */ - @Test + @Test // DATACMNS-98 public void determinesReturnTypeFromGenericType() throws Exception { RepositoryMetadata metadata = new DummyRepositoryMetadata(ExtendingRepository.class); Method method = ExtendingRepository.class.getMethod("someMethod"); assertThat(metadata.getReturnedDomainClass(method), is(typeCompatibleWith(GenericType.class))); } - /** - * @see DATACMNS-98 - */ - @Test + @Test // DATACMNS-98 public void handlesGenericTypeInReturnedCollectionCorrectly() throws SecurityException, NoSuchMethodException { RepositoryMetadata metadata = new DummyRepositoryMetadata(ExtendingRepository.class); @@ -113,10 +92,7 @@ public class AbstractRepositoryMetadataUnitTests { assertThat(metadata.getReturnedDomainClass(method), is(typeCompatibleWith(Map.class))); } - /** - * @see DATACMNS-471 - */ - @Test + @Test // DATACMNS-471 public void detectsArrayReturnTypeCorrectly() throws Exception { RepositoryMetadata metadata = new DefaultRepositoryMetadata(PagedRepository.class); diff --git a/src/test/java/org/springframework/data/repository/core/support/DefaultCrudMethodsUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/DefaultCrudMethodsUnitTests.java index 1e0ce85fd..f3958dd8a 100644 --- a/src/test/java/org/springframework/data/repository/core/support/DefaultCrudMethodsUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/DefaultCrudMethodsUnitTests.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. @@ -69,10 +69,7 @@ public class DefaultCrudMethodsUnitTests { assertSaveMethodPresent(type, false); } - /** - * @see DATACMNS-393 - */ - @Test + @Test // DATACMNS-393 public void selectsFindAllWithSortParameterOnRepositoryAmongUnsuitableAlternatives() throws Exception { Class type = RepositoryWithInvalidPagingFallbackToSortFindAll.class; @@ -98,10 +95,7 @@ public class DefaultCrudMethodsUnitTests { assertFindAllMethodOn(type, null); } - /** - * @see DATACMNS-393 - */ - @Test + @Test // DATACMNS-393 public void detectsOverloadedMethodsCorrectly() throws Exception { Class type = RepositoryWithAllCrudMethodOverloaded.class; @@ -111,10 +105,7 @@ public class DefaultCrudMethodsUnitTests { assertFindAllMethodOn(type, type.getDeclaredMethod("findAll")); } - /** - * @see DATACMNS-393 - */ - @Test + @Test // DATACMNS-393 public void ignoresWrongOverloadedMethods() throws Exception { Class type = RepositoryWithAllCrudMethodOverloadedWrong.class; @@ -124,28 +115,19 @@ public class DefaultCrudMethodsUnitTests { assertFindAllMethodOn(type, CrudRepository.class.getDeclaredMethod("findAll")); } - /** - * @see DATACMNS-464 - */ - @Test + @Test // DATACMNS-464 public void detectsCustomSaveMethod() throws Exception { assertSaveMethodOn(RepositoryWithCustomSave.class, RepositoryWithCustomSave.class.getMethod("save", Domain.class)); } - /** - * @see DATACMNS-539 - */ - @Test + @Test // DATACMNS-539 public void detectsOverriddenDeleteMethodForEntity() throws Exception { assertDeleteMethodOn(RepositoryWithDeleteMethodForEntityOverloaded.class, RepositoryWithDeleteMethodForEntityOverloaded.class.getMethod("delete", Domain.class)); } - /** - * @see DATACMNS-619 - */ - @Test + @Test // DATACMNS-619 public void exposedMethodsAreAccessible() { CrudMethods methods = getMethodsFor(RepositoryWithAllCrudMethodOverloaded.class); @@ -223,9 +205,7 @@ public class DefaultCrudMethodsUnitTests { Iterable findAll(Pageable pageable); } - /** - * @see DATACMNS-393 - */ + // DATACMNS-393 interface RepositoryWithCustomSortingFindAll extends Repository { Iterable findAll(Sort sort); @@ -236,9 +216,7 @@ public class DefaultCrudMethodsUnitTests { Iterable findAll(Object pageable); } - /** - * @see DATACMNS-393 - */ + // DATACMNS-393 interface RepositoryWithInvalidPagingFallbackToSortFindAll extends Repository { Iterable findAll(Object pageable); @@ -251,9 +229,7 @@ public class DefaultCrudMethodsUnitTests { void delete(Iterable entities); } - /** - * @see DATACMNS-393 - */ + // DATACMNS-393 interface RepositoryWithAllCrudMethodOverloaded extends CrudRepository { List findAll(); @@ -265,9 +241,7 @@ public class DefaultCrudMethodsUnitTests { Domain findOne(Long id); } - /** - * @see DATACMNS-393 - */ + // DATACMNS-393 interface RepositoryWithAllCrudMethodOverloadedWrong extends CrudRepository { List findAll(String s); @@ -279,9 +253,7 @@ public class DefaultCrudMethodsUnitTests { Domain findOne(Domain o); } - /** - * @see DATACMNS-539 - */ + // DATACMNS-539 interface RepositoryWithDeleteMethodForEntityOverloaded extends CrudRepository { void delete(Domain entity); diff --git a/src/test/java/org/springframework/data/repository/core/support/DefaultRepositoryInformationUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/DefaultRepositoryInformationUnitTests.java index 28b3ae72d..09743eb25 100644 --- a/src/test/java/org/springframework/data/repository/core/support/DefaultRepositoryInformationUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/DefaultRepositoryInformationUnitTests.java @@ -123,10 +123,7 @@ public class DefaultRepositoryInformationUnitTests { assertThat(information.getQueryMethods(), is(empty)); } - /** - * @see DATACMNS-151 - */ - @Test + @Test // DATACMNS-151 public void doesNotConsiderManuallyDefinedSaveMethodAQueryMethod() { RepositoryMetadata metadata = new DefaultRepositoryMetadata(CustomRepository.class); @@ -135,10 +132,7 @@ public class DefaultRepositoryInformationUnitTests { assertThat(information.getQueryMethods(), is(IsEmptyIterable. emptyIterable())); } - /** - * @see DATACMNS-151 - */ - @Test + @Test // DATACMNS-151 public void doesNotConsiderRedeclaredSaveMethodAQueryMethod() throws Exception { RepositoryMetadata metadata = new DefaultRepositoryMetadata(ConcreteRepository.class); @@ -168,10 +162,7 @@ public class DefaultRepositoryInformationUnitTests { assertThat(queryMethods, not(hasItem(intermediateMethod))); } - /** - * @see DATACMNS-193 - */ - @Test + @Test // DATACMNS-193 public void detectsQueryMethodCorrectly() { RepositoryMetadata metadata = new DefaultRepositoryMetadata(ConcreteRepository.class); @@ -183,10 +174,7 @@ public class DefaultRepositoryInformationUnitTests { assertThat(information.isQueryMethod(queryMethod), is(true)); } - /** - * @see DATACMNS-364 - */ - @Test + @Test // DATACMNS-364 public void ignoresCrudMethodsAnnotatedWithQuery() throws Exception { RepositoryMetadata metadata = new DefaultRepositoryMetadata(ConcreteRepository.class); @@ -197,10 +185,7 @@ public class DefaultRepositoryInformationUnitTests { assertThat(information.getQueryMethods(), hasItem(method)); } - /** - * @see DATACMNS-385 - */ - @Test + @Test // DATACMNS-385 public void findsTargetSaveForIterableIfEntityImplementsIterable() throws Exception { RepositoryMetadata metadata = new DefaultRepositoryMetadata(BossRepository.class); @@ -212,10 +197,7 @@ public class DefaultRepositoryInformationUnitTests { assertThat(information.getTargetClassMethod(method), is(reference)); } - /** - * @see DATACMNS-441 - */ - @Test + @Test // DATACMNS-441 public void getQueryShouldNotReturnAnyBridgeMethods() { RepositoryMetadata metadata = new DefaultRepositoryMetadata(CustomDefaultRepositoryMethodsRepository.class); @@ -226,10 +208,7 @@ public class DefaultRepositoryInformationUnitTests { } } - /** - * @see DATACMNS-854 - */ - @Test + @Test // DATACMNS-854 public void discoversCustomlyImplementedCrudMethodWithGenerics() throws SecurityException, NoSuchMethodException { RepositoryMetadata metadata = new DefaultRepositoryMetadata(FooRepository.class); @@ -242,10 +221,7 @@ public class DefaultRepositoryInformationUnitTests { assertThat(information.getTargetClassMethod(source), is(expected)); } - /** - * @see DATACMNS-912 - */ - @Test + @Test // DATACMNS-912 public void discoversCustomlyImplementedCrudMethodWithGenericParameters() throws Exception { SampleRepositoryImpl customImplementation = new SampleRepositoryImpl(); @@ -257,11 +233,7 @@ public class DefaultRepositoryInformationUnitTests { assertThat(information.isCustomMethod(customBaseRepositoryMethod), is(true)); } - /** - * @see DATACMNS-939 - * @throws Exception - */ - @Test + @Test // DATACMNS-939 public void ignoresStaticMethod() throws SecurityException, NoSuchMethodException { RepositoryMetadata metadata = new DefaultRepositoryMetadata(FooRepository.class); @@ -273,10 +245,7 @@ public class DefaultRepositoryInformationUnitTests { assertThat(information.getQueryMethods(), not(hasItem(method))); } - /** - * @see DATACMNS-939 - */ - @Test + @Test // DATACMNS-939 public void ignoresDefaultMethod() throws SecurityException, NoSuchMethodException { RepositoryMetadata metadata = new DefaultRepositoryMetadata(FooRepository.class); @@ -288,11 +257,7 @@ public class DefaultRepositoryInformationUnitTests { assertThat(information.getQueryMethods(), not(hasItem(method))); } - /** - * @see DATACMNS-943 - * @throws Exception - */ - @Test + @Test // DATACMNS-943 public void usesCorrectSaveOverload() throws Exception { RepositoryMetadata metadata = new DefaultRepositoryMetadata(DummyRepository.class); diff --git a/src/test/java/org/springframework/data/repository/core/support/DefaultRepositoryMetadataUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/DefaultRepositoryMetadataUnitTests.java index e66ee182b..d70569087 100644 --- a/src/test/java/org/springframework/data/repository/core/support/DefaultRepositoryMetadataUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/DefaultRepositoryMetadataUnitTests.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. @@ -56,10 +56,7 @@ public class DefaultRepositoryMetadataUnitTests { new DefaultRepositoryMetadata(Collection.class); } - /** - * @see DATACMNS-406 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-406 public void rejectsUnparameterizedRepositoryInterface() { new DefaultRepositoryMetadata(Repository.class); } @@ -95,20 +92,14 @@ public class DefaultRepositoryMetadataUnitTests { assertEquals(Integer.class, metadata.getIdType()); } - /** - * @see DATACMNS-442 - */ - @Test + @Test // DATACMNS-442 public void detectsIdTypeOnIntermediateRepository() { RepositoryMetadata metadata = new DefaultRepositoryMetadata(ConcreteRepository.class); assertEquals(Long.class, metadata.getIdType()); } - /** - * @see DATACMNS-483 - */ - @Test + @Test // DATACMNS-483 public void discoversDomainTypeOnReturnTypeWrapper() throws Exception { RepositoryMetadata metadata = new DefaultRepositoryMetadata(OptionalRepository.class); @@ -117,10 +108,7 @@ public class DefaultRepositoryMetadataUnitTests { assertThat(metadata.getReturnedDomainClass(method), is(typeCompatibleWith(User.class))); } - /** - * @see DATACMNS-483 - */ - @Test + @Test // DATACMNS-483 public void discoversDomainTypeOnNestedReturnTypeWrapper() throws Exception { RepositoryMetadata metadata = new DefaultRepositoryMetadata(OptionalRepository.class); @@ -129,10 +117,7 @@ public class DefaultRepositoryMetadataUnitTests { assertThat(metadata.getReturnedDomainClass(method), is(typeCompatibleWith(User.class))); } - /** - * @see DATACMNS-501 - */ - @Test + @Test // DATACMNS-501 public void discoversDomainAndIdTypeForIntermediateRepository() { RepositoryMetadata metadata = new DefaultRepositoryMetadata(IdTypeFixingRepository.class); diff --git a/src/test/java/org/springframework/data/repository/core/support/EventPublishingRepositoryProxyPostProcessorUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/EventPublishingRepositoryProxyPostProcessorUnitTests.java index a4953a65b..1f63c6996 100644 --- a/src/test/java/org/springframework/data/repository/core/support/EventPublishingRepositoryProxyPostProcessorUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/EventPublishingRepositoryProxyPostProcessorUnitTests.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. @@ -55,26 +55,17 @@ public class EventPublishingRepositoryProxyPostProcessorUnitTests { @Mock ApplicationEventPublisher publisher; @Mock MethodInvocation invocation; - /** - * @see DATACMNS-928 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-928 public void rejectsNullAggregateTypes() { EventPublishingMethod.of(null); } - /** - * @see DATACMNS-928 - */ - @Test + @Test // DATACMNS-928 public void publishingEventsForNullIsNoOp() { EventPublishingMethod.of(OneEvent.class).publishEventsFrom(null, publisher); } - /** - * @see DATACMNS-928 - */ - @Test + @Test // DATACMNS-928 public void exposesEventsExposedByEntityToPublisher() { SomeEvent first = new SomeEvent(); @@ -87,10 +78,7 @@ public class EventPublishingRepositoryProxyPostProcessorUnitTests { verify(publisher).publishEvent(eq(second)); } - /** - * @see DATACMNS-928 - */ - @Test + @Test // DATACMNS-928 public void exposesSingleEventByEntityToPublisher() { SomeEvent event = new SomeEvent(); @@ -101,10 +89,7 @@ public class EventPublishingRepositoryProxyPostProcessorUnitTests { verify(publisher, times(1)).publishEvent(event); } - /** - * @see DATACMNS-928 - */ - @Test + @Test // DATACMNS-928 public void doesNotExposeNullEvent() { OneEvent entity = OneEvent.of(null); @@ -114,18 +99,12 @@ public class EventPublishingRepositoryProxyPostProcessorUnitTests { verify(publisher, times(0)).publishEvent(any()); } - /** - * @see DATACMNS-928 - */ - @Test + @Test // DATACMNS-928 public void doesNotCreatePublishingMethodIfNoAnnotationDetected() { assertThat(EventPublishingMethod.of(Object.class), is(nullValue())); } - /** - * @see DATACMNS-928 - */ - @Test + @Test // DATACMNS-928 public void interceptsSaveMethod() throws Throwable { doReturn(SampleRepository.class.getMethod("save", Object.class)).when(invocation).getMethod(); @@ -141,10 +120,7 @@ public class EventPublishingRepositoryProxyPostProcessorUnitTests { verify(publisher).publishEvent(event); } - /** - * @see DATACMNS-928 - */ - @Test + @Test // DATACMNS-928 public void doesNotInterceptNonSaveMethod() throws Throwable { doReturn(SampleRepository.class.getMethod("findOne", Serializable.class)).when(invocation).getMethod(); @@ -156,10 +132,7 @@ public class EventPublishingRepositoryProxyPostProcessorUnitTests { verify(publisher, never()).publishEvent(any()); } - /** - * @see DATACMNS-928 - */ - @Test + @Test // DATACMNS-928 public void registersAdviceIfDomainTypeExposesEvents() { RepositoryInformation information = new DummyRepositoryInformation(SampleRepository.class); @@ -172,10 +145,7 @@ public class EventPublishingRepositoryProxyPostProcessorUnitTests { verify(factory).addAdvice(any(EventPublishingMethodInterceptor.class)); } - /** - * @see DATACMNS-928 - */ - @Test + @Test // DATACMNS-928 public void doesNotAddAdviceIfDomainTypeDoesNotExposeEvents() { RepositoryInformation information = new DummyRepositoryInformation(CrudRepository.class); @@ -188,10 +158,7 @@ public class EventPublishingRepositoryProxyPostProcessorUnitTests { verify(factory, never()).addAdvice(any(Advice.class)); } - /** - * @see DATACMNS-928 - */ - @Test + @Test // DATACMNS-928 public void publishesEventsForCallToSaveWithIterable() throws Throwable { SomeEvent event = new SomeEvent(); diff --git a/src/test/java/org/springframework/data/repository/core/support/ExampleSpecificationAccessorUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/ExampleSpecificationAccessorUnitTests.java index 44625a83c..17c4f951f 100644 --- a/src/test/java/org/springframework/data/repository/core/support/ExampleSpecificationAccessorUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/ExampleSpecificationAccessorUnitTests.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. @@ -54,18 +54,12 @@ public class ExampleSpecificationAccessorUnitTests { exampleSpecificationAccessor = new ExampleMatcherAccessor(specification); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void defaultStringMatcherShouldReturnDefault() { assertThat(exampleSpecificationAccessor.getDefaultStringMatcher(), is(StringMatcher.DEFAULT)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void nullHandlerShouldReturnInclude() { specification = ExampleMatcher.matching().// @@ -75,10 +69,7 @@ public class ExampleSpecificationAccessorUnitTests { assertThat(exampleSpecificationAccessor.getNullHandler(), is(NullHandler.INCLUDE)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void exampleShouldIgnorePaths() { specification = ExampleMatcher.matching().withIgnorePaths("firstname"); @@ -88,19 +79,13 @@ public class ExampleSpecificationAccessorUnitTests { assertThat(exampleSpecificationAccessor.isIgnoredPath("lastname"), is(false)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void exampleShouldUseDefaultStringMatcherForPathThatDoesNotHavePropertySpecifier() { assertThat(exampleSpecificationAccessor.getStringMatcherForPath("firstname"), is(specification.getDefaultStringMatcher())); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void exampleShouldUseConfiguredStringMatcherAsDefaultForPathThatDoesNotHavePropertySpecifier() { specification = ExampleMatcher.matching().// @@ -111,10 +96,7 @@ public class ExampleSpecificationAccessorUnitTests { assertThat(exampleSpecificationAccessor.getStringMatcherForPath("firstname"), is(StringMatcher.CONTAINING)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void exampleShouldUseDefaultIgnoreCaseForPathThatDoesHavePropertySpecifierWithMatcher() { specification = ExampleMatcher.matching().// @@ -126,10 +108,7 @@ public class ExampleSpecificationAccessorUnitTests { assertThat(exampleSpecificationAccessor.isIgnoreCaseForPath("firstname"), is(true)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void exampleShouldUseConfiguredIgnoreCaseForPathThatDoesHavePropertySpecifierWithMatcher() { specification = ExampleMatcher.matching().// @@ -141,10 +120,7 @@ public class ExampleSpecificationAccessorUnitTests { assertThat(exampleSpecificationAccessor.isIgnoreCaseForPath("firstname"), equalTo(false)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void exampleShouldUseDefinedStringMatcherForPathThatDoesHavePropertySpecifierWithStringMatcherStarting() { specification = ExampleMatcher.matching().// @@ -155,10 +131,7 @@ public class ExampleSpecificationAccessorUnitTests { assertThat(exampleSpecificationAccessor.getStringMatcherForPath("firstname"), equalTo(StringMatcher.STARTING)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void exampleShouldUseDefinedStringMatcherForPathThatDoesHavePropertySpecifierWithStringMatcherContaining() { specification = ExampleMatcher.matching().// @@ -169,10 +142,7 @@ public class ExampleSpecificationAccessorUnitTests { assertThat(exampleSpecificationAccessor.getStringMatcherForPath("firstname"), equalTo(StringMatcher.CONTAINING)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void exampleShouldUseDefinedStringMatcherForPathThatDoesHavePropertySpecifierWithStringMatcherRegex() { specification = ExampleMatcher.matching().// @@ -183,10 +153,7 @@ public class ExampleSpecificationAccessorUnitTests { assertThat(exampleSpecificationAccessor.getStringMatcherForPath("firstname"), equalTo(StringMatcher.REGEX)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void exampleShouldFavorStringMatcherDefinedForPathOverConfiguredDefaultStringMatcher() { specification = ExampleMatcher.matching().withStringMatcher(StringMatcher.ENDING) @@ -206,10 +173,7 @@ public class ExampleSpecificationAccessorUnitTests { assertThat(exampleSpecificationAccessor.getStringMatcherForPath("unknownProperty"), equalTo(StringMatcher.ENDING)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void exampleShouldUseDefaultStringMatcherForPathThatHasPropertySpecifierWithoutStringMatcher() { specification = ExampleMatcher.matching().// @@ -228,20 +192,14 @@ public class ExampleSpecificationAccessorUnitTests { assertThat(exampleSpecificationAccessor.isIgnoreCaseForPath("unknownProperty"), is(false)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void ignoreCaseShouldReturnFalseByDefault() { assertThat(specification.isIgnoreCaseEnabled(), is(false)); assertThat(exampleSpecificationAccessor.isIgnoreCaseForPath("firstname"), is(false)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void ignoreCaseShouldReturnTrueWhenIgnoreCaseIsEnabled() { specification = ExampleMatcher.matching().// @@ -253,10 +211,7 @@ public class ExampleSpecificationAccessorUnitTests { assertThat(exampleSpecificationAccessor.isIgnoreCaseForPath("firstname"), is(true)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void ignoreCaseShouldFavorPathSpecificSettings() { specification = ExampleMatcher.matching().// @@ -268,19 +223,13 @@ public class ExampleSpecificationAccessorUnitTests { assertThat(exampleSpecificationAccessor.isIgnoreCaseForPath("firstname"), is(true)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void getValueTransformerForPathReturnsNoOpValueTransformerByDefault() { assertThat(exampleSpecificationAccessor.getValueTransformerForPath("firstname"), instanceOf(NoOpPropertyValueTransformer.class)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void getValueTransformerForPathReturnsConfigurtedTransformerForPath() { PropertyValueTransformer transformer = new PropertyValueTransformer() { @@ -298,18 +247,12 @@ public class ExampleSpecificationAccessorUnitTests { assertThat(exampleSpecificationAccessor.getValueTransformerForPath("firstname"), equalTo(transformer)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void hasPropertySpecifiersReturnsFalseIfNoneDefined() { assertThat(exampleSpecificationAccessor.hasPropertySpecifiers(), is(false)); } - /** - * @see DATACMNS-810 - */ - @Test + @Test // DATACMNS-810 public void hasPropertySpecifiersReturnsTrueWhenAtLeastOneIsSet() { specification = ExampleMatcher.matching().// @@ -321,10 +264,7 @@ public class ExampleSpecificationAccessorUnitTests { assertThat(exampleSpecificationAccessor.hasPropertySpecifiers(), is(true)); } - /** - * @see DATACMNS-953 - */ - @Test + @Test // DATACMNS-953 public void exactMatcherUsesExactMatching() { ExampleMatcher matcher = ExampleMatcher.matching()// diff --git a/src/test/java/org/springframework/data/repository/core/support/PersistenceExceptionTranslationRepositoryProxyPostProcessorUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/PersistenceExceptionTranslationRepositoryProxyPostProcessorUnitTests.java index c6e8e810e..ca051127e 100644 --- a/src/test/java/org/springframework/data/repository/core/support/PersistenceExceptionTranslationRepositoryProxyPostProcessorUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/PersistenceExceptionTranslationRepositoryProxyPostProcessorUnitTests.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. You may obtain a copy of @@ -52,19 +52,13 @@ public class PersistenceExceptionTranslationRepositoryProxyPostProcessorUnitTest beans); } - /** - * @see DATACMNS-318 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-318 public void rejectsNullBeanFactory() throws Exception { new PersistenceExceptionTranslationRepositoryProxyPostProcessor(null); } - /** - * @see DATACMNS-318 - */ - @Test + @Test // DATACMNS-318 public void setsUpBasicInstance() throws Exception { RepositoryProxyPostProcessor postProcessor = new PersistenceExceptionTranslationRepositoryProxyPostProcessor( diff --git a/src/test/java/org/springframework/data/repository/core/support/PersistentEntityInformationUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/PersistentEntityInformationUnitTests.java index 443a31a45..ab35b0003 100644 --- a/src/test/java/org/springframework/data/repository/core/support/PersistentEntityInformationUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/PersistentEntityInformationUnitTests.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. @@ -34,10 +34,7 @@ import org.springframework.data.repository.core.EntityInformation; */ public class PersistentEntityInformationUnitTests { - /** - * @see DATACMNS-480 - */ - @Test + @Test // DATACMNS-480 public void obtainsIdAndIdTypeInformationFromPersistentEntity() { SampleMappingContext context = new SampleMappingContext(); @@ -52,10 +49,7 @@ public class PersistentEntityInformationUnitTests { assertThat(information.getId(sample), is(5L)); } - /** - * @see DATACMNS-596 - */ - @Test + @Test // DATACMNS-596 public void returnsNullIfNoIdPropertyPresent() { SampleMappingContext context = new SampleMappingContext(); diff --git a/src/test/java/org/springframework/data/repository/core/support/QueryExecutionResultHandlerUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/QueryExecutionResultHandlerUnitTests.java index ef80e2247..e041400bb 100644 --- a/src/test/java/org/springframework/data/repository/core/support/QueryExecutionResultHandlerUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/QueryExecutionResultHandlerUnitTests.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. @@ -48,10 +48,7 @@ public class QueryExecutionResultHandlerUnitTests { QueryExecutionResultHandler handler = new QueryExecutionResultHandler(); - /** - * @see DATACMNS-610 - */ - @Test + @Test // DATACMNS-610 public void convertsListsToSet() throws Exception { TypeDescriptor descriptor = getTypeDescriptorFor("set"); @@ -60,20 +57,14 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(handler.postProcessInvocationResult(source, descriptor), is(instanceOf(Set.class))); } - /** - * @see DATACMNS-483 - */ - @Test + @Test // DATACMNS-483 public void turnsNullIntoJdk8Optional() throws Exception { Object result = handler.postProcessInvocationResult(null, getTypeDescriptorFor("jdk8Optional")); assertThat(result, is((Object) Optional.empty())); } - /** - * @see DATACMNS-483 - */ - @Test + @Test // DATACMNS-483 @SuppressWarnings("unchecked") public void wrapsValueIntoJdk8Optional() throws Exception { @@ -86,20 +77,14 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(optional, is(Optional.of(entity))); } - /** - * @see DATACMNS-483 - */ - @Test + @Test // DATACMNS-483 public void turnsNullIntoGuavaOptional() throws Exception { Object result = handler.postProcessInvocationResult(null, getTypeDescriptorFor("guavaOptional")); assertThat(result, is((Object) com.google.common.base.Optional.absent())); } - /** - * @see DATACMNS-483 - */ - @Test + @Test // DATACMNS-483 @SuppressWarnings("unchecked") public void wrapsValueIntoGuavaOptional() throws Exception { @@ -112,18 +97,12 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(optional, is(com.google.common.base.Optional.of(entity))); } - /** - * @see DATACMNS-917 - */ - @Test + @Test // DATACMNS-917 public void defaultsNullToEmptyMap() throws Exception { assertThat(handler.postProcessInvocationResult(null, getTypeDescriptorFor("map")), is(instanceOf(Map.class))); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsRxJavaSingleIntoPublisher() throws Exception { @@ -136,10 +115,7 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(mono.block(), is(entity.toBlocking().value())); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsRxJavaSingleIntoMono() throws Exception { @@ -152,10 +128,7 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(mono.block(), is(entity.toBlocking().value())); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsRxJavaSingleIntoFlux() throws Exception { @@ -168,10 +141,7 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(flux.next().block(), is(entity.toBlocking().value())); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsRxJavaObservableIntoPublisher() throws Exception { @@ -184,10 +154,7 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(mono.block(), is(entity.toBlocking().first())); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsRxJavaObservableIntoMono() throws Exception { @@ -200,10 +167,7 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(mono.block(), is(entity.toBlocking().first())); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsRxJavaObservableIntoFlux() throws Exception { @@ -216,10 +180,7 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(flux.next().block(), is(entity.toBlocking().first())); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsRxJavaObservableIntoSingle() throws Exception { @@ -232,10 +193,7 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(single.toBlocking().value(), is(entity.toBlocking().first())); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsRxJavaSingleIntoObservable() throws Exception { @@ -248,10 +206,7 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(observable.toBlocking().first(), is(entity.toBlocking().value())); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsReactorMonoIntoSingle() throws Exception { @@ -264,10 +219,7 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(single.toBlocking().value(), is(entity.block())); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsReactorMonoIntoCompletable() throws Exception { @@ -280,10 +232,7 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(completable.get(), is(nullValue())); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsReactorMonoIntoCompletableWithException() throws Exception { @@ -296,10 +245,7 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(completable.get(), is(instanceOf(InvalidDataAccessApiUsageException.class))); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsRxJavaCompletableIntoMono() throws Exception { @@ -312,10 +258,7 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(mono.block(), is(nullValue())); } - /** - * @see DATACMNS-836 - */ - @Test(expected = InvalidDataAccessApiUsageException.class) + @Test(expected = InvalidDataAccessApiUsageException.class) // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsRxJavaCompletableIntoMonoWithException() throws Exception { @@ -329,10 +272,7 @@ public class QueryExecutionResultHandlerUnitTests { fail("Missing InvalidDataAccessApiUsageException"); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsReactorMonoIntoObservable() throws Exception { @@ -345,10 +285,7 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(observable.toBlocking().first(), is(entity.block())); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsReactorFluxIntoSingle() throws Exception { @@ -361,10 +298,7 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(single.toBlocking().value(), is(entity.next().block())); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsReactorFluxIntoObservable() throws Exception { @@ -377,10 +311,7 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(observable.toBlocking().first(), is(entity.next().block())); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsReactorFluxIntoMono() throws Exception { @@ -393,10 +324,7 @@ public class QueryExecutionResultHandlerUnitTests { assertThat(mono.block(), is(entity.next().block())); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void convertsReactorMonoIntoFlux() throws Exception { diff --git a/src/test/java/org/springframework/data/repository/core/support/ReactiveRepositoryInformationUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/ReactiveRepositoryInformationUnitTests.java index 1483d36dc..c5dcceaca 100644 --- a/src/test/java/org/springframework/data/repository/core/support/ReactiveRepositoryInformationUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/ReactiveRepositoryInformationUnitTests.java @@ -43,10 +43,7 @@ public class ReactiveRepositoryInformationUnitTests { static final Class REPOSITORY = ReactiveJavaInterfaceWithGenerics.class; - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void discoversMethodWithoutComparingReturnType() throws Exception { Method method = RxJava1InterfaceWithGenerics.class.getMethod("deleteAll"); @@ -58,10 +55,7 @@ public class ReactiveRepositoryInformationUnitTests { assertThat(reference.getName(), is("deleteAll")); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void discoversMethodWithConvertibleArguments() throws Exception { Method method = RxJava1InterfaceWithGenerics.class.getMethod("save", Observable.class); @@ -74,10 +68,7 @@ public class ReactiveRepositoryInformationUnitTests { assertThat(reference.getParameterTypes()[0], is(equalTo(Publisher.class))); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void discoversMethodAssignableArguments() throws Exception { Method method = ReactiveSortingRepository.class.getMethod("save", Publisher.class); @@ -90,10 +81,7 @@ public class ReactiveRepositoryInformationUnitTests { assertThat(reference.getParameterTypes()[0], is(equalTo(Publisher.class))); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void discoversMethodExactIterableArguments() throws Exception { Method method = ReactiveJavaInterfaceWithGenerics.class.getMethod("save", Iterable.class); @@ -106,10 +94,7 @@ public class ReactiveRepositoryInformationUnitTests { assertThat(reference.getParameterTypes()[0], is(equalTo(Iterable.class))); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void discoversMethodExactObjectArguments() throws Exception { Method method = ReactiveJavaInterfaceWithGenerics.class.getMethod("save", Object.class); diff --git a/src/test/java/org/springframework/data/repository/core/support/ReactiveWrapperRepositoryFactorySupportUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/ReactiveWrapperRepositoryFactorySupportUnitTests.java index 2fc05c7ad..c5304c121 100644 --- a/src/test/java/org/springframework/data/repository/core/support/ReactiveWrapperRepositoryFactorySupportUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/ReactiveWrapperRepositoryFactorySupportUnitTests.java @@ -53,10 +53,7 @@ public class ReactiveWrapperRepositoryFactorySupportUnitTests { factory = new DummyRepositoryFactory(backingRepo); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void invokesCustomMethodIfItRedeclaresACRUDOne() { ObjectRepository repository = factory.getRepository(ObjectRepository.class, customImplementation); @@ -66,10 +63,7 @@ public class ReactiveWrapperRepositoryFactorySupportUnitTests { verify(backingRepo, times(0)).findOne(1); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void callsMethodOnBaseImplementationWithExactArguments() { Serializable id = 1L; @@ -79,10 +73,7 @@ public class ReactiveWrapperRepositoryFactorySupportUnitTests { verify(backingRepo, times(1)).exists(id); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void doesNotCallMethodOnBaseEvenIfDeclaredTypeCouldBeConverted() { Long id = 1L; @@ -92,10 +83,7 @@ public class ReactiveWrapperRepositoryFactorySupportUnitTests { verifyZeroInteractions(backingRepo); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void callsMethodOnBaseImplementationWithTypeConversion() { diff --git a/src/test/java/org/springframework/data/repository/core/support/ReflectionEntityInformationUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/ReflectionEntityInformationUnitTests.java index 7b3fb557c..831466c99 100644 --- a/src/test/java/org/springframework/data/repository/core/support/ReflectionEntityInformationUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/ReflectionEntityInformationUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012-2013 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 @@ -40,18 +40,12 @@ public class ReflectionEntityInformationUnitTests { assertThat(information.getIdType(), is(typeCompatibleWith(String.class))); } - /** - * @see DATACMNS-170 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-170 public void rejectsTypeWithoutAnnotatedField() { getEntityInformation(Unannotated.class); } - /** - * @see DATACMNS-357 - */ - @Test + @Test // DATACMNS-357 public void detectsNewStateForEntitiesWithPrimitiveIds() { PrimitiveId primitiveId = new PrimitiveId(); diff --git a/src/test/java/org/springframework/data/repository/core/support/RepositoryFactoryBeanSupportUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/RepositoryFactoryBeanSupportUnitTests.java index ffbb9af73..821aa5321 100644 --- a/src/test/java/org/springframework/data/repository/core/support/RepositoryFactoryBeanSupportUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/RepositoryFactoryBeanSupportUnitTests.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. @@ -35,10 +35,7 @@ public class RepositoryFactoryBeanSupportUnitTests { public @Rule ExpectedException exception = ExpectedException.none(); - /** - * @see DATACMNS-341 - */ - @Test + @Test // DATACMNS-341 @SuppressWarnings({ "rawtypes", "unchecked" }) public void setsConfiguredClassLoaderOnRepositoryFactory() { @@ -53,10 +50,7 @@ public class RepositoryFactoryBeanSupportUnitTests { assertThat(ReflectionTestUtils.getField(factory, "classLoader"), is((Object) classLoader)); } - /** - * @see DATACMNS-432 - */ - @Test + @Test // DATACMNS-432 @SuppressWarnings({ "rawtypes", "unchecked" }) public void initializationFailsWithMissingRepositoryInterface() { diff --git a/src/test/java/org/springframework/data/repository/core/support/RepositoryFactorySupportUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/RepositoryFactorySupportUnitTests.java index 30be9eb26..22bc30a01 100644 --- a/src/test/java/org/springframework/data/repository/core/support/RepositoryFactorySupportUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/RepositoryFactorySupportUnitTests.java @@ -147,20 +147,14 @@ public class RepositoryFactorySupportUnitTests { assertThat(factory.getRepository(foo), is(notNullValue())); } - /** - * @see DATACMNS-341 - */ - @Test + @Test // DATACMNS-341 public void usesDefaultClassLoaderIfNullConfigured() { factory.setBeanClassLoader(null); assertThat(ReflectionTestUtils.getField(factory, "classLoader"), is((Object) ClassUtils.getDefaultClassLoader())); } - /** - * @see DATACMNS-489 - */ - @Test + @Test // DATACMNS-489 public void wrapsExecutionResultIntoFutureIfConfigured() throws Exception { final Object reference = new Object(); @@ -192,10 +186,7 @@ public class RepositoryFactorySupportUnitTests { verify(factory.queryOne, times(1)).execute(Mockito.any(Object[].class)); } - /** - * @see DATACMNS-509 - */ - @Test + @Test // DATACMNS-509 public void convertsWithSameElementType() { List names = Collections.singletonList("Dave"); @@ -209,10 +200,7 @@ public class RepositoryFactorySupportUnitTests { assertThat(result.iterator().next(), is("Dave")); } - /** - * @see DATACMNS-509 - */ - @Test + @Test // DATACMNS-509 public void convertsCollectionToOtherCollectionWithElementSuperType() { List names = Collections.singletonList("Dave"); @@ -226,10 +214,7 @@ public class RepositoryFactorySupportUnitTests { assertThat(result.iterator().next(), is((Object) "Dave")); } - /** - * @see DATACMNS-656 - */ - @Test + @Test // DATACMNS-656 public void rejectsNullRepositoryProxyPostProcessor() { exception.expect(IllegalArgumentException.class); @@ -238,10 +223,7 @@ public class RepositoryFactorySupportUnitTests { factory.addRepositoryProxyPostProcessor(null); } - /** - * @see DATACMNS-715, SPR-13109 - */ - @Test + @Test // DATACMNS-715, SPR-13109 public void addsTransactionProxyInterfaceIfAvailable() throws Exception { try { @@ -256,10 +238,7 @@ public class RepositoryFactorySupportUnitTests { } } - /** - * @see @see DATACMNS-714 - */ - @Test + @Test // DATACMNS-714 public void wrapsExecutionResultIntoCompletableFutureIfConfigured() throws Exception { assumeThat(SPRING_VERSION.isGreaterThanOrEqualTo(FOUR_DOT_TWO), is(true)); @@ -269,10 +248,7 @@ public class RepositoryFactorySupportUnitTests { expect(prepareConvertingRepository(reference).findOneByFirstname("Foo"), reference); } - /** - * @see @see DATACMNS-714 - */ - @Test + @Test // DATACMNS-714 public void wrapsExecutionResultIntoListenableFutureIfConfigured() throws Exception { assumeThat(SPRING_VERSION.isGreaterThanOrEqualTo(FOUR_DOT_TWO), is(true)); @@ -282,10 +258,7 @@ public class RepositoryFactorySupportUnitTests { expect(prepareConvertingRepository(reference).findOneByLastname("Foo"), reference); } - /** - * @see @see DATACMNS-714 - */ - @Test + @Test // DATACMNS-714 public void wrapsExecutionResultIntoCompletableFutureWithEntityCollectionIfConfigured() throws Exception { assumeThat(SPRING_VERSION.isGreaterThanOrEqualTo(FOUR_DOT_TWO), is(true)); @@ -295,10 +268,7 @@ public class RepositoryFactorySupportUnitTests { expect(prepareConvertingRepository(reference).readAllByFirstname("Foo"), reference); } - /** - * @see DATACMNS-714 - */ - @Test + @Test // DATACMNS-714 public void wrapsExecutionResultIntoListenableFutureWithEntityCollectionIfConfigured() throws Exception { assumeThat(SPRING_VERSION.isGreaterThanOrEqualTo(FOUR_DOT_TWO), is(true)); @@ -308,10 +278,7 @@ public class RepositoryFactorySupportUnitTests { expect(prepareConvertingRepository(reference).readAllByLastname("Foo"), reference); } - /** - * @see DATACMNS-763 - */ - @Test + @Test // DATACMNS-763 @SuppressWarnings("rawtypes") public void rejectsRepositoryBaseClassWithInvalidConstructor() { diff --git a/src/test/java/org/springframework/data/repository/core/support/SurroundingTransactionDetectorMethodInterceptorUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/SurroundingTransactionDetectorMethodInterceptorUnitTests.java index 0f9c83ecf..37d866d8f 100644 --- a/src/test/java/org/springframework/data/repository/core/support/SurroundingTransactionDetectorMethodInterceptorUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/SurroundingTransactionDetectorMethodInterceptorUnitTests.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. @@ -31,10 +31,7 @@ import org.springframework.transaction.support.TransactionSynchronizationManager */ public class SurroundingTransactionDetectorMethodInterceptorUnitTests { - /** - * @see DATACMNS-959 - */ - @Test + @Test // DATACMNS-959 public void registersActiveSurroundingTransaction() throws Throwable { TransactionSynchronizationManager.setActualTransactionActive(true); @@ -42,10 +39,7 @@ public class SurroundingTransactionDetectorMethodInterceptorUnitTests { INSTANCE.invoke(new StubMethodInvocation(true)); } - /** - * @see DATACMNS-959 - */ - @Test + @Test // DATACMNS-959 public void registersNoSurroundingTransaction() throws Throwable { TransactionSynchronizationManager.setActualTransactionActive(false); diff --git a/src/test/java/org/springframework/data/repository/core/support/TransactionRepositoryFactoryBeanSupportUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/TransactionRepositoryFactoryBeanSupportUnitTests.java index 9f7e59787..18a9a95f0 100644 --- a/src/test/java/org/springframework/data/repository/core/support/TransactionRepositoryFactoryBeanSupportUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/TransactionRepositoryFactoryBeanSupportUnitTests.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. @@ -36,10 +36,7 @@ import org.springframework.transaction.interceptor.TransactionInterceptor; */ public class TransactionRepositoryFactoryBeanSupportUnitTests { - /** - * @see DATACMNS-656 - */ - @Test + @Test // DATACMNS-656 public void disablesDefaultTransactionsIfConfigured() { SampleTransactionalRepositoryFactoryBean factoryBean = new SampleTransactionalRepositoryFactoryBean(); @@ -68,10 +65,7 @@ public class TransactionRepositoryFactoryBeanSupportUnitTests { assertThat(found, is(true)); } - /** - * @see DATACMNS-880 - */ - @Test + @Test // DATACMNS-880 public void propagatesBeanFactoryToSuperClass() { SampleTransactionalRepositoryFactoryBean factoryBean = new SampleTransactionalRepositoryFactoryBean(); diff --git a/src/test/java/org/springframework/data/repository/core/support/TransactionRepositoryProxyPostProcessorUnitTests.java b/src/test/java/org/springframework/data/repository/core/support/TransactionRepositoryProxyPostProcessorUnitTests.java index 194a1912f..bce91f056 100644 --- a/src/test/java/org/springframework/data/repository/core/support/TransactionRepositoryProxyPostProcessorUnitTests.java +++ b/src/test/java/org/springframework/data/repository/core/support/TransactionRepositoryProxyPostProcessorUnitTests.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. You may obtain a copy of @@ -83,26 +83,17 @@ public class TransactionRepositoryProxyPostProcessorUnitTests { verify(proxyFactory).addAdvice(Mockito.any(TransactionInterceptor.class)); } - /** - * @see DATACMNS-464 - */ - @Test + @Test // DATACMNS-464 public void fallsBackToTargetMethodTransactionSettings() throws Exception { assertTransactionAttributeFor(SampleImplementation.class); } - /** - * @see DATACMNS-464 - */ - @Test + @Test // DATACMNS-464 public void fallsBackToTargetClassTransactionSettings() throws Exception { assertTransactionAttributeFor(SampleImplementationWithClassAnnotation.class); } - /** - * @see DATACMNS-732 - */ - @Test + @Test // DATACMNS-732 public void considersJtaTransactional() throws Exception { Method method = SampleRepository.class.getMethod("methodWithJtaOneDotTwoAtTransactional"); diff --git a/src/test/java/org/springframework/data/repository/init/ResourceReaderRepositoryInitializerUnitTests.java b/src/test/java/org/springframework/data/repository/init/ResourceReaderRepositoryInitializerUnitTests.java index 2c03fc84f..06bd499d7 100644 --- a/src/test/java/org/springframework/data/repository/init/ResourceReaderRepositoryInitializerUnitTests.java +++ b/src/test/java/org/springframework/data/repository/init/ResourceReaderRepositoryInitializerUnitTests.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. @@ -79,10 +79,7 @@ public class ResourceReaderRepositoryInitializerUnitTests { verify(productRepository, times(1)).save(product); } - /** - * @see DATACMNS-224 - */ - @Test + @Test // DATACMNS-224 public void emitsRepositoriesPopulatedEventIfPublisherConfigured() throws Exception { RepositoryPopulator populator = setUpReferenceAndInititalize(new User(), publisher); diff --git a/src/test/java/org/springframework/data/repository/query/ExtensionAwareEvaluationContextProviderUnitTests.java b/src/test/java/org/springframework/data/repository/query/ExtensionAwareEvaluationContextProviderUnitTests.java index ce3eeca45..f2723169d 100644 --- a/src/test/java/org/springframework/data/repository/query/ExtensionAwareEvaluationContextProviderUnitTests.java +++ b/src/test/java/org/springframework/data/repository/query/ExtensionAwareEvaluationContextProviderUnitTests.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 ExtensionAwareEvaluationContextProviderUnitTests { this.provider = new ExtensionAwareEvaluationContextProvider(Collections. emptyList()); } - /** - * @see DATACMNS-533 - */ - @Test + @Test // DATACMNS-533 public void usesPropertyDefinedByExtension() { this.provider = new ExtensionAwareEvaluationContextProvider(Collections.singletonList(new DummyExtension("_first", @@ -69,10 +66,7 @@ public class ExtensionAwareEvaluationContextProviderUnitTests { assertThat(evaluateExpression("key"), is((Object) "first")); } - /** - * @see DATACMNS-533 - */ - @Test + @Test // DATACMNS-533 public void secondExtensionOverridesFirstOne() { List extensions = new ArrayList(); @@ -84,10 +78,7 @@ public class ExtensionAwareEvaluationContextProviderUnitTests { assertThat(evaluateExpression("key"), is((Object) "second")); } - /** - * @see DATACMNS-533 - */ - @Test + @Test // DATACMNS-533 public void allowsDirectAccessToExtensionViaKey() { List extensions = new ArrayList(); @@ -98,18 +89,12 @@ public class ExtensionAwareEvaluationContextProviderUnitTests { assertThat(evaluateExpression("_first.key"), is((Object) "first")); } - /** - * @see DATACMNS-533 - */ - @Test + @Test // DATACMNS-533 public void exposesParametersAsVariables() { assertThat(evaluateExpression("#firstname"), is((Object) "parameterValue")); } - /** - * @see DATACMNS-533 - */ - @Test + @Test // DATACMNS-533 public void exposesMethodDefinedByExtension() { this.provider = new ExtensionAwareEvaluationContextProvider(Collections.singletonList(new DummyExtension("_first", @@ -121,10 +106,7 @@ public class ExtensionAwareEvaluationContextProviderUnitTests { assertThat(evaluateExpression("_first.aliasedMethod()"), is((Object) "methodResult")); } - /** - * @see DATACMNS-533 - */ - @Test + @Test // DATACMNS-533 public void exposesPropertiesDefinedByExtension() { this.provider = new ExtensionAwareEvaluationContextProvider(Collections.singletonList(new DummyExtension("_first", @@ -134,10 +116,7 @@ public class ExtensionAwareEvaluationContextProviderUnitTests { assertThat(evaluateExpression("_first.DUMMY_KEY"), is((Object) "dummy")); } - /** - * @see DATACMNS-533 - */ - @Test + @Test // DATACMNS-533 public void exposesPageableParameter() throws Exception { this.method = SampleRepo.class.getMethod("findByFirstname", String.class, Pageable.class); @@ -149,10 +128,7 @@ public class ExtensionAwareEvaluationContextProviderUnitTests { is((Object) "lastname: DESC")); } - /** - * @see DATACMNS-533 - */ - @Test + @Test // DATACMNS-533 public void exposesSortParameter() throws Exception { this.method = SampleRepo.class.getMethod("findByFirstname", String.class, Sort.class); @@ -161,10 +137,7 @@ public class ExtensionAwareEvaluationContextProviderUnitTests { assertThat(evaluateExpression("#sort.toString()", new Object[] { "test", sort }), is((Object) "lastname: DESC")); } - /** - * @see DATACMNS-533 - */ - @Test + @Test // DATACMNS-533 public void exposesSpecialParameterEvenIfItsNull() throws Exception { this.method = SampleRepo.class.getMethod("findByFirstname", String.class, Sort.class); @@ -172,10 +145,7 @@ public class ExtensionAwareEvaluationContextProviderUnitTests { assertThat(evaluateExpression("#sort?.toString()", new Object[] { "test", null }), is(nullValue())); } - /** - * @see DATACMNS-533 - */ - @Test + @Test // DATACMNS-533 public void shouldBeAbleToAccessCustomRootObjectPropertiesAndFunctions() { this.provider = new ExtensionAwareEvaluationContextProvider(Collections.singletonList( // @@ -197,10 +167,7 @@ public class ExtensionAwareEvaluationContextProviderUnitTests { assertThat(evaluateExpression("_first.stringProperty"), is((Object) "stringProperty")); } - /** - * @see DATACMNS-533 - */ - @Test + @Test // DATACMNS-533 public void shouldBeAbleToAccessCustomRootObjectPropertiesAndFunctionsInMultipleExtensions() { this.provider = new ExtensionAwareEvaluationContextProvider(Arrays.asList( // @@ -226,10 +193,7 @@ public class ExtensionAwareEvaluationContextProviderUnitTests { assertThat(evaluateExpression("[0]"), is((Object) "parameterValue")); } - /** - * @see DATACMNS-533 - */ - @Test + @Test // DATACMNS-533 public void shouldBeAbleToAccessCustomRootObjectPropertiesAndFunctionsFromDynamicTargetSource() { final AtomicInteger counter = new AtomicInteger(); diff --git a/src/test/java/org/springframework/data/repository/query/ParametersParameterAccessorUnitTests.java b/src/test/java/org/springframework/data/repository/query/ParametersParameterAccessorUnitTests.java index 18045c24a..fd119fffc 100644 --- a/src/test/java/org/springframework/data/repository/query/ParametersParameterAccessorUnitTests.java +++ b/src/test/java/org/springframework/data/repository/query/ParametersParameterAccessorUnitTests.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. @@ -66,10 +66,7 @@ public class ParametersParameterAccessorUnitTests { assertThat(accessor.hasBindableNullValue(), is(false)); } - /** - * @see DATACMNS-804 - */ - @Test + @Test // DATACMNS-804 public void iteratesonlyOverBindableValues() throws Exception { Method method = Sample.class.getMethod("method", Pageable.class, String.class); diff --git a/src/test/java/org/springframework/data/repository/query/ParametersUnitTests.java b/src/test/java/org/springframework/data/repository/query/ParametersUnitTests.java index 0b358f68c..4ff7f33bc 100644 --- a/src/test/java/org/springframework/data/repository/query/ParametersUnitTests.java +++ b/src/test/java/org/springframework/data/repository/query/ParametersUnitTests.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. You may obtain a copy of @@ -120,18 +120,12 @@ public class ParametersUnitTests { assertThat(parameters.getSortIndex(), is(1)); } - /** - * @see DATACMNS-520 - */ - @Test + @Test // DATACMNS-520 public void doesNotRejectParameterIfPageableComesFirst() throws Exception { getParametersFor("validWithPageableFirst", Pageable.class, String.class); } - /** - * @see DATACMNS-731 - */ - @Test + @Test // DATACMNS-731 public void detectsExplicitlyNamedParameter() throws Exception { Parameter parameter = getParametersFor("valid", String.class).getBindableParameter(0); @@ -140,10 +134,7 @@ public class ParametersUnitTests { assertThat(parameter.isExplicitlyNamed(), is(true)); } - /** - * @see DATACMNS-731 - */ - @Test + @Test // DATACMNS-731 public void doesNotConsiderParameterExplicitlyNamedEvenIfNamePresent() throws Exception { Parameter parameter = getParametersFor("validWithSortFirst", Sort.class, String.class).getBindableParameter(0); @@ -155,10 +146,7 @@ public class ParametersUnitTests { assertThat(parameter.isExplicitlyNamed(), is(false)); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void detectsDynamicProjectionParameter() throws Exception { Parameters parameters = getParametersFor("dynamicBind", Class.class, Class.class, Class.class); @@ -168,10 +156,7 @@ public class ParametersUnitTests { assertThat(parameters.getParameter(2).isDynamicProjectionParameter(), is(false)); } - /** - * @see DATACMNS-863 - */ - @Test + @Test // DATACMNS-863 public void unwrapsOptionals() throws Exception { Parameters parameters = getParametersFor("methodWithOptional", Optional.class); @@ -179,10 +164,7 @@ public class ParametersUnitTests { assertThat(parameters.getParameter(0).getType(), is(typeCompatibleWith(String.class))); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void keepsReactiveStreamsWrapper() throws Exception { Parameters parameters = getParametersFor("methodWithPublisher", Publisher.class); @@ -190,10 +172,7 @@ public class ParametersUnitTests { assertThat(parameters.getParameter(0).getType(), is(typeCompatibleWith(Publisher.class))); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void keepsRxJavaWrapper() throws Exception { Parameters parameters = getParametersFor("methodWithSingle", Single.class); diff --git a/src/test/java/org/springframework/data/repository/query/QueryMethodUnitTests.java b/src/test/java/org/springframework/data/repository/query/QueryMethodUnitTests.java index 5a8a0f1fc..6ab178168 100644 --- a/src/test/java/org/springframework/data/repository/query/QueryMethodUnitTests.java +++ b/src/test/java/org/springframework/data/repository/query/QueryMethodUnitTests.java @@ -52,48 +52,33 @@ public class QueryMethodUnitTests { RepositoryMetadata metadata = new DefaultRepositoryMetadata(SampleRepository.class); ProjectionFactory factory = new SpelAwareProxyProjectionFactory(); - /** - * @see DATAJPA-59 - */ - @Test(expected = IllegalStateException.class) + @Test(expected = IllegalStateException.class) // DATAJPA-59 public void rejectsPagingMethodWithInvalidReturnType() throws Exception { Method method = SampleRepository.class.getMethod("pagingMethodWithInvalidReturnType", Pageable.class); new QueryMethod(method, metadata, factory); } - /** - * @see DATAJPA-59 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATAJPA-59 public void rejectsPagingMethodWithoutPageable() throws Exception { Method method = SampleRepository.class.getMethod("pagingMethodWithoutPageable"); new QueryMethod(method, metadata, factory); } - /** - * @see DATACMNS-64 - */ - @Test + @Test // DATACMNS-64 public void setsUpSimpleQueryMethodCorrectly() throws Exception { Method method = SampleRepository.class.getMethod("findByUsername", String.class); new QueryMethod(method, metadata, factory); } - /** - * @see DATACMNS-61 - */ - @Test + @Test // DATACMNS-61 public void considersIterableMethodForCollectionQuery() throws Exception { Method method = SampleRepository.class.getMethod("sampleMethod"); QueryMethod queryMethod = new QueryMethod(method, metadata, factory); assertThat(queryMethod.isCollectionQuery(), is(true)); } - /** - * @see DATACMNS-67 - */ - @Test + @Test // DATACMNS-67 public void doesNotConsiderPageMethodCollectionQuery() throws Exception { Method method = SampleRepository.class.getMethod("anotherSampleMethod", Pageable.class); QueryMethod queryMethod = new QueryMethod(method, metadata, factory); @@ -101,10 +86,7 @@ public class QueryMethodUnitTests { assertThat(queryMethod.isCollectionQuery(), is(false)); } - /** - * @see DATACMNS-171 - */ - @Test + @Test // DATACMNS-171 public void detectsAnEntityBeingReturned() throws Exception { Method method = SampleRepository.class.getMethod("returnsEntitySubclass"); @@ -113,10 +95,7 @@ public class QueryMethodUnitTests { assertThat(queryMethod.isQueryForEntity(), is(true)); } - /** - * @see DATACMNS-171 - */ - @Test + @Test // DATACMNS-171 public void detectsNonEntityBeingReturned() throws Exception { Method method = SampleRepository.class.getMethod("returnsProjection"); @@ -125,10 +104,7 @@ public class QueryMethodUnitTests { assertThat(queryMethod.isQueryForEntity(), is(false)); } - /** - * @see DATACMNS-397 - */ - @Test + @Test // DATACMNS-397 public void detectsSliceMethod() throws Exception { RepositoryMetadata repositoryMetadata = new DefaultRepositoryMetadata(SampleRepository.class); @@ -140,10 +116,7 @@ public class QueryMethodUnitTests { assertThat(queryMethod.isPageQuery(), is(false)); } - /** - * @see DATACMNS-471 - */ - @Test + @Test // DATACMNS-471 public void detectsCollectionMethodForArrayRetrunType() throws Exception { RepositoryMetadata repositoryMetadata = new DefaultRepositoryMetadata(SampleRepository.class); @@ -152,10 +125,7 @@ public class QueryMethodUnitTests { assertThat(new QueryMethod(method, repositoryMetadata, factory).isCollectionQuery(), is(true)); } - /** - * @see DATACMNS-650 - */ - @Test + @Test // DATACMNS-650 public void considersMethodReturningAStreamStreaming() throws Exception { RepositoryMetadata repositoryMetadata = new DefaultRepositoryMetadata(SampleRepository.class); @@ -164,10 +134,7 @@ public class QueryMethodUnitTests { assertThat(new QueryMethod(method, repositoryMetadata, factory).isStreamQuery(), is(true)); } - /** - * @see DATACMNS-650 - */ - @Test + @Test // DATACMNS-650 public void doesNotRejectStreamingForPagination() throws Exception { RepositoryMetadata repositoryMetadata = new DefaultRepositoryMetadata(SampleRepository.class); @@ -176,10 +143,7 @@ public class QueryMethodUnitTests { assertThat(new QueryMethod(method, repositoryMetadata, factory).isStreamQuery(), is(true)); } - /** - * @see DATACMNS-716 - */ - @Test + @Test // DATACMNS-716 public void doesNotRejectCompletableFutureQueryForSingleEntity() throws Exception { RepositoryMetadata repositoryMetadata = new DefaultRepositoryMetadata(SampleRepository.class); @@ -188,10 +152,7 @@ public class QueryMethodUnitTests { assertThat(new QueryMethod(method, repositoryMetadata, factory).isCollectionQuery(), is(false)); } - /** - * @see DATACMNS-716 - */ - @Test + @Test // DATACMNS-716 public void doesNotRejectCompletableFutureQueryForEntityCollection() throws Exception { assumeThat(SPRING_VERSION.isGreaterThanOrEqualTo(FOUR_DOT_TWO), is(true)); @@ -202,10 +163,7 @@ public class QueryMethodUnitTests { assertThat(new QueryMethod(method, repositoryMetadata, factory).isCollectionQuery(), is(true)); } - /** - * @see DATACMNS-716 - */ - @Test + @Test // DATACMNS-716 public void doesNotRejectFutureQueryForSingleEntity() throws Exception { RepositoryMetadata repositoryMetadata = new DefaultRepositoryMetadata(SampleRepository.class); @@ -214,10 +172,7 @@ public class QueryMethodUnitTests { assertThat(new QueryMethod(method, repositoryMetadata, factory).isCollectionQuery(), is(false)); } - /** - * @see DATACMNS-716 - */ - @Test + @Test // DATACMNS-716 public void doesNotRejectFutureQueryForEntityCollection() throws Exception { RepositoryMetadata repositoryMetadata = new DefaultRepositoryMetadata(SampleRepository.class); @@ -250,24 +205,16 @@ public class QueryMethodUnitTests { Stream streaming(Pageable pageable); - /** - * @see DATACMNS-716 - */ + // DATACMNS-716 CompletableFuture returnsCompletableFutureForSingleEntity(); - /** - * @see DATACMNS-716 - */ + // DATACMNS-716 CompletableFuture> returnsCompletableFutureForEntityCollection(); - /** - * @see DATACMNS-716 - */ + // DATACMNS-716 Future returnsFutureForSingleEntity(); - /** - * @see DATACMNS-716 - */ + // DATACMNS-716 Future> returnsFutureForEntityCollection(); } diff --git a/src/test/java/org/springframework/data/repository/query/ResultProcessorUnitTests.java b/src/test/java/org/springframework/data/repository/query/ResultProcessorUnitTests.java index b3aff8cd8..669b0917c 100644 --- a/src/test/java/org/springframework/data/repository/query/ResultProcessorUnitTests.java +++ b/src/test/java/org/springframework/data/repository/query/ResultProcessorUnitTests.java @@ -53,10 +53,7 @@ import org.springframework.data.repository.core.support.DefaultRepositoryMetadat */ public class ResultProcessorUnitTests { - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void leavesNonProjectingResultUntouched() throws Exception { ResultProcessor information = new ResultProcessor(getQueryMethod("findAll"), new SpelAwareProxyProjectionFactory()); @@ -68,10 +65,7 @@ public class ResultProcessorUnitTests { assertThat(converted, contains(sample)); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void createsProjectionFromProperties() throws Exception { ResultProcessor information = getProcessor("findOneProjection"); @@ -81,10 +75,7 @@ public class ResultProcessorUnitTests { assertThat(result.getLastname(), is("Matthews")); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 @SuppressWarnings("unchecked") public void createsListOfProjectionsFormNestedLists() throws Exception { @@ -99,10 +90,7 @@ public class ResultProcessorUnitTests { assertThat(result.get(0).getLastname(), is("Matthews")); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 @SuppressWarnings("unchecked") public void createsListOfProjectionsFromMaps() throws Exception { @@ -117,10 +105,7 @@ public class ResultProcessorUnitTests { assertThat(result.get(0).getLastname(), is("Matthews")); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void createsListOfProjectionsFromEntity() throws Exception { ResultProcessor information = getProcessor("findAllProjection"); @@ -132,10 +117,7 @@ public class ResultProcessorUnitTests { assertThat(result.get(0).getLastname(), is("Matthews")); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void createsPageOfProjectionsFromEntity() throws Exception { ResultProcessor information = getProcessor("findPageProjection", Pageable.class); @@ -147,10 +129,7 @@ public class ResultProcessorUnitTests { assertThat(result.getContent().get(0).getLastname(), is("Matthews")); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void createsDynamicProjectionFromEntity() throws Exception { ResultProcessor information = getProcessor("findOneOpenProjection"); @@ -161,10 +140,7 @@ public class ResultProcessorUnitTests { assertThat(result.getFullName(), is("Dave Matthews")); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void findsDynamicProjection() throws Exception { ParameterAccessor accessor = mock(ParameterAccessor.class); @@ -179,10 +155,7 @@ public class ResultProcessorUnitTests { assertThat(processor.getReturnedType().getReturnedType(), is(typeCompatibleWith(SampleProjection.class))); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void refrainsFromProjectingIfThePreparingConverterReturnsACompatibleInstance() throws Exception { ResultProcessor processor = getProcessor("findAllDtos"); @@ -198,18 +171,12 @@ public class ResultProcessorUnitTests { assertThat(result, is(instanceOf(SampleDto.class))); } - /** - * @see DATACMNS-828 - */ - @Test + @Test // DATACMNS-828 public void returnsNullResultAsIs() throws Exception { assertThat(getProcessor("findOneDto").processResult(null), is(nullValue())); } - /** - * @see DATACMNS-842 - */ - @Test + @Test // DATACMNS-842 public void supportsSlicesAsReturnWrapper() throws Exception { Slice slice = new SliceImpl(Collections.singletonList(new Sample("Dave", "Matthews"))); @@ -223,10 +190,7 @@ public class ResultProcessorUnitTests { assertThat(content.get(0), is(instanceOf(SampleProjection.class))); } - /** - * @see DATACMNS-859 - */ - @Test + @Test // DATACMNS-859 @SuppressWarnings("unchecked") public void supportsStreamAsReturnWrapper() throws Exception { @@ -241,10 +205,7 @@ public class ResultProcessorUnitTests { assertThat(content.get(0), is(instanceOf(SampleProjection.class))); } - /** - * @see DATACMNS-860 - */ - @Test + @Test // DATACMNS-860 public void supportsWrappingDto() throws Exception { Object result = getProcessor("findOneWrappingDto").processResult(new Sample("Dave", "Matthews")); @@ -252,10 +213,7 @@ public class ResultProcessorUnitTests { assertThat(result, is(instanceOf(WrappingDto.class))); } - /** - * @see DATACMNS-921 - */ - @Test + @Test // DATACMNS-921 public void fallsBackToApproximateCollectionIfNecessary() throws Exception { ResultProcessor processor = getProcessor("findAllProjection"); @@ -266,10 +224,7 @@ public class ResultProcessorUnitTests { processor.processResult(specialList); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void supportsMonoWrapper() throws Exception { @@ -284,10 +239,7 @@ public class ResultProcessorUnitTests { assertThat(content, is(instanceOf(Sample.class))); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void supportsSingleWrapper() throws Exception { @@ -302,10 +254,7 @@ public class ResultProcessorUnitTests { assertThat(content, is(instanceOf(Sample.class))); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void refrainsFromProjectingUsingReactiveWrappersIfThePreparingConverterReturnsACompatibleInstance() throws Exception { @@ -321,10 +270,7 @@ public class ResultProcessorUnitTests { assertThat(content, is(instanceOf(SampleDto.class))); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void supportsFluxProjections() throws Exception { @@ -340,10 +286,7 @@ public class ResultProcessorUnitTests { assertThat(content.get(0), is(instanceOf(SampleProjection.class))); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 @SuppressWarnings("unchecked") public void supportsObservableProjections() throws Exception { diff --git a/src/test/java/org/springframework/data/repository/query/ReturnedTypeUnitTests.java b/src/test/java/org/springframework/data/repository/query/ReturnedTypeUnitTests.java index 384f24e83..3da3e91ff 100644 --- a/src/test/java/org/springframework/data/repository/query/ReturnedTypeUnitTests.java +++ b/src/test/java/org/springframework/data/repository/query/ReturnedTypeUnitTests.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. @@ -38,10 +38,7 @@ import org.springframework.data.repository.core.support.DefaultRepositoryMetadat */ public class ReturnedTypeUnitTests { - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void treatsSimpleDomainTypeAsIs() throws Exception { ReturnedType type = getReturnedType("findAll"); @@ -52,10 +49,7 @@ public class ReturnedTypeUnitTests { assertThat(type.needsCustomConstruction(), is(false)); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void detectsDto() throws Exception { ReturnedType type = getReturnedType("findAllDtos"); @@ -67,10 +61,7 @@ public class ReturnedTypeUnitTests { assertThat(type.needsCustomConstruction(), is(true)); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void detectsProjection() throws Exception { ReturnedType type = getReturnedType("findAllProjection"); @@ -79,10 +70,7 @@ public class ReturnedTypeUnitTests { assertThat(type.getInputProperties(), contains("lastname")); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void detectsVoidMethod() throws Exception { ReturnedType type = getReturnedType("voidMethod"); @@ -91,10 +79,7 @@ public class ReturnedTypeUnitTests { assertThat(type.getReturnedType(), is(typeCompatibleWith(void.class))); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void detectsClosedProjection() throws Exception { ReturnedType type = getReturnedType("findOneProjection"); @@ -104,10 +89,7 @@ public class ReturnedTypeUnitTests { assertThat(type.needsCustomConstruction(), is(true)); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void detectsOpenProjection() throws Exception { ReturnedType type = getReturnedType("findOneOpenProjection"); @@ -118,10 +100,7 @@ public class ReturnedTypeUnitTests { assertThat(type.getTypeToRead(), is(typeCompatibleWith(Sample.class))); } - /** - * @see DATACMNS-89 - */ - @Test + @Test // DATACMNS-89 public void detectsComplexNumberTypes() throws Exception { ReturnedType type = getReturnedType("countQuery"); @@ -131,10 +110,7 @@ public class ReturnedTypeUnitTests { assertThat(type.getTypeToRead(), is(typeCompatibleWith(BigInteger.class))); } - /** - * @see DATACMNS-840 - */ - @Test + @Test // DATACMNS-840 public void detectsSampleDtoWithDefaultConstructor() throws Exception { ReturnedType type = getReturnedType("dtoWithMultipleConstructors"); @@ -143,10 +119,7 @@ public class ReturnedTypeUnitTests { assertThat(type.needsCustomConstruction(), is(false)); } - /** - * @see DATACMNS-840 - */ - @Test + @Test // DATACMNS-840 public void doesNotConsiderAnEnumProjecting() throws Exception { ReturnedType type = getReturnedType("findEnum"); @@ -155,10 +128,7 @@ public class ReturnedTypeUnitTests { assertThat(type.isProjecting(), is(false)); } - /** - * @see DATACMNS-850 - */ - @Test + @Test // DATACMNS-850 public void considersAllJavaTypesAsNotProjecting() throws Exception { ReturnedType type = getReturnedType("timeQuery"); @@ -167,10 +137,7 @@ public class ReturnedTypeUnitTests { assertThat(type.isProjecting(), is(false)); } - /** - * @see DATACMNS-862 - */ - @Test + @Test // DATACMNS-862 public void considersInterfaceImplementedByDomainTypeNotProjecting() throws Exception { ReturnedType type = getReturnedType("findOneInterface"); @@ -179,10 +146,7 @@ public class ReturnedTypeUnitTests { assertThat(type.isProjecting(), is(false)); } - /** - * @see DATACMNS-963 - */ - @Test + @Test // DATACMNS-963 public void detectsDistinctInputProperties() { ReturnedType type = ReturnedType.of(Child.class, Object.class, new SpelAwareProxyProjectionFactory()); diff --git a/src/test/java/org/springframework/data/repository/query/StreamQueryResultHandlerUnitTests.java b/src/test/java/org/springframework/data/repository/query/StreamQueryResultHandlerUnitTests.java index 54f9850a4..f8bed16e1 100644 --- a/src/test/java/org/springframework/data/repository/query/StreamQueryResultHandlerUnitTests.java +++ b/src/test/java/org/springframework/data/repository/query/StreamQueryResultHandlerUnitTests.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. @@ -55,10 +55,7 @@ public class StreamQueryResultHandlerUnitTests { }); } - /** - * @see DATACMNS-868 - */ - @Test + @Test // DATACMNS-868 @SuppressWarnings("unchecked") public void mapsStreamUsingConverter() { @@ -89,10 +86,7 @@ public class StreamQueryResultHandlerUnitTests { stream.close(); } - /** - * @see DATACMNS-868 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-868 public void rejectsNullSource() { handler.handle(null); } diff --git a/src/test/java/org/springframework/data/repository/query/parser/OrderBySourceUnitTests.java b/src/test/java/org/springframework/data/repository/query/parser/OrderBySourceUnitTests.java index 620e83587..3f0ae4daf 100644 --- a/src/test/java/org/springframework/data/repository/query/parser/OrderBySourceUnitTests.java +++ b/src/test/java/org/springframework/data/repository/query/parser/OrderBySourceUnitTests.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. @@ -62,10 +62,7 @@ public class OrderBySourceUnitTests { assertThat(source.toSort(), is(new Sort(new Order(DESC, "bar.name")))); } - /** - * @see DATACMNS-641 - */ - @Test + @Test // DATACMNS-641 public void defaultsSortOrderToAscendingSort() { OrderBySource source = new OrderBySource("lastname"); diff --git a/src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.java b/src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.java index fa962539c..8e3454270 100644 --- a/src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.java +++ b/src/test/java/org/springframework/data/repository/query/parser/PartTreeUnitTests.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. You may obtain a copy of @@ -190,18 +190,12 @@ public class PartTreeUnitTests { assertThat(parts.next().shouldIgnoreCase(), is(IgnoreCaseType.NEVER)); } - /** - * @see DATACMNS-78 - */ - @Test + @Test // DATACMNS-78 public void parsesLessThanEqualCorrectly() { assertType(Arrays.asList("lastnameLessThanEqual", "lastnameIsLessThanEqual"), LESS_THAN_EQUAL, "lastname"); } - /** - * @see DATACMNS-78 - */ - @Test + @Test // DATACMNS-78 public void parsesGreaterThanEqualCorrectly() { assertType(Arrays.asList("lastnameGreaterThanEqual", "lastnameIsGreaterThanEqual"), GREATER_THAN_EQUAL, "lastname"); } @@ -227,99 +221,63 @@ public class PartTreeUnitTests { assertThat(parts, is(hasSize(1))); } - /** - * @see DATACMNS-94 - */ - @Test + @Test // DATACMNS-94 public void parsesExistsKeywordCorrectly() { assertType(asList("lastnameExists"), EXISTS, "lastname", 0, false); } - /** - * @see DATACMNS-94 - */ - @Test + @Test // DATACMNS-94 public void parsesRegexKeywordCorrectly() { assertType(asList("lastnameRegex", "lastnameMatchesRegex", "lastnameMatches"), REGEX, "lastname"); } - /** - * @see DATACMNS-107 - */ - @Test + @Test // DATACMNS-107 public void parsesTrueKeywordCorrectly() { assertType(asList("activeTrue", "activeIsTrue"), TRUE, "active", 0, false); } - /** - * @see DATACMNS-107 - */ - @Test + @Test // DATACMNS-107 public void parsesFalseKeywordCorrectly() { assertType(asList("activeFalse", "activeIsFalse"), FALSE, "active", 0, false); } - /** - * @see DATACMNS-111 - */ - @Test + @Test // DATACMNS-111 public void parsesStartingWithKeywordCorrectly() { assertType(asList("firstnameStartsWith", "firstnameStartingWith", "firstnameIsStartingWith"), STARTING_WITH, "firstname"); } - /** - * @see DATACMNS-111 - */ - @Test + @Test // DATACMNS-111 public void parsesEndingWithKeywordCorrectly() { assertType(asList("firstnameEndsWith", "firstnameEndingWith", "firstnameIsEndingWith"), ENDING_WITH, "firstname"); } - /** - * @see DATACMNS-111 - */ - @Test + @Test // DATACMNS-111 public void parsesContainingKeywordCorrectly() { assertType(asList("firstnameIsContaining", "firstnameContains", "firstnameContaining"), CONTAINING, "firstname"); } - /** - * @see DATACMNS-141 - */ - @Test + @Test // DATACMNS-141 public void parsesAfterKeywordCorrectly() { assertType(asList("birthdayAfter", "birthdayIsAfter"), Type.AFTER, "birthday"); } - /** - * @see DATACMNS-141 - */ - @Test + @Test // DATACMNS-141 public void parsesBeforeKeywordCorrectly() { assertType(Arrays.asList("birthdayBefore", "birthdayIsBefore"), Type.BEFORE, "birthday"); } - /** - * @see DATACMNS-433 - */ - @Test + @Test // DATACMNS-433 public void parsesLikeKeywordCorrectly() { assertType(asList("activeLike", "activeIsLike"), LIKE, "active"); } - /** - * @see DATACMNS-433 - */ - @Test + @Test // DATACMNS-433 public void parsesNotLikeKeywordCorrectly() { assertType(asList("activeNotLike", "activeIsNotLike"), NOT_LIKE, "active"); } - /** - * @see DATACMNS-182 - */ - @Test + @Test // DATACMNS-182 public void parsesContainingCorrectly() { PartTree tree = new PartTree("findAllByLegalNameContainingOrCommonNameContainingAllIgnoringCase", @@ -328,10 +286,7 @@ public class PartTreeUnitTests { "commonNameContaining", Organization.class) }); } - /** - * @see DATACMNS-221 - */ - @Test + @Test // DATACMNS-221 public void parsesSpecialCharactersCorrectly() { PartTree tree = new PartTree("findByØreAndÅrOrderByÅrAsc", DomainObjectWithSpecialChars.class); assertPart(tree, new Part[] { new Part("øre", DomainObjectWithSpecialChars.class), @@ -339,10 +294,7 @@ public class PartTreeUnitTests { assertTrue(tree.getSort().getOrderFor("år").isAscending()); } - /** - * @see DATACMNS-363 - */ - @Test + @Test // DATACMNS-363 public void parsesSpecialCharactersOnlyCorrectly_Korean() { PartTree tree = new PartTree("findBy이름And생일OrderBy생일Asc", DomainObjectWithSpecialChars.class); @@ -352,10 +304,7 @@ public class PartTreeUnitTests { assertTrue(tree.getSort().getOrderFor("생일").isAscending()); } - /** - * @see DATACMNS-363 - */ - @Test + @Test // DATACMNS-363 public void parsesSpecialUnicodeCharactersMixedWithRegularCharactersCorrectly_Korean() { PartTree tree = new PartTree("findBy이름AndOrderIdOrderBy생일Asc", DomainObjectWithSpecialChars.class); @@ -365,10 +314,7 @@ public class PartTreeUnitTests { assertTrue(tree.getSort().getOrderFor("생일").isAscending()); } - /** - * @see DATACMNS-363 - */ - @Test + @Test // DATACMNS-363 public void parsesNestedSpecialUnicodeCharactersMixedWithRegularCharactersCorrectly_Korean() { PartTree tree = new PartTree( // @@ -391,10 +337,7 @@ public class PartTreeUnitTests { assertTrue(tree.getSort().getOrderFor("생일").isAscending()); } - /** - * @see DATACMNS-363 - */ - @Test + @Test // DATACMNS-363 public void parsesNestedSpecialUnicodeCharactersMixedWithRegularCharactersCorrectly_KoreanNumbersSymbols() { PartTree tree = new PartTree( // @@ -427,30 +370,21 @@ public class PartTreeUnitTests { assertTrue(tree.getSort().getOrderFor("생일").isAscending()); } - /** - * @see DATACMNS-303 - */ - @Test + @Test // DATACMNS-303 public void identifiesSimpleCountByCorrectly() { PartTree tree = new PartTree("countByLastname", User.class); assertThat(tree.isCountProjection(), is(true)); } - /** - * @see DATACMNS-875 - */ - @Test + @Test // DATACMNS-875 public void identifiesSimpleExistsByCorrectly() { PartTree tree = new PartTree("existsByLastname", User.class); assertThat(tree.isExistsProjection(), is(true)); } - /** - * @see DATACMNS-399 - */ - @Test + @Test // DATACMNS-399 public void queryPrefixShouldBeSupportedInRepositoryQueryMethods() { PartTree tree = new PartTree("queryByFirstnameAndLastname", User.class); @@ -460,20 +394,14 @@ public class PartTreeUnitTests { assertThat(parts, hasItem(part("lastname"))); } - /** - * @see DATACMNS-303 - */ - @Test + @Test // DATACMNS-303 public void identifiesExtendedCountByCorrectly() { PartTree tree = new PartTree("countUserByLastname", User.class); assertThat(tree.isCountProjection(), is(true)); } - /** - * @see DATACMNS-303 - */ - @Test + @Test // DATACMNS-303 public void identifiesCountAndDistinctByCorrectly() { PartTree tree = new PartTree("countDistinctUserByLastname", User.class); @@ -481,42 +409,27 @@ public class PartTreeUnitTests { assertThat(tree.isDistinct(), is(true)); } - /** - * @see DATAJPA-324 - */ - @Test + @Test // DATAJPA-324 public void resolvesPropertyPathFromGettersOnInterfaces() { assertThat(new PartTree("findByCategoryId", Product.class), is(notNullValue())); } - /** - * @see DATACMNS-368 - */ - @Test + @Test // DATACMNS-368 public void detectPropertyWithOrKeywordPart() { assertThat(new PartTree("findByOrder", Product.class), is(notNullValue())); } - /** - * @see DATACMNS-368 - */ - @Test + @Test // DATACMNS-368 public void detectPropertyWithAndKeywordPart() { assertThat(new PartTree("findByAnders", Product.class), is(notNullValue())); } - /** - * @see DATACMNS-368 - */ - @Test + @Test // DATACMNS-368 public void detectPropertyPathWithOrKeywordPart() { assertThat(new PartTree("findByOrderId", Product.class), is(notNullValue())); } - /** - * @see DATACMNS-387 - */ - @Test + @Test // DATACMNS-387 public void buildsPartTreeFromEmptyPredicateCorrectly() { PartTree tree = new PartTree("findAllByOrderByLastnameAsc", User.class); @@ -525,132 +438,87 @@ public class PartTreeUnitTests { assertThat(tree.getSort(), is(new Sort(Direction.ASC, "lastname"))); } - /** - * @see DATACMNS-448 - */ - @Test + @Test // DATACMNS-448 public void identifiesSimpleDeleteByCorrectly() { PartTree tree = new PartTree("deleteByLastname", User.class); assertThat(tree.isDelete(), is(true)); } - /** - * @see DATACMNS-448 - */ - @Test + @Test // DATACMNS-448 public void identifiesExtendedDeleteByCorrectly() { PartTree tree = new PartTree("deleteUserByLastname", User.class); assertThat(tree.isDelete(), is(true)); } - /** - * @see DATACMNS-448 - */ - @Test + @Test // DATACMNS-448 public void identifiesSimpleRemoveByCorrectly() { PartTree tree = new PartTree("removeByLastname", User.class); assertThat(tree.isDelete(), is(true)); } - /** - * @see DATACMNS-448 - */ - @Test + @Test // DATACMNS-448 public void identifiesExtendedRemoveByCorrectly() { PartTree tree = new PartTree("removeUserByLastname", User.class); assertThat(tree.isDelete(), is(true)); } - /** - * @see DATACMNS-516 - */ - @Test + @Test // DATACMNS-516 public void disablesFindFirstKImplicitIfNotPresent() { assertLimiting("findByLastname", User.class, false, null); } - /** - * @see DATACMNS-516 - */ - @Test + @Test // DATACMNS-516 public void identifiesFindFirstImplicit() { assertLimiting("findFirstByLastname", User.class, true, 1); } - /** - * @see DATACMNS-516 - */ - @Test + @Test // DATACMNS-516 public void identifiesFindFirst1Explicit() { assertLimiting("findFirstByLastname", User.class, true, 1); } - /** - * @see DATACMNS-516 - */ - @Test + @Test // DATACMNS-516 public void identifiesFindFirstKExplicit() { assertLimiting("findFirst10ByLastname", User.class, true, 10); } - /** - * @see DATACMNS-516 - */ - @Test + @Test // DATACMNS-516 public void identifiesFindFirstKUsersExplicit() { assertLimiting("findFirst10UsersByLastname", User.class, true, 10); } - /** - * @see DATACMNS-516 - */ - @Test + @Test // DATACMNS-516 public void identifiesFindFirstKDistinctUsersExplicit() { assertLimiting("findFirst10DistinctUsersByLastname", User.class, true, 10, true); assertLimiting("findDistinctFirst10UsersByLastname", User.class, true, 10, true); assertLimiting("findFirst10UsersDistinctByLastname", User.class, true, 10, true); } - /** - * @see DATACMNS-516 - */ - @Test + @Test // DATACMNS-516 public void identifiesFindTopImplicit() { assertLimiting("findTopByLastname", User.class, true, 1); } - /** - * @see DATACMNS-516 - */ - @Test + @Test // DATACMNS-516 public void identifiesFindTop1Explicit() { assertLimiting("findTop1ByLastname", User.class, true, 1); } - /** - * @see DATACMNS-516 - */ - @Test + @Test // DATACMNS-516 public void identifiesFindTopKExplicit() { assertLimiting("findTop10ByLastname", User.class, true, 10); } - /** - * @see DATACMNS-516 - */ - @Test + @Test // DATACMNS-516 public void identifiesFindTopKUsersExplicit() { assertLimiting("findTop10UsersByLastname", User.class, true, 10); } - /** - * @see DATACMNS-516 - */ - @Test + @Test // DATACMNS-516 public void identifiesFindTopKDistinctUsersExplicit() { assertLimiting("findTop10DistinctUsersByLastname", User.class, true, 10, true); assertLimiting("findDistinctTop10UsersByLastname", User.class, true, 10, true); @@ -663,39 +531,27 @@ public class PartTreeUnitTests { assertLimiting("countTop10DistinctUsersByLastname", User.class, false, null, true); } - /** - * @see DATACMNS-875 - */ - @Test + @Test // DATACMNS-875 public void shouldNotSupportLimitingExistQueries() { assertLimiting("existsFirst10DistinctUsersByLastname", User.class, false, null, true); assertLimiting("existsTop10DistinctUsersByLastname", User.class, false, null, true); } - /** - * @see DATACMNS-581 - */ - @Test + @Test // DATACMNS-581 public void parsesIsNotContainingCorrectly() throws Exception { assertType(asList("firstnameIsNotContaining", "firstnameNotContaining", "firstnameNotContains"), NOT_CONTAINING, "firstname"); } - /** - * @see DATACMNS-581 - */ - @Test + @Test // DATACMNS-581 public void buildsPartTreeForNotContainingCorrectly() throws Exception { PartTree tree = new PartTree("findAllByLegalNameNotContaining", Organization.class); assertPart(tree, new Part[] { new Part("legalNameNotContaining", Organization.class) }); } - /** - * @see DATACMNS-750 - */ - @Test + @Test // DATACMNS-750 public void doesNotFailOnPropertiesContainingAKeyword() { PartTree partTree = new PartTree("findBySomeInfoIn", Category.class); diff --git a/src/test/java/org/springframework/data/repository/support/AnnotationAttributeUnitTests.java b/src/test/java/org/springframework/data/repository/support/AnnotationAttributeUnitTests.java index b11c1ef88..6fcb521d6 100644 --- a/src/test/java/org/springframework/data/repository/support/AnnotationAttributeUnitTests.java +++ b/src/test/java/org/springframework/data/repository/support/AnnotationAttributeUnitTests.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. @@ -28,26 +28,17 @@ import org.springframework.stereotype.Component; */ public class AnnotationAttributeUnitTests { - /** - * @see DATACMNS-607 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-607 public void rejectsNullAnnotationType() { new AnnotationAttribute(null); } - /** - * @see DATACMNS-607 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-607 public void rejectsNullAnnotationTypeForAnnotationAndAttributeName() { new AnnotationAttribute(null, "name"); } - /** - * @see DATACMNS-607 - */ - @Test + @Test // DATACMNS-607 public void looksUpAttributeFromAnnotatedElement() { AnnotationAttribute attribute = new AnnotationAttribute(Component.class); diff --git a/src/test/java/org/springframework/data/repository/support/CrudRepositoryInvokerUnitTests.java b/src/test/java/org/springframework/data/repository/support/CrudRepositoryInvokerUnitTests.java index 298104fd6..8df18f946 100644 --- a/src/test/java/org/springframework/data/repository/support/CrudRepositoryInvokerUnitTests.java +++ b/src/test/java/org/springframework/data/repository/support/CrudRepositoryInvokerUnitTests.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. @@ -54,64 +54,43 @@ public class CrudRepositoryInvokerUnitTests { @Mock PersonRepository personRepository; @Mock OrderRepository orderRepository; - /** - * @see DATACMNS-589, DATAREST-216 - */ - @Test + @Test // DATACMNS-589, DATAREST-216 public void invokesRedeclaredSave() { getInvokerFor(orderRepository, expectInvocationOnType(OrderRepository.class)).invokeSave(new Order()); } - /** - * @see DATACMNS-589, DATAREST-216 - */ - @Test + @Test // DATACMNS-589, DATAREST-216 public void invokesRedeclaredFindOne() { getInvokerFor(orderRepository, expectInvocationOnType(OrderRepository.class)).invokeFindOne(1L); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesRedeclaredDelete() throws Exception { getInvokerFor(orderRepository, expectInvocationOnType(OrderRepository.class)).invokeDelete(1L); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesSaveOnCrudRepository() throws Exception { Method method = CrudRepository.class.getMethod("save", Object.class); getInvokerFor(personRepository, expectInvocationOf(method)).invokeSave(new Person()); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesFindOneOnCrudRepository() throws Exception { Method method = CrudRepository.class.getMethod("findOne", Serializable.class); getInvokerFor(personRepository, expectInvocationOf(method)).invokeFindOne(1L); } - /** - * @see DATACMNS-589, DATAREST-216 - */ - @Test + @Test // DATACMNS-589, DATAREST-216 public void invokesDeleteOnCrudRepository() throws Exception { Method method = CrudRepository.class.getMethod("delete", Serializable.class); getInvokerFor(personRepository, expectInvocationOf(method)).invokeDelete(1L); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesFindAllOnCrudRepository() throws Exception { Method method = CrudRepository.class.getMethod("findAll"); @@ -120,10 +99,7 @@ public class CrudRepositoryInvokerUnitTests { getInvokerFor(orderRepository, expectInvocationOf(method)).invokeFindAll((Sort) null); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesCustomFindAllTakingASort() throws Exception { CrudWithFindAllWithSort repository = mock(CrudWithFindAllWithSort.class); @@ -135,10 +111,7 @@ public class CrudRepositoryInvokerUnitTests { getInvokerFor(repository, expectInvocationOf(findAllWithSort)).invokeFindAll((Sort) null); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesCustomFindAllTakingAPageable() throws Exception { CrudWithFindAllWithPageable repository = mock(CrudWithFindAllWithPageable.class); diff --git a/src/test/java/org/springframework/data/repository/support/DefaultRepositoryInvokerFactoryIntegrationTests.java b/src/test/java/org/springframework/data/repository/support/DefaultRepositoryInvokerFactoryIntegrationTests.java index 79ecdf75c..60dd38b9b 100644 --- a/src/test/java/org/springframework/data/repository/support/DefaultRepositoryInvokerFactoryIntegrationTests.java +++ b/src/test/java/org/springframework/data/repository/support/DefaultRepositoryInvokerFactoryIntegrationTests.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. @@ -61,10 +61,7 @@ public class DefaultRepositoryInvokerFactoryIntegrationTests { this.factory = new DefaultRepositoryInvokerFactory(repositories); } - /** - * @see DATACMNS-410, DATACMNS-589 - */ - @Test + @Test // DATACMNS-410, DATACMNS-589 public void findOneShouldDelegateToAppropriateRepository() { Mockito.reset(productRepository); @@ -74,10 +71,7 @@ public class DefaultRepositoryInvokerFactoryIntegrationTests { assertThat(factory.getInvokerFor(Product.class).invokeFindOne(4711L), is((Object) product)); } - /** - * @see DATACMNS-374, DATACMNS-589 - */ - @Test + @Test // DATACMNS-374, DATACMNS-589 public void shouldThrowMeaningfulExceptionWhenTheRepositoryForAGivenDomainClassCannotBeFound() { exception.expect(IllegalArgumentException.class); @@ -87,10 +81,7 @@ public class DefaultRepositoryInvokerFactoryIntegrationTests { factory.getInvokerFor(Object.class); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void returnsSameInvokerInstanceForSubsequentCalls() { RepositoryInvoker invoker = factory.getInvokerFor(Product.class); @@ -98,10 +89,7 @@ public class DefaultRepositoryInvokerFactoryIntegrationTests { assertThat(factory.getInvokerFor(Product.class), is(invoker)); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void createsReflectionRepositoryInvokerForRepositoryNotExtendingADedicatedBaseRepository() { RepositoryInvoker invoker = factory.getInvokerFor(Product.class); @@ -110,10 +98,7 @@ public class DefaultRepositoryInvokerFactoryIntegrationTests { assertThat(invoker, is(not(instanceOf(CrudRepositoryInvoker.class)))); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void createsCrudRepositoryInvokerForRepositoryExtendingCrudRepository() { RepositoryInvoker invoker = factory.getInvokerFor(User.class); diff --git a/src/test/java/org/springframework/data/repository/support/DomainClassConverterUnitTests.java b/src/test/java/org/springframework/data/repository/support/DomainClassConverterUnitTests.java index b96525b30..4acbb8b06 100644 --- a/src/test/java/org/springframework/data/repository/support/DomainClassConverterUnitTests.java +++ b/src/test/java/org/springframework/data/repository/support/DomainClassConverterUnitTests.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. @@ -95,16 +95,12 @@ public class DomainClassConverterUnitTests { assertMatches(false); } - /** - * @see DATACMNS-233 - */ + // DATACMNS-233 public void returnsNullForNullSource() { assertThat(converter.convert(null, STRING_TYPE, USER_TYPE), is(nullValue())); } - /** - * @see DATACMNS-233 - */ + // DATACMNS-233 public void returnsNullForEmptyStringSource() { assertThat(converter.convert("", STRING_TYPE, USER_TYPE), is(nullValue())); } @@ -131,10 +127,7 @@ public class DomainClassConverterUnitTests { verify(repo, times(1)).findOne(1L); } - /** - * @see DATACMNS-133 - */ - @Test + @Test // DATACMNS-133 public void discoversFactoryAndRepoFromParentApplicationContext() { ApplicationContext parent = initContextWithRepo(); @@ -147,10 +140,7 @@ public class DomainClassConverterUnitTests { assertThat(converter.matches(STRING_TYPE, USER_TYPE), is(true)); } - /** - * @see DATACMNS-583 - */ - @Test + @Test // DATACMNS-583 public void converterDoesntMatchIfTargetTypeIsAssignableFromSource() { converter.setApplicationContext(initContextWithRepo()); @@ -159,10 +149,7 @@ public class DomainClassConverterUnitTests { assertThat((User) converter.convert(USER, USER_TYPE, USER_TYPE), is(USER)); } - /** - * @see DATACMNS-627 - */ - @Test + @Test // DATACMNS-627 public void supportsConversionFromIdType() { converter.setApplicationContext(initContextWithRepo()); @@ -170,10 +157,7 @@ public class DomainClassConverterUnitTests { assertThat(converter.matches(LONG_TYPE, USER_TYPE), is(true)); } - /** - * @see DATACMNS-627 - */ - @Test + @Test // DATACMNS-627 public void supportsConversionFromEntityToIdType() { converter.setApplicationContext(initContextWithRepo()); @@ -181,10 +165,7 @@ public class DomainClassConverterUnitTests { assertThat(converter.matches(USER_TYPE, LONG_TYPE), is(true)); } - /** - * @see DATACMNS-627 - */ - @Test + @Test // DATACMNS-627 public void supportsConversionFromEntityToString() { converter.setApplicationContext(initContextWithRepo()); @@ -193,10 +174,7 @@ public class DomainClassConverterUnitTests { assertThat(converter.matches(USER_TYPE, STRING_TYPE), is(true)); } - /** - * @see DATACMNS-683 - */ - @Test + @Test // DATACMNS-683 public void toIdConverterDoesNotMatchIfTargetTypeIsAssignableFromSource() throws Exception { converter.setApplicationContext(initContextWithRepo()); diff --git a/src/test/java/org/springframework/data/repository/support/PageableExecutionUtilsUnitTests.java b/src/test/java/org/springframework/data/repository/support/PageableExecutionUtilsUnitTests.java index fbe50ab6c..7074d94e9 100644 --- a/src/test/java/org/springframework/data/repository/support/PageableExecutionUtilsUnitTests.java +++ b/src/test/java/org/springframework/data/repository/support/PageableExecutionUtilsUnitTests.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. @@ -41,10 +41,7 @@ public class PageableExecutionUtilsUnitTests { @Mock TotalSupplier totalSupplierMock; - /** - * @see DATAMCNS-884 - */ - @Test + @Test // DATAMCNS-884 public void firstPageRequestIsLessThanOneFullPageDoesNotRequireTotal() { Page page = PageableExecutionUtils.getPage(Arrays.asList(1, 2, 3), new PageRequest(0, 10), @@ -55,10 +52,7 @@ public class PageableExecutionUtilsUnitTests { verifyZeroInteractions(totalSupplierMock); } - /** - * @see DATAMCNS-884 - */ - @Test + @Test // DATAMCNS-884 public void noPageableRequesDoesNotRequireTotal() { Page page = PageableExecutionUtils.getPage(Arrays.asList(1, 2, 3), null, totalSupplierMock); @@ -69,10 +63,7 @@ public class PageableExecutionUtilsUnitTests { verifyZeroInteractions(totalSupplierMock); } - /** - * @see DATAMCNS-884 - */ - @Test + @Test // DATAMCNS-884 public void subsequentPageRequestIsLessThanOneFullPageDoesNotRequireTotal() { Page page = PageableExecutionUtils.getPage(Arrays.asList(1, 2, 3), new PageRequest(5, 10), @@ -84,10 +75,7 @@ public class PageableExecutionUtilsUnitTests { verifyZeroInteractions(totalSupplierMock); } - /** - * @see DATAMCNS-884 - */ - @Test + @Test // DATAMCNS-884 public void firstPageRequestHitsUpperBoundRequiresTotal() { doReturn(4L).when(totalSupplierMock).get(); @@ -101,10 +89,7 @@ public class PageableExecutionUtilsUnitTests { verify(totalSupplierMock).get(); } - /** - * @see DATAMCNS-884 - */ - @Test + @Test // DATAMCNS-884 public void subsequentPageRequestHitsUpperBoundRequiresTotal() { doReturn(7L).when(totalSupplierMock).get(); @@ -118,10 +103,7 @@ public class PageableExecutionUtilsUnitTests { verify(totalSupplierMock).get(); } - /** - * @see DATAMCNS-884 - */ - @Test + @Test // DATAMCNS-884 public void subsequentPageRequestWithoutResultRequiresRequireTotal() { doReturn(7L).when(totalSupplierMock).get(); diff --git a/src/test/java/org/springframework/data/repository/support/PaginginAndSortingRepositoryInvokerUnitTests.java b/src/test/java/org/springframework/data/repository/support/PaginginAndSortingRepositoryInvokerUnitTests.java index df063d1d9..88b54b30b 100644 --- a/src/test/java/org/springframework/data/repository/support/PaginginAndSortingRepositoryInvokerUnitTests.java +++ b/src/test/java/org/springframework/data/repository/support/PaginginAndSortingRepositoryInvokerUnitTests.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. @@ -41,10 +41,7 @@ import org.springframework.format.support.DefaultFormattingConversionService; */ public class PaginginAndSortingRepositoryInvokerUnitTests { - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesFindAllWithPageableByDefault() throws Exception { Repository repository = mock(Repository.class); @@ -54,10 +51,7 @@ public class PaginginAndSortingRepositoryInvokerUnitTests { getInvokerFor(repository, expectInvocationOf(method)).invokeFindAll((Pageable) null); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesFindAllWithSortByDefault() throws Exception { Repository repository = mock(Repository.class); @@ -67,10 +61,7 @@ public class PaginginAndSortingRepositoryInvokerUnitTests { getInvokerFor(repository, expectInvocationOf(method)).invokeFindAll((Sort) null); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesRedeclaredFindAllWithPageable() throws Exception { RepositoryWithRedeclaredFindAllWithPageable repository = mock(RepositoryWithRedeclaredFindAllWithPageable.class); @@ -80,10 +71,7 @@ public class PaginginAndSortingRepositoryInvokerUnitTests { getInvokerFor(repository, expectInvocationOf(method)).invokeFindAll((Pageable) null); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesRedeclaredFindAllWithSort() throws Exception { RepositoryWithRedeclaredFindAllWithSort repository = mock(RepositoryWithRedeclaredFindAllWithSort.class); diff --git a/src/test/java/org/springframework/data/repository/support/ReflectionRepositoryInvokerUnitTests.java b/src/test/java/org/springframework/data/repository/support/ReflectionRepositoryInvokerUnitTests.java index 9c099b243..ab2916793 100644 --- a/src/test/java/org/springframework/data/repository/support/ReflectionRepositoryInvokerUnitTests.java +++ b/src/test/java/org/springframework/data/repository/support/ReflectionRepositoryInvokerUnitTests.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. @@ -68,10 +68,7 @@ public class ReflectionRepositoryInvokerUnitTests { this.conversionService = new DefaultFormattingConversionService(); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesSaveMethodCorrectly() throws Exception { ManualCrudRepository repository = mock(ManualCrudRepository.class); @@ -80,10 +77,7 @@ public class ReflectionRepositoryInvokerUnitTests { getInvokerFor(repository, expectInvocationOf(method)).invokeSave(new Domain()); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesFindOneCorrectly() throws Exception { ManualCrudRepository repository = mock(ManualCrudRepository.class); @@ -93,10 +87,7 @@ public class ReflectionRepositoryInvokerUnitTests { getInvokerFor(repository, expectInvocationOf(method)).invokeFindOne(1L); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesDeleteWithDomainCorrectly() throws Exception { RepoWithDomainDeleteAndFindOne repository = mock(RepoWithDomainDeleteAndFindOne.class); @@ -108,10 +99,7 @@ public class ReflectionRepositoryInvokerUnitTests { getInvokerFor(repository, expectInvocationOf(findOneMethod, deleteMethod)).invokeDelete(1L); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesFindAllWithoutParameterCorrectly() throws Exception { Method method = ManualCrudRepository.class.getMethod("findAll"); @@ -123,10 +111,7 @@ public class ReflectionRepositoryInvokerUnitTests { getInvokerFor(repository, expectInvocationOf(method)).invokeFindAll(new Sort("foo")); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesFindAllWithSortCorrectly() throws Exception { Method method = RepoWithFindAllWithSort.class.getMethod("findAll", Sort.class); @@ -138,10 +123,7 @@ public class ReflectionRepositoryInvokerUnitTests { getInvokerFor(repository, expectInvocationOf(method)).invokeFindAll(new Sort("foo")); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesFindAllWithPageableCorrectly() throws Exception { Method method = RepoWithFindAllWithPageable.class.getMethod("findAll", Pageable.class); @@ -151,10 +133,7 @@ public class ReflectionRepositoryInvokerUnitTests { getInvokerFor(repository, expectInvocationOf(method)).invokeFindAll(new PageRequest(0, 10)); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void invokesQueryMethod() throws Exception { MultiValueMap parameters = new LinkedMultiValueMap(); @@ -166,10 +145,7 @@ public class ReflectionRepositoryInvokerUnitTests { getInvokerFor(repository, expectInvocationOf(method)).invokeQueryMethod(method, parameters, null, null); } - /** - * @see DATACMNS-589 - */ - @Test + @Test // DATACMNS-589 public void considersFormattingAnnotationsOnQueryMethodParameters() throws Exception { MultiValueMap parameters = new LinkedMultiValueMap(); @@ -181,10 +157,7 @@ public class ReflectionRepositoryInvokerUnitTests { getInvokerFor(repository, expectInvocationOf(method)).invokeQueryMethod(method, parameters, null, null); } - /** - * @see DATAREST-335, DATAREST-346, DATACMNS-589 - */ - @Test + @Test // DATAREST-335, DATAREST-346, DATACMNS-589 public void invokesOverriddenDeleteMethodCorrectly() throws Exception { MyRepo repository = mock(MyRepo.class); @@ -193,10 +166,7 @@ public class ReflectionRepositoryInvokerUnitTests { getInvokerFor(repository, expectInvocationOf(method)).invokeDelete("1"); } - /** - * @see DATACMNS-589 - */ - @Test(expected = IllegalStateException.class) + @Test(expected = IllegalStateException.class) // DATACMNS-589 public void rejectsInvocationOfMissingDeleteMethod() { RepositoryInvoker invoker = getInvokerFor(mock(EmptyRepository.class)); @@ -205,10 +175,7 @@ public class ReflectionRepositoryInvokerUnitTests { invoker.invokeDelete(1L); } - /** - * @see DATACMNS-589 - */ - @Test(expected = IllegalStateException.class) + @Test(expected = IllegalStateException.class) // DATACMNS-589 public void rejectsInvocationOfMissingFindOneMethod() { RepositoryInvoker invoker = getInvokerFor(mock(EmptyRepository.class)); @@ -217,10 +184,7 @@ public class ReflectionRepositoryInvokerUnitTests { invoker.invokeFindOne(1L); } - /** - * @see DATACMNS-589 - */ - @Test(expected = IllegalStateException.class) + @Test(expected = IllegalStateException.class) // DATACMNS-589 public void rejectsInvocationOfMissingFindAllMethod() { RepositoryInvoker invoker = getInvokerFor(mock(EmptyRepository.class)); @@ -229,10 +193,7 @@ public class ReflectionRepositoryInvokerUnitTests { invoker.invokeFindAll((Pageable) null); } - /** - * @see DATACMNS-589 - */ - @Test(expected = IllegalStateException.class) + @Test(expected = IllegalStateException.class) // DATACMNS-589 public void rejectsInvocationOfMissingSaveMethod() { RepositoryInvoker invoker = getInvokerFor(mock(EmptyRepository.class)); @@ -241,10 +202,7 @@ public class ReflectionRepositoryInvokerUnitTests { invoker.invokeSave(new Object()); } - /** - * @see DATACMNS-647 - */ - @Test + @Test // DATACMNS-647 public void translatesCollectionRequestParametersCorrectly() throws Exception { for (String[] ids : Arrays.asList(new String[] { "1,2" }, new String[] { "1", "2" })) { @@ -259,10 +217,7 @@ public class ReflectionRepositoryInvokerUnitTests { } } - /** - * @see DATACMNS-700 - */ - @Test + @Test // DATACMNS-700 public void failedParameterConversionCapturesContext() throws Exception { RepositoryInvoker invoker = getInvokerFor(mock(SimpleRepository.class)); diff --git a/src/test/java/org/springframework/data/repository/support/RepositoriesIntegrationTests.java b/src/test/java/org/springframework/data/repository/support/RepositoriesIntegrationTests.java index ce48375b5..751b8edcb 100644 --- a/src/test/java/org/springframework/data/repository/support/RepositoriesIntegrationTests.java +++ b/src/test/java/org/springframework/data/repository/support/RepositoriesIntegrationTests.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. @@ -50,10 +50,7 @@ public class RepositoriesIntegrationTests { assertThat(repositories.hasRepositoryFor(Product.class), is(true)); } - /** - * @see DATACMNS-376 - */ - @Test + @Test // DATACMNS-376 public void returnsPersistentEntityForProxiedClass() { User user = mock(User.class); diff --git a/src/test/java/org/springframework/data/repository/support/RepositoriesUnitTests.java b/src/test/java/org/springframework/data/repository/support/RepositoriesUnitTests.java index 3aac0bbd4..4ac11fafd 100644 --- a/src/test/java/org/springframework/data/repository/support/RepositoriesUnitTests.java +++ b/src/test/java/org/springframework/data/repository/support/RepositoriesUnitTests.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 @@ -99,10 +99,7 @@ public class RepositoriesUnitTests { new Repositories(null); } - /** - * @see DATACMNS-256 - */ - @Test + @Test // DATACMNS-256 public void exposesPersistentEntityForDomainTypes() { Repositories repositories = new Repositories(context); @@ -110,18 +107,12 @@ public class RepositoriesUnitTests { assertThat(repositories.getPersistentEntity(Address.class), is(notNullValue())); } - /** - * @see DATACMNS-634 - */ - @Test + @Test // DATACMNS-634 public void findsRepositoryForSubTypes() { assertThat(new Repositories(context).getPersistentEntity(AdvancedAddress.class), is(notNullValue())); } - /** - * @see DATACMNS-673 - */ - @Test + @Test // DATACMNS-673 public void discoversRepositoryForAlternativeDomainType() { RepositoryMetadata metadata = new CustomRepositoryMetadata(SampleRepository.class); @@ -139,10 +130,7 @@ public class RepositoriesUnitTests { context.close(); } - /** - * @see DATACMNS-794 - */ - @Test + @Test // DATACMNS-794 public void exposesRepositoryFactoryInformationForRepository() { RepositoryInformation information = new Repositories(context).getRepositoryInformation(PersonRepository.class); diff --git a/src/test/java/org/springframework/data/repository/util/ClassUtilsUnitTests.java b/src/test/java/org/springframework/data/repository/util/ClassUtilsUnitTests.java index a6998a6dd..a6a75c986 100644 --- a/src/test/java/org/springframework/data/repository/util/ClassUtilsUnitTests.java +++ b/src/test/java/org/springframework/data/repository/util/ClassUtilsUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2008-2010 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 class ClassUtilsUnitTests { assertFalse(hasProperty(User.class, "address")); } - /** - * @see DATACMNS-769 - */ - @Test + @Test // DATACMNS-769 public void unwrapsWrapperTypesBeforeAssignmentCheck() throws Exception { Method method = UserRepository.class.getMethod("findAsync", Pageable.class); diff --git a/src/test/java/org/springframework/data/repository/util/QueryExecutionConvertersUnitTests.java b/src/test/java/org/springframework/data/repository/util/QueryExecutionConvertersUnitTests.java index a6ae57677..e86f28721 100644 --- a/src/test/java/org/springframework/data/repository/util/QueryExecutionConvertersUnitTests.java +++ b/src/test/java/org/springframework/data/repository/util/QueryExecutionConvertersUnitTests.java @@ -64,10 +64,7 @@ public class QueryExecutionConvertersUnitTests { QueryExecutionConverters.registerConvertersIn(conversionService); } - /** - * @see DATACMNS-714 - */ - @Test + @Test // DATACMNS-714 public void registersWrapperTypes() { assertThat(QueryExecutionConverters.supports(Optional.class), is(true)); @@ -78,10 +75,7 @@ public class QueryExecutionConvertersUnitTests { assertThat(QueryExecutionConverters.supports(javaslang.control.Option.class), is(true)); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void registersReactiveWrapperTypes() { assertThat(QueryExecutionConverters.supports(Publisher.class), is(true)); @@ -97,10 +91,7 @@ public class QueryExecutionConvertersUnitTests { assertThat(QueryExecutionConverters.supports(io.reactivex.Observable.class), is(true)); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void registersUnwrapperTypes() { assertThat(QueryExecutionConverters.supportsUnwrapping(Optional.class), is(true)); @@ -110,10 +101,7 @@ public class QueryExecutionConvertersUnitTests { assertThat(QueryExecutionConverters.supportsUnwrapping(Option.class), is(true)); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void doesNotRegisterReactiveUnwrapperTypes() { assertThat(QueryExecutionConverters.supportsUnwrapping(Publisher.class), is(false)); @@ -129,18 +117,12 @@ public class QueryExecutionConvertersUnitTests { assertThat(QueryExecutionConverters.supportsUnwrapping(io.reactivex.Observable.class), is(false)); } - /** - * @see DATACMNS-714 - */ - @Test + @Test // DATACMNS-714 public void registersCompletableFutureAsWrapperTypeOnSpring42OrBetter() { assertThat(QueryExecutionConverters.supports(CompletableFuture.class), is(true)); } - /** - * @see DATACMNS-483 - */ - @Test + @Test // DATACMNS-483 @SuppressWarnings("unchecked") public void turnsNullIntoGuavaOptional() { @@ -148,10 +130,7 @@ public class QueryExecutionConvertersUnitTests { assertThat(optional, is(Optional. absent())); } - /** - * @see DATACMNS-483 - */ - @Test + @Test // DATACMNS-483 @SuppressWarnings("unchecked") public void turnsNullIntoJdk8Optional() { @@ -160,10 +139,7 @@ public class QueryExecutionConvertersUnitTests { assertThat(optional, is(java.util.Optional. empty())); } - /** - * @see DATACMNS-714 - */ - @Test + @Test // DATACMNS-714 @SuppressWarnings("unchecked") public void turnsNullIntoCompletableFutureForNull() throws Exception { @@ -174,42 +150,27 @@ public class QueryExecutionConvertersUnitTests { assertThat(result.get(), is(nullValue())); } - /** - * @see DATACMNS-768 - */ - @Test + @Test // DATACMNS-768 public void unwrapsJdk8Optional() { assertThat(QueryExecutionConverters.unwrap(java.util.Optional.of("Foo")), is((Object) "Foo")); } - /** - * @see DATACMNS-768 - */ - @Test + @Test // DATACMNS-768 public void unwrapsGuava8Optional() { assertThat(QueryExecutionConverters.unwrap(Optional.of("Foo")), is((Object) "Foo")); } - /** - * @see DATACMNS-768 - */ - @Test + @Test // DATACMNS-768 public void unwrapsNullToNull() { assertThat(QueryExecutionConverters.unwrap(null), is(nullValue())); } - /** - * @see DATACMNS-768 - */ - @Test + @Test // DATACMNS-768 public void unwrapsNonWrapperTypeToItself() { assertThat(QueryExecutionConverters.unwrap("Foo"), is((Object) "Foo")); } - /** - * @see DATACMNS-795 - */ - @Test + @Test // DATACMNS-795 @SuppressWarnings("unchecked") public void turnsNullIntoScalaOptionEmpty() { @@ -217,35 +178,23 @@ public class QueryExecutionConvertersUnitTests { is(Option. empty())); } - /** - * @see DATACMNS-795 - */ - @Test + @Test // DATACMNS-795 public void unwrapsScalaOption() { assertThat(QueryExecutionConverters.unwrap(Option.apply("foo")), is((Object) "foo")); } - /** - * @see DATACMNS-874 - */ - @Test + @Test // DATACMNS-874 public void unwrapsEmptyScalaOption() { assertThat(QueryExecutionConverters.unwrap(Option.empty()), is((Object) null)); } - /** - * @see DATACMNS-937 - */ - @Test + @Test // DATACMNS-937 public void turnsNullIntoJavaslangOption() { assertThat(conversionService.convert(new NullableWrapper(null), javaslang.control.Option.class), is((Object) optionNone())); } - /** - * @see DATACMNS-937 - */ - @Test + @Test // DATACMNS-937 public void wrapsValueIntoJavaslangOption() { javaslang.control.Option result = conversionService.convert(new NullableWrapper("string"), @@ -255,26 +204,17 @@ public class QueryExecutionConvertersUnitTests { assertThat(result.get(), is((Object) "string")); } - /** - * @see DATACMNS-937 - */ - @Test + @Test // DATACMNS-937 public void unwrapsEmptyJavaslangOption() { assertThat(QueryExecutionConverters.unwrap(optionNone()), is(nullValue())); } - /** - * @see DATACMNS-937 - */ - @Test + @Test // DATACMNS-937 public void unwrapsJavaslangOption() { assertThat(QueryExecutionConverters.unwrap(option("string")), is((Object) "string")); } - /** - * @see DATACMNS-940 - */ - @Test + @Test // DATACMNS-940 public void conversListToJavaslang() { assertThat(conversionService.canConvert(List.class, javaslang.collection.Traversable.class), is(true)); @@ -289,10 +229,7 @@ public class QueryExecutionConvertersUnitTests { assertThat(result, is(instanceOf(javaslang.collection.List.class))); } - /** - * @see DATACMNS-940 - */ - @Test + @Test // DATACMNS-940 public void convertsSetToJavaslang() { assertThat(conversionService.canConvert(Set.class, javaslang.collection.Traversable.class), is(true)); @@ -307,10 +244,7 @@ public class QueryExecutionConvertersUnitTests { assertThat(result, is(instanceOf(javaslang.collection.Set.class))); } - /** - * @see DATACMNS-940 - */ - @Test + @Test // DATACMNS-940 public void convertsMapToJavaslang() { assertThat(conversionService.canConvert(Map.class, javaslang.collection.Traversable.class), is(true)); @@ -325,10 +259,7 @@ public class QueryExecutionConvertersUnitTests { assertThat(result, is(instanceOf(javaslang.collection.Map.class))); } - /** - * @see DATACMNS-940 - */ - @Test + @Test // DATACMNS-940 public void unwrapsJavaslangCollectionsToJavaOnes() { assertThat(unwrap(javaslangList(1, 2, 3)), is(instanceOf(List.class))); diff --git a/src/test/java/org/springframework/data/repository/util/ReactiveWrapperConvertersUnitTests.java b/src/test/java/org/springframework/data/repository/util/ReactiveWrapperConvertersUnitTests.java index 7f6e098ba..300709ca1 100644 --- a/src/test/java/org/springframework/data/repository/util/ReactiveWrapperConvertersUnitTests.java +++ b/src/test/java/org/springframework/data/repository/util/ReactiveWrapperConvertersUnitTests.java @@ -34,10 +34,7 @@ import rx.Single; */ public class ReactiveWrapperConvertersUnitTests { - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void shouldSupportReactorTypes() { assertThat(ReactiveWrapperConverters.supports(Mono.class)).isTrue(); @@ -46,10 +43,7 @@ public class ReactiveWrapperConvertersUnitTests { assertThat(ReactiveWrapperConverters.supports(Object.class)).isFalse(); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void shouldSupportRxJava1Types() { assertThat(ReactiveWrapperConverters.supports(Single.class)).isTrue(); @@ -57,10 +51,7 @@ public class ReactiveWrapperConvertersUnitTests { assertThat(ReactiveWrapperConverters.supports(Completable.class)).isTrue(); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void shouldSupportRxJava2Types() { assertThat(ReactiveWrapperConverters.supports(io.reactivex.Single.class)).isTrue(); @@ -70,30 +61,21 @@ public class ReactiveWrapperConvertersUnitTests { assertThat(ReactiveWrapperConverters.supports(io.reactivex.Completable.class)).isTrue(); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldCastMonoToMono() { Mono foo = Mono.just("foo"); assertThat(ReactiveWrapperConverters.toWrapper(foo, Mono.class)).isSameAs(foo); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldConvertMonoToRxJava1Single() { Mono foo = Mono.just("foo"); assertThat(ReactiveWrapperConverters.toWrapper(foo, Single.class)).isInstanceOf(Single.class); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldConvertMonoToRxJava2Single() { Mono foo = Mono.just("foo"); @@ -101,110 +83,77 @@ public class ReactiveWrapperConvertersUnitTests { .isInstanceOf(io.reactivex.Single.class); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldConvertRxJava2SingleToMono() { io.reactivex.Single foo = io.reactivex.Single.just("foo"); assertThat(ReactiveWrapperConverters.toWrapper(foo, Mono.class)).isInstanceOf(Mono.class); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldConvertRxJava2SingleToPublisher() { io.reactivex.Single foo = io.reactivex.Single.just("foo"); assertThat(ReactiveWrapperConverters.toWrapper(foo, Publisher.class)).isInstanceOf(Publisher.class); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldConvertRxJava2MaybeToMono() { io.reactivex.Maybe foo = io.reactivex.Maybe.just("foo"); assertThat(ReactiveWrapperConverters.toWrapper(foo, Mono.class)).isInstanceOf(Mono.class); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldConvertRxJava2MaybeToFlux() { io.reactivex.Maybe foo = io.reactivex.Maybe.just("foo"); assertThat(ReactiveWrapperConverters.toWrapper(foo, Flux.class)).isInstanceOf(Flux.class); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldConvertRxJava2MaybeToPublisher() { io.reactivex.Maybe foo = io.reactivex.Maybe.just("foo"); assertThat(ReactiveWrapperConverters.toWrapper(foo, Publisher.class)).isInstanceOf(Publisher.class); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldConvertRxJava2FlowableToMono() { io.reactivex.Flowable foo = io.reactivex.Flowable.just("foo"); assertThat(ReactiveWrapperConverters.toWrapper(foo, Mono.class)).isInstanceOf(Mono.class); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldConvertRxJava2FlowableToFlux() { io.reactivex.Flowable foo = io.reactivex.Flowable.just("foo"); assertThat(ReactiveWrapperConverters.toWrapper(foo, Flux.class)).isInstanceOf(Flux.class); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldCastRxJava2FlowableToPublisher() { io.reactivex.Flowable foo = io.reactivex.Flowable.just("foo"); assertThat(ReactiveWrapperConverters.toWrapper(foo, Publisher.class)).isSameAs(foo); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldConvertRxJava2ObservableToMono() { io.reactivex.Observable foo = io.reactivex.Observable.just("foo"); assertThat(ReactiveWrapperConverters.toWrapper(foo, Mono.class)).isInstanceOf(Mono.class); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldConvertRxJava2ObservableToFlux() { io.reactivex.Observable foo = io.reactivex.Observable.just("foo"); assertThat(ReactiveWrapperConverters.toWrapper(foo, Flux.class)).isInstanceOf(Flux.class); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldConvertRxJava2ObservableToSingle() { io.reactivex.Observable foo = io.reactivex.Observable.just("foo"); @@ -212,40 +161,28 @@ public class ReactiveWrapperConvertersUnitTests { .isInstanceOf(io.reactivex.Single.class); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldConvertRxJava2ObservableToMaybe() { io.reactivex.Observable foo = io.reactivex.Observable.empty(); assertThat(ReactiveWrapperConverters.toWrapper(foo, Maybe.class)).isInstanceOf(Maybe.class); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldConvertRxJava2ObservableToPublisher() { io.reactivex.Observable foo = io.reactivex.Observable.just("foo"); assertThat(ReactiveWrapperConverters.toWrapper(foo, Publisher.class)).isInstanceOf(Publisher.class); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void toWrapperShouldConvertMonoToFlux() { Mono foo = Mono.just("foo"); assertThat(ReactiveWrapperConverters.toWrapper(foo, Flux.class)).isInstanceOf(Flux.class); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void shouldMapMono() { Mono foo = Mono.just("foo"); @@ -253,10 +190,7 @@ public class ReactiveWrapperConvertersUnitTests { assertThat(map.block()).isEqualTo(1L); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void shouldMapFlux() { Flux foo = Flux.just("foo"); @@ -264,10 +198,7 @@ public class ReactiveWrapperConvertersUnitTests { assertThat(map.next().block()).isEqualTo(1L); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void shouldMapRxJava1Single() { Single foo = Single.just("foo"); @@ -275,10 +206,7 @@ public class ReactiveWrapperConvertersUnitTests { assertThat(map.toBlocking().value()).isEqualTo(1L); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void shouldMapRxJava1Observable() { Observable foo = Observable.just("foo"); @@ -286,10 +214,7 @@ public class ReactiveWrapperConvertersUnitTests { assertThat(map.toBlocking().first()).isEqualTo(1L); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void shouldMapRxJava2Single() { io.reactivex.Single foo = io.reactivex.Single.just("foo"); @@ -297,10 +222,7 @@ public class ReactiveWrapperConvertersUnitTests { assertThat(map.blockingGet()).isEqualTo(1L); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void shouldMapRxJava2Maybe() { io.reactivex.Maybe foo = io.reactivex.Maybe.just("foo"); @@ -308,10 +230,7 @@ public class ReactiveWrapperConvertersUnitTests { assertThat(map.toSingle().blockingGet()).isEqualTo(1L); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void shouldMapRxJava2Observable() { io.reactivex.Observable foo = io.reactivex.Observable.just("foo"); @@ -319,10 +238,7 @@ public class ReactiveWrapperConvertersUnitTests { assertThat(map.blockingFirst()).isEqualTo(1L); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void shouldMapRxJava2Flowable() { io.reactivex.Flowable foo = io.reactivex.Flowable.just("foo"); diff --git a/src/test/java/org/springframework/data/repository/util/ReactiveWrappersUnitTests.java b/src/test/java/org/springframework/data/repository/util/ReactiveWrappersUnitTests.java index 54a8a0657..78c4ff548 100644 --- a/src/test/java/org/springframework/data/repository/util/ReactiveWrappersUnitTests.java +++ b/src/test/java/org/springframework/data/repository/util/ReactiveWrappersUnitTests.java @@ -33,10 +33,7 @@ import rx.Single; */ public class ReactiveWrappersUnitTests { - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void isSingleLikeShouldReportCorrectNoTypes() { assertThat(ReactiveWrappers.isNoValueType(Mono.class)).isFalse(); @@ -51,10 +48,7 @@ public class ReactiveWrappersUnitTests { assertThat(ReactiveWrappers.isNoValueType(io.reactivex.Observable.class)).isFalse(); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void isSingleLikeShouldReportCorrectSingleTypes() { assertThat(ReactiveWrappers.isSingleValueType(Mono.class)).isTrue(); @@ -70,10 +64,7 @@ public class ReactiveWrappersUnitTests { assertThat(ReactiveWrappers.isSingleValueType(io.reactivex.Observable.class)).isFalse(); } - /** - * @see DATACMNS-836 - */ - @Test + @Test // DATACMNS-836 public void isCollectionLikeShouldReportCorrectCollectionTypes() { assertThat(ReactiveWrappers.isMultiValueType(Mono.class)).isFalse(); diff --git a/src/test/java/org/springframework/data/util/AnnotatedTypeScannerUnitTests.java b/src/test/java/org/springframework/data/util/AnnotatedTypeScannerUnitTests.java index a7d81d098..8a3a1fe23 100644 --- a/src/test/java/org/springframework/data/util/AnnotatedTypeScannerUnitTests.java +++ b/src/test/java/org/springframework/data/util/AnnotatedTypeScannerUnitTests.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. @@ -30,10 +30,7 @@ import org.springframework.data.annotation.Persistent; */ public class AnnotatedTypeScannerUnitTests { - /** - * @see DATACMNS-452 - */ - @Test + @Test // DATACMNS-452 @SuppressWarnings("unchecked") public void findsAnnotatedTypes() { diff --git a/src/test/java/org/springframework/data/util/AnnotationDetectionFieldCallbackUnitTests.java b/src/test/java/org/springframework/data/util/AnnotationDetectionFieldCallbackUnitTests.java index d5b73af2e..ba335fb99 100644 --- a/src/test/java/org/springframework/data/util/AnnotationDetectionFieldCallbackUnitTests.java +++ b/src/test/java/org/springframework/data/util/AnnotationDetectionFieldCallbackUnitTests.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. @@ -29,18 +29,12 @@ import org.springframework.util.ReflectionUtils; */ public class AnnotationDetectionFieldCallbackUnitTests { - /** - * @see DATACMNS-616 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-616 public void rejectsNullAnnotationType() { new AnnotationDetectionFieldCallback(null); } - /** - * @see DATACMNS-616 - */ - @Test + @Test // DATACMNS-616 @SuppressWarnings("rawtypes") public void looksUpValueFromPrivateField() { @@ -51,10 +45,7 @@ public class AnnotationDetectionFieldCallbackUnitTests { assertThat(callback.getValue(new Sample("foo")), is((Object) "foo")); } - /** - * @see DATACMNS-616 - */ - @Test + @Test // DATACMNS-616 public void returnsNullForObjectNotContainingAFieldWithTheConfiguredAnnotation() { AnnotationDetectionFieldCallback callback = new AnnotationDetectionFieldCallback(Autowired.class); diff --git a/src/test/java/org/springframework/data/util/AnnotationDetectionMethodCallbackUnitTests.java b/src/test/java/org/springframework/data/util/AnnotationDetectionMethodCallbackUnitTests.java index eb8e72ebc..0fa91ab65 100644 --- a/src/test/java/org/springframework/data/util/AnnotationDetectionMethodCallbackUnitTests.java +++ b/src/test/java/org/springframework/data/util/AnnotationDetectionMethodCallbackUnitTests.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. @@ -33,10 +33,7 @@ public class AnnotationDetectionMethodCallbackUnitTests { public @Rule ExpectedException exception = ExpectedException.none(); - /** - * @see DATACMNS-452 - */ - @Test + @Test // DATACMNS-452 public void findsMethodWithAnnotation() throws Exception { AnnotationDetectionMethodCallback callback = new AnnotationDetectionMethodCallback(Value.class); @@ -48,10 +45,7 @@ public class AnnotationDetectionMethodCallbackUnitTests { assertThat(callback.getAnnotation().value(), is("#{null}")); } - /** - * @see DATACMNS-452 - */ - @Test + @Test // DATACMNS-452 public void detectsAmbiguousAnnotations() { exception.expect(IllegalStateException.class); diff --git a/src/test/java/org/springframework/data/util/ClassTypeInformationUnitTests.java b/src/test/java/org/springframework/data/util/ClassTypeInformationUnitTests.java index 2d1405efa..43ce4dea0 100644 --- a/src/test/java/org/springframework/data/util/ClassTypeInformationUnitTests.java +++ b/src/test/java/org/springframework/data/util/ClassTypeInformationUnitTests.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. @@ -148,20 +148,14 @@ public class ClassTypeInformationUnitTests { assertThat(property.getType(), is(typeCompatibleWith(byte[].class))); } - /** - * @see DATACMNS-77 - */ - @Test + @Test // DATACMNS-77 public void returnsSameInstanceForCachedClass() { TypeInformation info = ClassTypeInformation.from(PropertyGetter.class); assertThat(ClassTypeInformation.from(PropertyGetter.class), is(sameInstance(info))); } - /** - * @see DATACMNS-39 - */ - @Test + @Test // DATACMNS-39 public void resolvesWildCardTypeCorrectly() { TypeInformation information = ClassTypeInformation.from(ClassWithWildCardBound.class); @@ -267,10 +261,7 @@ public class ClassTypeInformationUnitTests { assertThat(information.getActualType().getActualType().getType(), is((Object) String.class)); } - /** - * @see DATACMNS-309 - */ - @Test + @Test // DATACMNS-309 @SuppressWarnings("rawtypes") public void findsGetterOnInterface() { @@ -281,28 +272,19 @@ public class ClassTypeInformationUnitTests { assertThat(categoryIdInfo, is((TypeInformation) from(Long.class))); } - /** - * @see DATACMNS-387 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-387 public void rejectsNullClass() { from(null); } - /** - * @see DATACMNS-422 - */ - @Test + @Test // DATACMNS-422 public void returnsNullForRawTypesOnly() { assertThat(from(MyRawIterable.class).getComponentType(), is(nullValue())); assertThat(from(MyIterable.class).getComponentType(), is(notNullValue())); } - /** - * @see DATACMNS-440 - */ - @Test + @Test // DATACMNS-440 public void detectsSpecialMapAsMapValueType() { TypeInformation information = ClassTypeInformation.from(SuperGenerics.class); @@ -319,20 +301,14 @@ public class ClassTypeInformationUnitTests { assertThat(nestedValueType.getComponentType().getType(), is((Object) Person.class)); } - /** - * @see DATACMNS-446 - */ - @Test + @Test // DATACMNS-446 public void createsToStringRepresentation() { assertThat(from(SpecialPerson.class).toString(), is("org.springframework.data.util.ClassTypeInformationUnitTests$SpecialPerson")); } - /** - * @see DATACMNS-590 - */ - @Test + @Test // DATACMNS-590 public void resolvesNestedGenericsToConcreteType() { ClassTypeInformation rootType = from(ConcreteRoot.class); @@ -343,10 +319,7 @@ public class ClassTypeInformationUnitTests { assertThat(subSubType.getType(), is((Object) ConcreteSubSub.class)); } - /** - * @see DATACMNS-594 - */ - @Test + @Test // DATACMNS-594 public void considersGenericsOfTypeBounds() { ClassTypeInformation customer = ClassTypeInformation.from(ConcreteRootIntermediate.class); @@ -355,11 +328,7 @@ public class ClassTypeInformationUnitTests { assertThat(leafType.getType(), is((Object) Leaf.class)); } - /** - * @see DATACMNS-783 - * @see DATACMNS-853 - */ - @Test + @Test // DATACMNS-783, DATACMNS-853 public void specializesTypeUsingTypeVariableContext() { ClassTypeInformation root = ClassTypeInformation.from(Foo.class); @@ -372,10 +341,7 @@ public class ClassTypeInformationUnitTests { assertThat(specialized.getProperty("anotherField").getType(), is((Object) Integer.class)); } - /** - * @see DATACMNS-783 - */ - @Test + @Test // DATACMNS-783 @SuppressWarnings("rawtypes") public void usesTargetTypeDirectlyIfNoGenericsAreInvolved() { @@ -386,10 +352,7 @@ public class ClassTypeInformationUnitTests { assertThat(property.specialize(from), is((TypeInformation) from)); } - /** - * @see DATACMNS-855 - */ - @Test + @Test // DATACMNS-855 @SuppressWarnings("rawtypes") public void specializedTypeEqualsAndHashCode() { @@ -404,10 +367,7 @@ public class ClassTypeInformationUnitTests { assertThat(left.hashCode(), is(right.hashCode())); } - /** - * @see DATACMNS-896 - */ - @Test + @Test // DATACMNS-896 public void prefersLocalTypeMappingOverNestedWithSameGenericType() { ClassTypeInformation information = ClassTypeInformation.from(Concrete.class); @@ -415,10 +375,7 @@ public class ClassTypeInformationUnitTests { assertThat(information.getProperty("field").getType(), is(typeCompatibleWith(Nested.class))); } - /** - * @see DATACMNS-940 - */ - @Test + @Test // DATACMNS-940 public void detectsJavaslangTraversableComponentType() { ClassTypeInformation information = ClassTypeInformation.from(SampleTraversable.class); @@ -426,10 +383,7 @@ public class ClassTypeInformationUnitTests { assertThat(information.getComponentType().getType(), is(typeCompatibleWith(Integer.class))); } - /** - * @see DATACMNS-940 - */ - @Test + @Test // DATACMNS-940 public void detectsJavaslangMapComponentAndValueType() { ClassTypeInformation information = ClassTypeInformation.from(SampleMap.class); diff --git a/src/test/java/org/springframework/data/util/DataCmns511Tests.java b/src/test/java/org/springframework/data/util/DataCmns511Tests.java index 006dcd9aa..ae1e1037c 100644 --- a/src/test/java/org/springframework/data/util/DataCmns511Tests.java +++ b/src/test/java/org/springframework/data/util/DataCmns511Tests.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. @@ -30,10 +30,7 @@ import org.junit.Test; */ public class DataCmns511Tests { - /** - * @see DATACMNS-511 - */ - @Test + @Test // DATACMNS-511 @SuppressWarnings("rawtypes") public void detectsEqualTypeVariableTypeInformationInstances() { diff --git a/src/test/java/org/springframework/data/util/DirectFieldAccessFallbackBeanWrapperUnitTests.java b/src/test/java/org/springframework/data/util/DirectFieldAccessFallbackBeanWrapperUnitTests.java index 74b165f3d..73eb649df 100644 --- a/src/test/java/org/springframework/data/util/DirectFieldAccessFallbackBeanWrapperUnitTests.java +++ b/src/test/java/org/springframework/data/util/DirectFieldAccessFallbackBeanWrapperUnitTests.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. @@ -30,10 +30,7 @@ import org.springframework.beans.NotWritablePropertyException; */ public class DirectFieldAccessFallbackBeanWrapperUnitTests { - /** - * @see DATACMNS-452 - */ - @Test + @Test // DATACMNS-452 public void usesFieldAccessForReadIfNoAccessorCanBeFound() { Sample sample = new Sample(); @@ -44,10 +41,7 @@ public class DirectFieldAccessFallbackBeanWrapperUnitTests { assertThat(wrapper.getPropertyValue("firstname"), is((Object) "Dave")); } - /** - * @see DATACMNS-452 - */ - @Test + @Test // DATACMNS-452 public void usesFieldAccessForWriteIfNoAccessorCanBeFound() { Sample sample = new Sample(); @@ -58,20 +52,14 @@ public class DirectFieldAccessFallbackBeanWrapperUnitTests { assertThat(sample.firstname, is("Dave")); } - /** - * @see DATACMNS-452 - */ - @Test(expected = NotReadablePropertyException.class) + @Test(expected = NotReadablePropertyException.class) // DATACMNS-452 public void throwsAppropriateExceptionIfNoFieldFoundForRead() { BeanWrapper wrapper = new DirectFieldAccessFallbackBeanWrapper(new Sample()); wrapper.getPropertyValue("lastname"); } - /** - * @see DATACMNS-452 - */ - @Test(expected = NotWritablePropertyException.class) + @Test(expected = NotWritablePropertyException.class) // DATACMNS-452 public void throwsAppropriateExceptionIfNoFieldFoundForWrite() { BeanWrapper wrapper = new DirectFieldAccessFallbackBeanWrapper(new Sample()); diff --git a/src/test/java/org/springframework/data/util/PairUnitTests.java b/src/test/java/org/springframework/data/util/PairUnitTests.java index b29651bc9..a05c0a869 100644 --- a/src/test/java/org/springframework/data/util/PairUnitTests.java +++ b/src/test/java/org/springframework/data/util/PairUnitTests.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. @@ -27,10 +27,7 @@ import org.junit.Test; */ public class PairUnitTests { - /** - * @see DATACMNS-790 - */ - @Test + @Test // DATACMNS-790 public void setsUpSimpleInstance() { Pair pair = Pair.of(1, 2); @@ -39,26 +36,17 @@ public class PairUnitTests { assertThat(pair.getSecond(), is(2)); } - /** - * @see DATACMNS-790 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-790 public void rejectsNullFirstElement() { Pair.of(null, 1); } - /** - * @see DATACMNS-790 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-790 public void rejectsNullSecondElement() { Pair.of(1, null); } - /** - * @see DATACMNS-790 - */ - @Test + @Test // DATACMNS-790 public void hasCorrectEquals() { Pair first = Pair.of(1, 2); @@ -69,10 +57,7 @@ public class PairUnitTests { assertThat(second, is(first)); } - /** - * @see DATACMNS-790 - */ - @Test + @Test // DATACMNS-790 public void hasCorrectHashCode() { Pair first = Pair.of(1, 2); diff --git a/src/test/java/org/springframework/data/util/ParameterizedTypeUnitTests.java b/src/test/java/org/springframework/data/util/ParameterizedTypeUnitTests.java index a75b4d618..79528491b 100644 --- a/src/test/java/org/springframework/data/util/ParameterizedTypeUnitTests.java +++ b/src/test/java/org/springframework/data/util/ParameterizedTypeUnitTests.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. @@ -76,10 +76,7 @@ public class ParameterizedTypeUnitTests { assertTrue(first.equals(second)); } - /** - * @see DATACMNS-88 - */ - @Test + @Test // DATACMNS-88 public void resolvesMapValueTypeCorrectly() { TypeInformation type = ClassTypeInformation.from(Foo.class); @@ -92,20 +89,14 @@ public class ParameterizedTypeUnitTests { assertThat(propertyType.getMapValueType().getType(), is(typeCompatibleWith(Locale.class))); } - /** - * @see DATACMNS-446 - */ - @Test + @Test // DATACMNS-446 public void createsToStringRepresentation() { assertThat(from(Foo.class).getProperty("param").toString(), is("org.springframework.data.util.ParameterizedTypeUnitTests$Localized")); } - /** - * @see DATACMNS-485 - */ - @Test + @Test // DATACMNS-485 @SuppressWarnings("rawtypes") public void hashCodeShouldBeConsistentWithEqualsForResolvedTypes() { @@ -116,10 +107,7 @@ public class ParameterizedTypeUnitTests { assertThat(first.hashCode(), is(second.hashCode())); } - /** - * @see DATACMNS-485 - */ - @Test + @Test // DATACMNS-485 @SuppressWarnings("rawtypes") public void getActualTypeShouldNotUnwrapParameterizedTypes() { @@ -127,10 +115,7 @@ public class ParameterizedTypeUnitTests { assertThat(type.getActualType(), is(type)); } - /** - * @see DATACMNS-697 - */ - @Test + @Test // DATACMNS-697 public void usesLocalGenericInformationOfFields() { TypeInformation information = ClassTypeInformation.from(NormalizedProfile.class); @@ -138,10 +123,7 @@ public class ParameterizedTypeUnitTests { assertThat(valueType.getProperty("value").getType(), is(typeCompatibleWith(Education.class))); } - /** - * @see DATACMNS-899 - */ - @Test + @Test // DATACMNS-899 public void returnsNullMapValueTypeForNonMapProperties(){ TypeInformation valueType = ClassTypeInformation.from(Bar.class).getProperty("param"); diff --git a/src/test/java/org/springframework/data/util/ParsingUtilsUnitTests.java b/src/test/java/org/springframework/data/util/ParsingUtilsUnitTests.java index 1b1a24c75..ce077a7b1 100644 --- a/src/test/java/org/springframework/data/util/ParsingUtilsUnitTests.java +++ b/src/test/java/org/springframework/data/util/ParsingUtilsUnitTests.java @@ -1,6 +1,6 @@ /* - * Copyright 2014 the original author or authors. - * Copyright 2014 the original author or authors. + * Copyright 2014-2017 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. @@ -30,10 +30,7 @@ import org.junit.Test; */ public class ParsingUtilsUnitTests { - /** - * @see DATCMNS-486 - */ - @Test + @Test // DATCMNS-486 public void splitsCamelCaseWithAllSortsOfCharacters() { String sample = "prefix" + "이름" // @@ -55,10 +52,7 @@ public class ParsingUtilsUnitTests { "suffix")); } - /** - * @see DATCMNS-486 - */ - @Test + @Test // DATCMNS-486 public void reconcatenatesCamelCaseString() { assertThat(ParsingUtils.reconcatenateCamelCase("myCamelCase", "-"), is("my-camel-case")); } diff --git a/src/test/java/org/springframework/data/util/ReflectionUtilsUnitTests.java b/src/test/java/org/springframework/data/util/ReflectionUtilsUnitTests.java index a0cbc89e5..2b53df87d 100644 --- a/src/test/java/org/springframework/data/util/ReflectionUtilsUnitTests.java +++ b/src/test/java/org/springframework/data/util/ReflectionUtilsUnitTests.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. @@ -87,34 +87,22 @@ public class ReflectionUtilsUnitTests { assertThat(sample.first, is("foo")); } - /** - * @see DATACMNS-542 - */ - @Test + @Test // DATACMNS-542 public void detectsConstructorForCompleteMatch() throws Exception { assertThat(ReflectionUtils.findConstructor(ConstructorDetection.class, 2, "test"), is(constructor)); } - /** - * @see DATACMNS-542 - */ - @Test + @Test // DATACMNS-542 public void detectsConstructorForMatchWithNulls() throws Exception { assertThat(ReflectionUtils.findConstructor(ConstructorDetection.class, 2, null), is(constructor)); } - /** - * @see DATACMNS-542 - */ - @Test + @Test // DATACMNS-542 public void rejectsConstructorIfNumberOfArgumentsDontMatch() throws Exception { assertThat(ReflectionUtils.findConstructor(ConstructorDetection.class, 2, "test", "test"), is(nullValue())); } - /** - * @see DATACMNS-542 - */ - @Test + @Test // DATACMNS-542 public void rejectsConstructorForNullForPrimitiveArgument() throws Exception { assertThat(ReflectionUtils.findConstructor(ConstructorDetection.class, null, "test"), is(nullValue())); } diff --git a/src/test/java/org/springframework/data/util/StreamUtilsTests.java b/src/test/java/org/springframework/data/util/StreamUtilsTests.java index 51631b99c..5cca0989e 100644 --- a/src/test/java/org/springframework/data/util/StreamUtilsTests.java +++ b/src/test/java/org/springframework/data/util/StreamUtilsTests.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. @@ -34,10 +34,7 @@ import org.junit.Test; */ public class StreamUtilsTests { - /** - * @see DATACMNS-650 - */ - @Test + @Test // DATACMNS-650 public void shouldConvertAnIteratorToAStream() { List input = Arrays.asList("a", "b", "c"); diff --git a/src/test/java/org/springframework/data/util/TypeDiscovererUnitTests.java b/src/test/java/org/springframework/data/util/TypeDiscovererUnitTests.java index 59800c888..57b6332a5 100644 --- a/src/test/java/org/springframework/data/util/TypeDiscovererUnitTests.java +++ b/src/test/java/org/springframework/data/util/TypeDiscovererUnitTests.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. @@ -115,10 +115,7 @@ public class TypeDiscovererUnitTests { assertEquals(String.class, discoverer.getComponentType().getType()); } - /** - * @see DATACMNS-57 - */ - @Test + @Test // DATACMNS-57 @SuppressWarnings("rawtypes") public void discoveresConstructorParameterTypesCorrectly() throws NoSuchMethodException, SecurityException { @@ -142,10 +139,7 @@ public class TypeDiscovererUnitTests { assertThat(discoverer.getMapValueType(), is(nullValue())); } - /** - * @see DATACMNS-167 - */ - @Test + @Test // DATACMNS-167 @SuppressWarnings("rawtypes") public void doesNotConsiderTypeImplementingIterableACollection() { diff --git a/src/test/java/org/springframework/data/util/VersionUnitTests.java b/src/test/java/org/springframework/data/util/VersionUnitTests.java index 7e45c9d3d..52f0f2388 100644 --- a/src/test/java/org/springframework/data/util/VersionUnitTests.java +++ b/src/test/java/org/springframework/data/util/VersionUnitTests.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 @@ public class VersionUnitTests { public @Rule ExpectedException exception = ExpectedException.none(); - /** - * @see DATCMNS-384 - */ - @Test + @Test // DATCMNS-384 public void sameVersionsEqualOneDigits() { Version first = new Version(6); @@ -45,10 +42,7 @@ public class VersionUnitTests { assertThat(second, is(first)); } - /** - * @see DATCMNS-384 - */ - @Test + @Test // DATCMNS-384 public void sameVersionsEqualTwoDigits() { Version first = new Version(5, 2); @@ -58,10 +52,7 @@ public class VersionUnitTests { assertThat(second, is(first)); } - /** - * @see DATCMNS-384 - */ - @Test + @Test // DATCMNS-384 public void sameVersionsEqualThreeDigits() { Version first = new Version(1, 2, 3); @@ -71,10 +62,7 @@ public class VersionUnitTests { assertThat(second, is(first)); } - /** - * @see DATCMNS-384 - */ - @Test + @Test // DATCMNS-384 public void sameVersionsEqualFourDigits() { Version first = new Version(1, 2, 3, 1000); @@ -84,50 +72,35 @@ public class VersionUnitTests { assertThat(second, is(first)); } - /** - * @see DATCMNS-384 - */ - @Test + @Test // DATCMNS-384 public void parsesVersionCorrectlyOneDigits() { Version version = Version.parse("5"); assertThat(version, is(new Version(5))); } - /** - * @see DATCMNS-384 - */ - @Test + @Test // DATCMNS-384 public void parsesVersionCorrectlyTwoDigits() { Version version = Version.parse("5.2"); assertThat(version, is(new Version(5, 2))); } - /** - * @see DATCMNS-384 - */ - @Test + @Test // DATCMNS-384 public void parsesVersionCorrectlyThreeDigits() { Version version = Version.parse("12.1.3"); assertThat(version, is(new Version(12, 1, 3))); } - /** - * @see DATCMNS-384 - */ - @Test + @Test // DATCMNS-384 public void parsesVersionCorrectlyFourDigits() { Version version = Version.parse("12.1.3.1000"); assertThat(version, is(new Version(12, 1, 3, 1000))); } - /** - * @see DATCMNS-384 - */ - @Test + @Test // DATCMNS-384 public void comparesToCorrectly() { Version version = new Version(1, 2, 3, 1000); @@ -159,10 +132,7 @@ public class VersionUnitTests { assertThat(nextBuild.compareTo(version), is(greaterThan(0))); } - /** - * @see DATCMNS-384 - */ - @Test + @Test // DATCMNS-384 public void removesTrailingZerosAfterSecondValueForToString() { assertThat(new Version(2).toString(), is("2.0")); @@ -174,26 +144,17 @@ public class VersionUnitTests { assertThat(new Version(2, 0, 0, 1).toString(), is("2.0.0.1")); } - /** - * @see DATACMNS-496 - */ - @Test + @Test // DATACMNS-496 public void parseShouldRemoveNonNumericVersionParts() { assertThat(Version.parse("2.0.0-rc1"), is(new Version(2, 0, 0))); } - /** - * @see DATACMNS-719, DATACMNS-496 - */ - @Test + @Test // DATACMNS-719, DATACMNS-496 public void removesNonNumericSuffix() { assertThat(Version.parse("4.2.0.RELEASE"), is(new Version(4, 2, 0))); } - /** - * @see DATACMNS-719, DATACMNS-496 - */ - @Test + @Test // DATACMNS-719, DATACMNS-496 public void rejectsNonNumericPartOnNonLastPosition() { exception.expect(IllegalArgumentException.class); diff --git a/src/test/java/org/springframework/data/web/HateoasPageableHandlerMethodArgumentResolverUnitTests.java b/src/test/java/org/springframework/data/web/HateoasPageableHandlerMethodArgumentResolverUnitTests.java index 5cf7628c0..bf3a16765 100644 --- a/src/test/java/org/springframework/data/web/HateoasPageableHandlerMethodArgumentResolverUnitTests.java +++ b/src/test/java/org/springframework/data/web/HateoasPageableHandlerMethodArgumentResolverUnitTests.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. @@ -47,10 +47,7 @@ public class HateoasPageableHandlerMethodArgumentResolverUnitTests extends assertUriStringFor(REFERENCE_WITH_SORT_FIELDS, basicString + "&sort=firstname,lastname,asc"); } - /** - * @see DATACMNS-343 - */ - @Test + @Test // DATACMNS-343 public void replacesExistingPaginationInformation() throws Exception { MethodParameter parameter = new MethodParameter(Sample.class.getMethod("supportedMethod", Pageable.class), 0); @@ -69,18 +66,12 @@ public class HateoasPageableHandlerMethodArgumentResolverUnitTests extends assertThat(size.get(0), is("20")); } - /** - * @see DATACMNS-335 - */ - @Test + @Test // DATACMNS-335 public void preventsPageSizeFromExceedingMayValueIfConfiguredOnWrite() throws Exception { assertUriStringFor(new PageRequest(0, 200), "page=0&size=100"); } - /** - * @see DATACMNS-418 - */ - @Test + @Test // DATACMNS-418 public void appendsTemplateVariablesCorrectly() { assertTemplateEnrichment("/foo", "{?page,size,sort}"); @@ -91,10 +82,7 @@ public class HateoasPageableHandlerMethodArgumentResolverUnitTests extends assertTemplateEnrichment("/foo?page=1&size=10&sort=foo,asc", ""); } - /** - * @see DATACMNS-418 - */ - @Test + @Test // DATACMNS-418 public void returnsCustomizedTemplateVariables() { UriComponents uriComponents = UriComponentsBuilder.fromPath("/foo").build(); @@ -106,10 +94,7 @@ public class HateoasPageableHandlerMethodArgumentResolverUnitTests extends assertThat(variables, is("{?foo,size,sort}")); } - /** - * @see DATACMNS-563 - */ - @Test + @Test // DATACMNS-563 public void enablingOneIndexedParameterReturnsOneForFirstPage() { HateoasPageableHandlerMethodArgumentResolver resolver = getResolver(); diff --git a/src/test/java/org/springframework/data/web/HateoasSortHandlerMethodArgumentResolverUnitTests.java b/src/test/java/org/springframework/data/web/HateoasSortHandlerMethodArgumentResolverUnitTests.java index 1391ce982..be008a13b 100644 --- a/src/test/java/org/springframework/data/web/HateoasSortHandlerMethodArgumentResolverUnitTests.java +++ b/src/test/java/org/springframework/data/web/HateoasSortHandlerMethodArgumentResolverUnitTests.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. @@ -44,18 +44,12 @@ public class HateoasSortHandlerMethodArgumentResolverUnitTests extends SortHandl "sort=foo,bar,asc&sort=foobar,desc"); } - /** - * @see DATACMNS-407 - */ - @Test + @Test // DATACMNS-407 public void replacesExistingRequestParameters() throws Exception { assertUriStringFor(SORT, "/?sort=firstname,lastname,desc", "/?sort=foo,asc"); } - /** - * @see DATACMNS-418 - */ - @Test + @Test // DATACMNS-418 public void returnCorrectTemplateVariables() { UriComponents uriComponents = UriComponentsBuilder.fromPath("/").build(); diff --git a/src/test/java/org/springframework/data/web/JsonProjectingMethodInterceptorFactoryUnitTests.java b/src/test/java/org/springframework/data/web/JsonProjectingMethodInterceptorFactoryUnitTests.java index 26f21cdf7..7d1ba0861 100644 --- a/src/test/java/org/springframework/data/web/JsonProjectingMethodInterceptorFactoryUnitTests.java +++ b/src/test/java/org/springframework/data/web/JsonProjectingMethodInterceptorFactoryUnitTests.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. @@ -63,74 +63,47 @@ public class JsonProjectingMethodInterceptorFactoryUnitTests { this.customer = projectionFactory.createProjection(Customer.class, new ByteArrayInputStream(json.getBytes())); } - /** - * @see DATCMNS-885 - */ - @Test + @Test // DATCMNS-885 public void accessSimpleProperty() { assertThat(customer.getFirstname(), is("Dave")); } - /** - * @see DATCMNS-885 - */ - @Test + @Test // DATCMNS-885 public void accessPropertyWithExplicitAnnotation() { assertThat(customer.getBar(), is("Dave")); } - /** - * @see DATCMNS-885 - */ - @Test + @Test // DATCMNS-885 public void accessPropertyWithComplexReturnType() { assertThat(customer.getAddress(), is(new Address("01097", "Dresden"))); } - /** - * @see DATCMNS-885 - */ - @Test + @Test // DATCMNS-885 public void accessComplexPropertyWithProjection() { assertThat(customer.getAddressProjection().getCity(), is("Dresden")); } - /** - * @see DATCMNS-885 - */ - @Test + @Test // DATCMNS-885 public void accessPropertyWithNestedJsonPath() { assertThat(customer.getNestedZipCode(), is("01097")); } - /** - * @see DATCMNS-885 - */ - @Test + @Test // DATCMNS-885 public void accessCollectionProperty() { assertThat(customer.getAddresses().get(0), is(new Address("01097", "Dresden"))); } - /** - * @see DATCMNS-885 - */ - @Test + @Test // DATCMNS-885 public void accessPropertyOnNestedProjection() { assertThat(customer.getAddressProjections().get(0).getZipCode(), is("01097")); } - /** - * @see DATCMNS-885 - */ - @Test + @Test // DATCMNS-885 public void accessPropertyThatUsesJsonPathProjectionInTurn() { assertThat(customer.getAnotherAddressProjection().getZipCodeButNotCity(), is("01097")); } - /** - * @see DATCMNS-885 - */ - @Test + @Test // DATCMNS-885 public void accessCollectionPropertyThatUsesJsonPathProjectionInTurn() { List projections = customer.getAnotherAddressProjections(); @@ -139,10 +112,7 @@ public class JsonProjectingMethodInterceptorFactoryUnitTests { assertThat(projections.get(0).getZipCodeButNotCity(), is("01097")); } - /** - * @see DATCMNS-885 - */ - @Test + @Test // DATCMNS-885 public void accessAsCollectionPropertyThatUsesJsonPathProjectionInTurn() { Set projections = customer.getAnotherAddressProjectionAsCollection(); @@ -151,10 +121,7 @@ public class JsonProjectingMethodInterceptorFactoryUnitTests { assertThat(projections.iterator().next().getZipCodeButNotCity(), is("01097")); } - /** - * @see DATCMNS-885 - */ - @Test + @Test // DATCMNS-885 public void accessNestedPropertyButStayOnRootLevel() { Name name = customer.getName(); @@ -163,10 +130,7 @@ public class JsonProjectingMethodInterceptorFactoryUnitTests { assertThat(name.getFirstname(), is("Dave")); } - /** - * @see DATACMNS-885 - */ - @Test + @Test // DATACMNS-885 public void accessNestedFields() { assertThat(customer.getNestedCity(), is("Dresden")); diff --git a/src/test/java/org/springframework/data/web/MapDataBinderUnitTests.java b/src/test/java/org/springframework/data/web/MapDataBinderUnitTests.java index a26494f45..9c965b04a 100644 --- a/src/test/java/org/springframework/data/web/MapDataBinderUnitTests.java +++ b/src/test/java/org/springframework/data/web/MapDataBinderUnitTests.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. @@ -42,10 +42,7 @@ import org.springframework.format.support.DefaultFormattingConversionService; */ public class MapDataBinderUnitTests { - /** - * @see DATACMNS-630 - */ - @Test + @Test // DATACMNS-630 public void honorsFormattingAnnotationOnAccessor() { Date reference = new Date(); @@ -59,10 +56,7 @@ public class MapDataBinderUnitTests { assertThat(bind(values), hasEntry("foo", (Object) nested)); } - /** - * @see DATACMNS-630 - */ - @Test + @Test // DATACMNS-630 @SuppressWarnings("rawtypes") public void bindsNestedCollectionElement() { @@ -77,10 +71,7 @@ public class MapDataBinderUnitTests { assertThat(result, is((Map) singletonMap("foo", singletonMap("bar", singletonMap("fooBar", list))))); } - /** - * @see DATACMNS-630 - */ - @Test + @Test // DATACMNS-630 @SuppressWarnings("rawtypes") public void bindsNestedPrimitive() { @@ -97,10 +88,7 @@ public class MapDataBinderUnitTests { assertThat(result, is((Map) singletonMap("foo", dave))); } - /** - * @see DATACMNS-630 - */ - @Test + @Test // DATACMNS-630 public void skipsPropertyNotExposedByTheTypeHierarchy() { MutablePropertyValues values = new MutablePropertyValues(); diff --git a/src/test/java/org/springframework/data/web/PageableHandlerMethodArgumentResolverUnitTests.java b/src/test/java/org/springframework/data/web/PageableHandlerMethodArgumentResolverUnitTests.java index 94ebea534..2e8238ced 100644 --- a/src/test/java/org/springframework/data/web/PageableHandlerMethodArgumentResolverUnitTests.java +++ b/src/test/java/org/springframework/data/web/PageableHandlerMethodArgumentResolverUnitTests.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. @@ -46,10 +46,7 @@ public class PageableHandlerMethodArgumentResolverUnitTests extends PageableDefa this.supportedMethodParameter = new MethodParameter(Sample.class.getMethod("supportedMethod", Pageable.class), 0); } - /** - * @see DATACMNS-335 - */ - @Test + @Test // DATACMNS-335 public void preventsPageSizeFromExceedingMayValueIfConfigured() throws Exception { // Read side @@ -92,10 +89,7 @@ public class PageableHandlerMethodArgumentResolverUnitTests extends PageableDefa assertSupportedAndResult(parameter, new PageRequest(2, 10), request); } - /** - * @see DATACMNS-377 - */ - @Test + @Test // DATACMNS-377 public void usesDefaultPageSizeIfRequestPageSizeIsLessThanOne() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); @@ -105,10 +99,7 @@ public class PageableHandlerMethodArgumentResolverUnitTests extends PageableDefa assertSupportedAndResult(supportedMethodParameter, DEFAULT_PAGE_REQUEST, request); } - /** - * @see DATACMNS-377 - */ - @Test + @Test // DATACMNS-377 public void rejectsInvalidCustomDefaultForPageSize() throws Exception { MethodParameter parameter = new MethodParameter(Sample.class.getMethod("invalidDefaultPageSize", Pageable.class), 0); @@ -119,10 +110,7 @@ public class PageableHandlerMethodArgumentResolverUnitTests extends PageableDefa assertSupportedAndResult(parameter, DEFAULT_PAGE_REQUEST); } - /** - * @see DATACMNS-408 - */ - @Test + @Test // DATACMNS-408 public void fallsBackToFirstPageIfNegativePageNumberIsGiven() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); @@ -131,10 +119,7 @@ public class PageableHandlerMethodArgumentResolverUnitTests extends PageableDefa assertSupportedAndResult(supportedMethodParameter, DEFAULT_PAGE_REQUEST, request); } - /** - * @see DATACMNS-408 - */ - @Test + @Test // DATACMNS-408 public void pageParamIsNotNumeric() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); @@ -143,10 +128,7 @@ public class PageableHandlerMethodArgumentResolverUnitTests extends PageableDefa assertSupportedAndResult(supportedMethodParameter, DEFAULT_PAGE_REQUEST, request); } - /** - * @see DATACMNS-408 - */ - @Test + @Test // DATACMNS-408 public void sizeParamIsNotNumeric() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); @@ -155,10 +137,7 @@ public class PageableHandlerMethodArgumentResolverUnitTests extends PageableDefa assertSupportedAndResult(supportedMethodParameter, DEFAULT_PAGE_REQUEST, request); } - /** - * @see DATACMNS-477 - */ - @Test + @Test // DATACMNS-477 public void returnsNullIfFallbackIsNullAndNoParametersGiven() throws Exception { PageableHandlerMethodArgumentResolver resolver = getResolver(); @@ -168,10 +147,7 @@ public class PageableHandlerMethodArgumentResolverUnitTests extends PageableDefa resolver); } - /** - * @see DATACMNS-477 - */ - @Test + @Test // DATACMNS-477 public void returnsNullIfFallbackIsNullAndOnlyPageIsGiven() throws Exception { PageableHandlerMethodArgumentResolver resolver = getResolver(); @@ -184,10 +160,7 @@ public class PageableHandlerMethodArgumentResolverUnitTests extends PageableDefa is(nullValue())); } - /** - * @see DATACMNS-477 - */ - @Test + @Test // DATACMNS-477 public void returnsNullIfFallbackIsNullAndOnlySizeIsGiven() throws Exception { PageableHandlerMethodArgumentResolver resolver = getResolver(); @@ -200,10 +173,7 @@ public class PageableHandlerMethodArgumentResolverUnitTests extends PageableDefa is(nullValue())); } - /** - * @see DATACMNS-563 - */ - @Test + @Test // DATACMNS-563 public void considersOneIndexedParametersSetting() { PageableHandlerMethodArgumentResolver resolver = getResolver(); @@ -216,10 +186,7 @@ public class PageableHandlerMethodArgumentResolverUnitTests extends PageableDefa .getPageNumber(), is(0)); } - /** - * @see DATACMNS-640 - */ - @Test + @Test // DATACMNS-640 public void usesNullSortIfNoDefaultIsConfiguredAndPageAndSizeAreGiven() { PageableHandlerMethodArgumentResolver resolver = getResolver(); @@ -236,10 +203,7 @@ public class PageableHandlerMethodArgumentResolverUnitTests extends PageableDefa assertThat(result.getSort(), is(nullValue())); } - /** - * @see DATACMNS-692 - */ - @Test + @Test // DATACMNS-692 public void oneIndexedParametersDefaultsIndexOutOfRange() { PageableHandlerMethodArgumentResolver resolver = getResolver(); @@ -253,10 +217,7 @@ public class PageableHandlerMethodArgumentResolverUnitTests extends PageableDefa assertThat(result.getPageNumber(), is(0)); } - /** - * @see DATACMNS-761 - */ - @Test + @Test // DATACMNS-761 public void returnsCorrectPageSizeForOneIndexParameters() { PageableHandlerMethodArgumentResolver resolver = getResolver(); @@ -270,10 +231,7 @@ public class PageableHandlerMethodArgumentResolverUnitTests extends PageableDefa assertThat(result.getPageSize(), is(10)); } - /** - * @see DATACMNS-929 - */ - @Test + @Test // DATACMNS-929 public void detectsFallbackPageableIfNullOneIsConfigured() { PageableHandlerMethodArgumentResolver resolver = getResolver(); diff --git a/src/test/java/org/springframework/data/web/PagedResourcesAssemblerArgumentResolverUnitTests.java b/src/test/java/org/springframework/data/web/PagedResourcesAssemblerArgumentResolverUnitTests.java index 8fbde90df..cdef4e563 100644 --- a/src/test/java/org/springframework/data/web/PagedResourcesAssemblerArgumentResolverUnitTests.java +++ b/src/test/java/org/springframework/data/web/PagedResourcesAssemblerArgumentResolverUnitTests.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. @@ -52,10 +52,7 @@ public class PagedResourcesAssemblerArgumentResolverUnitTests { this.resolver = new PagedResourcesAssemblerArgumentResolver(hateoasPageableHandlerMethodArgumentResolver, null); } - /** - * @see DATACMNS-418 - */ - @Test + @Test // DATACMNS-418 public void createsPlainAssemblerWithoutContext() throws Exception { Method method = Controller.class.getMethod("noContext", PagedResourcesAssembler.class); @@ -65,40 +62,28 @@ public class PagedResourcesAssemblerArgumentResolverUnitTests { assertThat(result, is(not(instanceOf(MethodParameterAwarePagedResourcesAssembler.class)))); } - /** - * @see DATACMNS-418 - */ - @Test + @Test // DATACMNS-418 public void selectsUniquePageableParameter() throws Exception { Method method = Controller.class.getMethod("unique", PagedResourcesAssembler.class, Pageable.class); assertSelectsParameter(method, 1); } - /** - * @see DATACMNS-418 - */ - @Test + @Test // DATACMNS-418 public void selectsUniquePageableParameterForQualifiedAssembler() throws Exception { Method method = Controller.class.getMethod("unnecessarilyQualified", PagedResourcesAssembler.class, Pageable.class); assertSelectsParameter(method, 1); } - /** - * @see DATACMNS-418 - */ - @Test + @Test // DATACMNS-418 public void selectsUniqueQualifiedPageableParameter() throws Exception { Method method = Controller.class.getMethod("qualifiedUnique", PagedResourcesAssembler.class, Pageable.class); assertSelectsParameter(method, 1); } - /** - * @see DATACMNS-418 - */ - @Test + @Test // DATACMNS-418 public void selectsQualifiedPageableParameter() throws Exception { Method method = Controller.class.getMethod("qualified", PagedResourcesAssembler.class, Pageable.class, @@ -106,34 +91,22 @@ public class PagedResourcesAssemblerArgumentResolverUnitTests { assertSelectsParameter(method, 1); } - /** - * @see DATACMNS-418 - */ - @Test + @Test // DATACMNS-418 public void rejectsAmbiguousPageableParameters() throws Exception { assertRejectsAmbiguity("unqualifiedAmbiguity"); } - /** - * @see DATACMNS-418 - */ - @Test + @Test // DATACMNS-418 public void rejectsAmbiguousPageableParametersForQualifiedAssembler() throws Exception { assertRejectsAmbiguity("assemblerQualifiedAmbiguity"); } - /** - * @see DATACMNS-418 - */ - @Test + @Test // DATACMNS-418 public void rejectsAmbiguityWithoutMatchingQualifiers() throws Exception { assertRejectsAmbiguity("noMatchingQualifiers"); } - /** - * @see DATACMNS-419 - */ - @Test + @Test // DATACMNS-419 public void doesNotFailForTemplatedMethodMapping() throws Exception { Method method = Controller.class.getMethod("methodWithPathVariable", PagedResourcesAssembler.class); @@ -142,10 +115,7 @@ public class PagedResourcesAssemblerArgumentResolverUnitTests { assertThat(result, is(notNullValue())); } - /** - * @see DATACMNS-513 - */ - @Test + @Test // DATACMNS-513 public void detectsMappingOfInvokedSubType() throws Exception { Method method = Controller.class.getMethod("methodWithMapping", PagedResourcesAssembler.class); diff --git a/src/test/java/org/springframework/data/web/PagedResourcesAssemblerUnitTests.java b/src/test/java/org/springframework/data/web/PagedResourcesAssemblerUnitTests.java index 556180000..8138dcb8c 100644 --- a/src/test/java/org/springframework/data/web/PagedResourcesAssemblerUnitTests.java +++ b/src/test/java/org/springframework/data/web/PagedResourcesAssemblerUnitTests.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. @@ -116,10 +116,7 @@ public class PagedResourcesAssemblerUnitTests { assertThat(resources.getLink(Link.REL_NEXT).getHref(), startsWith(link.getHref())); } - /** - * @see DATACMNS-358 - */ - @Test + @Test // DATACMNS-358 public void createsPagedResourcesForOneIndexedArgumentResolver() { resolver.setOneIndexedParameters(true); @@ -130,11 +127,7 @@ public class PagedResourcesAssemblerUnitTests { assembler.toResource(page); } - /** - * @see DATACMNS-418 - * @see DATACMNS-515 - */ - @Test + @Test // DATACMNS-418, DATACMNS-515 public void createsACanonicalLinkWithoutTemplateParameters() { PagedResources> resources = assembler.toResource(createPage(1)); @@ -143,10 +136,7 @@ public class PagedResourcesAssemblerUnitTests { assertThat(selfLink.getHref(), endsWith("localhost")); } - /** - * @see DATACMNS-418 - */ - @Test + @Test // DATACMNS-418 public void invokesCustomElementResourceAssembler() { PersonResourceAssembler personAssembler = new PersonResourceAssembler(); @@ -160,10 +150,7 @@ public class PagedResourcesAssemblerUnitTests { assertThat(content.iterator().next().name, is("Dave")); } - /** - * @see DATAMCNS-563 - */ - @Test + @Test // DATAMCNS-563 public void createsPaginationLinksForOneIndexedArgumentResolverCorrectly() { HateoasPageableHandlerMethodArgumentResolver argumentResolver = new HateoasPageableHandlerMethodArgumentResolver(); @@ -179,10 +166,7 @@ public class PagedResourcesAssemblerUnitTests { assertThat(getQueryParameters(resource.getLink("next")), hasEntry("page", "3")); } - /** - * @see DATACMNS-515 - */ - @Test + @Test // DATACMNS-515 public void generatedLinksShouldNotBeTemplated() { PagedResources> resources = assembler.toResource(createPage(1)); @@ -192,10 +176,7 @@ public class PagedResourcesAssemblerUnitTests { assertThat(resources.getLink(Link.REL_PREVIOUS).getHref(), endsWith("?page=0&size=1")); } - /** - * @see DATACMNS-699 - */ - @Test + @Test // DATACMNS-699 public void generatesEmptyPagedResourceWithEmbeddedWrapper() { PagedResources result = assembler.toEmptyResource(EMPTY_PAGE, Person.class, null); @@ -208,26 +189,17 @@ public class PagedResourcesAssemblerUnitTests { assertThat(((EmbeddedWrapper) element).getRelTargetType(), is(typeCompatibleWith(Person.class))); } - /** - * @see DATACMNS-699 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-699 public void emptyPageCreatorRejectsPageWithContent() { assembler.toEmptyResource(createPage(1), Person.class, null); } - /** - * @see DATACMNS-699 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-699 public void emptyPageCreatorRejectsNullType() { assembler.toEmptyResource(EMPTY_PAGE, null, null); } - /** - * @see DATACMNS-701 - */ - @Test + @Test // DATACMNS-701 public void addsFirstAndLastLinksForMultiplePages() { PagedResources> resources = assembler.toResource(createPage(1)); @@ -236,10 +208,7 @@ public class PagedResourcesAssemblerUnitTests { assertThat(resources.getLink(Link.REL_LAST).getHref(), endsWith("?page=2&size=1")); } - /** - * @see DATACMNS-701 - */ - @Test + @Test // DATACMNS-701 public void addsFirstAndLastLinksForFirstPage() { PagedResources> resources = assembler.toResource(createPage(0)); @@ -248,10 +217,7 @@ public class PagedResourcesAssemblerUnitTests { assertThat(resources.getLink(Link.REL_LAST).getHref(), endsWith("?page=2&size=1")); } - /** - * @see DATACMNS-701 - */ - @Test + @Test // DATACMNS-701 public void addsFirstAndLastLinksForLastPage() { PagedResources> resources = assembler.toResource(createPage(2)); @@ -260,10 +226,7 @@ public class PagedResourcesAssemblerUnitTests { assertThat(resources.getLink(Link.REL_LAST).getHref(), endsWith("?page=2&size=1")); } - /** - * @see DATACMNS-701 - */ - @Test + @Test // DATACMNS-701 public void alwaysAddsFirstAndLastLinkIfConfiguredTo() { PagedResourcesAssembler assembler = new PagedResourcesAssembler(resolver, null); @@ -275,10 +238,7 @@ public class PagedResourcesAssemblerUnitTests { assertThat(resources.getLink(Link.REL_LAST).getHref(), endsWith("?page=0&size=20")); } - /** - * @see DATACMNS-802 - */ - @Test + @Test // DATACMNS-802 public void usesCustomPagedResources() { ResourceAssembler, PagedResources>> assembler = new CustomPagedResourcesAssembler( diff --git a/src/test/java/org/springframework/data/web/ProjectingJackson2HttpMessageConverterUnitTests.java b/src/test/java/org/springframework/data/web/ProjectingJackson2HttpMessageConverterUnitTests.java index dab280d4d..8df4f79b4 100644 --- a/src/test/java/org/springframework/data/web/ProjectingJackson2HttpMessageConverterUnitTests.java +++ b/src/test/java/org/springframework/data/web/ProjectingJackson2HttpMessageConverterUnitTests.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. @@ -33,26 +33,17 @@ public class ProjectingJackson2HttpMessageConverterUnitTests { ProjectingJackson2HttpMessageConverter converter = new ProjectingJackson2HttpMessageConverter(); MediaType ANYTHING_JSON = MediaType.parseMediaType("application/*+json"); - /** - * @see DATCMNS-885 - */ - @Test + @Test // DATCMNS-885 public void canReadJsonIntoAnnotatedInterface() { assertThat(converter.canRead(SampleInterface.class, ANYTHING_JSON), is(true)); } - /** - * @see DATCMNS-885 - */ - @Test + @Test // DATCMNS-885 public void cannotReadUnannotatedInterface() { assertThat(converter.canRead(UnannotatedInterface.class, ANYTHING_JSON), is(false)); } - /** - * @see DATCMNS-885 - */ - @Test + @Test // DATCMNS-885 public void cannotReadClass() { assertThat(converter.canRead(SampleClass.class, ANYTHING_JSON), is(false)); } diff --git a/src/test/java/org/springframework/data/web/SortHandlerMethodArgumentResolverUnitTests.java b/src/test/java/org/springframework/data/web/SortHandlerMethodArgumentResolverUnitTests.java index 5a9fe062d..a80c79788 100644 --- a/src/test/java/org/springframework/data/web/SortHandlerMethodArgumentResolverUnitTests.java +++ b/src/test/java/org/springframework/data/web/SortHandlerMethodArgumentResolverUnitTests.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. @@ -51,10 +51,7 @@ public class SortHandlerMethodArgumentResolverUnitTests extends SortDefaultUnitT PARAMETER = new MethodParameter(Controller.class.getMethod("supportedMethod", Sort.class), 0); } - /** - * @see DATACMNS-351 - */ - @Test + @Test // DATACMNS-351 public void fallbackToGivenDefaultSort() throws Exception { MethodParameter parameter = TestUtils.getParameterOfMethod(getControllerClass(), "unsupportedMethod", String.class); @@ -66,10 +63,7 @@ public class SortHandlerMethodArgumentResolverUnitTests extends SortDefaultUnitT assertThat(sort, is(fallbackSort)); } - /** - * @see DATACMNS-351 - */ - @Test + @Test // DATACMNS-351 public void fallbackToDefaultDefaultSort() throws Exception { MethodParameter parameter = TestUtils.getParameterOfMethod(getControllerClass(), "unsupportedMethod", String.class); @@ -120,11 +114,7 @@ public class SortHandlerMethodArgumentResolverUnitTests extends SortDefaultUnitT assertThat(result, is(nullValue())); } - /** - * @see DATACMNS-366 - * @throws Exception - */ - @Test + @Test // DATACMNS-366 public void requestForMultipleSortPropertiesIsUnmarshalledCorrectly() throws Exception { MethodParameter parameter = getParameterOfMethod("supportedMethod"); @@ -137,10 +127,7 @@ public class SortHandlerMethodArgumentResolverUnitTests extends SortDefaultUnitT assertThat(result, is(new Sort(Direction.ASC, "firstname", "lastname"))); } - /** - * @see DATACMNS-408 - */ - @Test + @Test // DATACMNS-408 public void parsesEmptySortToNull() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); @@ -149,10 +136,7 @@ public class SortHandlerMethodArgumentResolverUnitTests extends SortDefaultUnitT assertThat(resolveSort(request, PARAMETER), is(nullValue())); } - /** - * @see DATACMNS-408 - */ - @Test + @Test // DATACMNS-408 public void sortParamIsInvalidProperty() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); @@ -161,10 +145,7 @@ public class SortHandlerMethodArgumentResolverUnitTests extends SortDefaultUnitT assertThat(resolveSort(request, PARAMETER), is(nullValue())); } - /** - * @see DATACMNS-408 - */ - @Test + @Test // DATACMNS-408 public void sortParamIsInvalidPropertyWhenMultiProperty() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); @@ -173,10 +154,7 @@ public class SortHandlerMethodArgumentResolverUnitTests extends SortDefaultUnitT assertThat(resolveSort(request, PARAMETER), is(new Sort(DESC, "property1"))); } - /** - * @see DATACMNS-408 - */ - @Test + @Test // DATACMNS-408 public void sortParamIsEmptyWhenMultiParams() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); @@ -186,10 +164,7 @@ public class SortHandlerMethodArgumentResolverUnitTests extends SortDefaultUnitT assertThat(resolveSort(request, PARAMETER), is(new Sort(DESC, "property"))); } - /** - * @see DATACMNS-379 - */ - @Test + @Test // DATACMNS-379 public void parsesCommaParameterForSort() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); @@ -198,10 +173,7 @@ public class SortHandlerMethodArgumentResolverUnitTests extends SortDefaultUnitT assertThat(resolveSort(request, PARAMETER), is(nullValue())); } - /** - * @see DATACMNS-753, DATACMNS-408 - */ - @Test + @Test // DATACMNS-753, DATACMNS-408 public void doesNotReturnNullWhenAnnotatedWithSortDefault() throws Exception { MockHttpServletRequest request = new MockHttpServletRequest(); diff --git a/src/test/java/org/springframework/data/web/XmlBeamHttpMessageConverterUnitTests.java b/src/test/java/org/springframework/data/web/XmlBeamHttpMessageConverterUnitTests.java index 37d81214e..86edcd9ab 100644 --- a/src/test/java/org/springframework/data/web/XmlBeamHttpMessageConverterUnitTests.java +++ b/src/test/java/org/springframework/data/web/XmlBeamHttpMessageConverterUnitTests.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. @@ -44,10 +44,7 @@ public class XmlBeamHttpMessageConverterUnitTests { @Mock HttpInputMessage message; - /** - * @see DATACMNS-885 - */ - @Test + @Test // DATACMNS-885 public void findsTopLevelElements() throws Exception { preparePayload("DaveMatthews"); @@ -58,10 +55,7 @@ public class XmlBeamHttpMessageConverterUnitTests { assertThat(customer.getLastname(), is("Matthews")); } - /** - * @see DATACMNS-885 - */ - @Test + @Test // DATACMNS-885 public void findsNestedElements() throws Exception { preparePayload("DaveMatthews"); @@ -72,34 +66,22 @@ public class XmlBeamHttpMessageConverterUnitTests { assertThat(customer.getLastname(), is("Matthews")); } - /** - * @see DATACMNS-885 - */ - @Test + @Test // DATACMNS-885 public void supportsAnnotatedInterface() { assertThat(converter.canRead(Customer.class, MediaType.APPLICATION_XML), is(true)); } - /** - * @see DATACMNS-885 - */ - @Test + @Test // DATACMNS-885 public void supportsXmlBasedMediaType() { assertThat(converter.canRead(Customer.class, MediaType.APPLICATION_ATOM_XML), is(true)); } - /** - * @see DATACMNS-885 - */ - @Test + @Test // DATACMNS-885 public void doesNotSupportUnannotatedInterface() { assertThat(converter.canRead(UnannotatedInterface.class, MediaType.APPLICATION_XML), is(false)); } - /** - * @see DATACMNS-885 - */ - @Test + @Test // DATACMNS-885 public void supportsInterfaceAfterLookupForDifferrentMediaType() { assertThat(converter.canRead(Customer.class, MediaType.APPLICATION_JSON), is(false)); diff --git a/src/test/java/org/springframework/data/web/config/EnableSpringDataWebSupportIntegrationTests.java b/src/test/java/org/springframework/data/web/config/EnableSpringDataWebSupportIntegrationTests.java index a1ee85905..5c9a7434d 100644 --- a/src/test/java/org/springframework/data/web/config/EnableSpringDataWebSupportIntegrationTests.java +++ b/src/test/java/org/springframework/data/web/config/EnableSpringDataWebSupportIntegrationTests.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. @@ -52,7 +52,6 @@ import org.springframework.web.util.UriComponentsBuilder; * Integration tests for {@link EnableSpringDataWebSupport}. * * @author Oliver Gierke - * @see DATACMNS-330 */ public class EnableSpringDataWebSupportIntegrationTests { @@ -75,7 +74,7 @@ public class EnableSpringDataWebSupportIntegrationTests { reEnable(JACKSON); } - @Test + @Test // DATACMNS-330 public void registersBasicBeanDefinitions() throws Exception { ApplicationContext context = WebTestUtils.createApplicationContext(SampleConfig.class); @@ -87,7 +86,7 @@ public class EnableSpringDataWebSupportIntegrationTests { PageableHandlerMethodArgumentResolver.class); } - @Test + @Test // DATACMNS-330 public void registersHateoasSpecificBeanDefinitions() throws Exception { ApplicationContext context = WebTestUtils.createApplicationContext(SampleConfig.class); @@ -97,7 +96,7 @@ public class EnableSpringDataWebSupportIntegrationTests { assertResolversRegistered(context, PagedResourcesAssemblerArgumentResolver.class); } - @Test + @Test // DATACMNS-330 public void doesNotRegisterHateoasSpecificComponentsIfHateoasNotPresent() throws Exception { hide(HATEOAS); @@ -109,10 +108,7 @@ public class EnableSpringDataWebSupportIntegrationTests { assertThat(names, not(hasItems("pagedResourcesAssembler", "pagedResourcesAssemblerArgumentResolver"))); } - /** - * @see DATACMNS-475 - */ - @Test + @Test // DATACMNS-475 public void registersJacksonSpecificBeanDefinitions() throws Exception { ApplicationContext context = WebTestUtils.createApplicationContext(SampleConfig.class); @@ -121,10 +117,7 @@ public class EnableSpringDataWebSupportIntegrationTests { assertThat(names, hasItem("jacksonGeoModule")); } - /** - * @see DATACMNS-475 - */ - @Test + @Test // DATACMNS-475 public void doesNotRegisterJacksonSpecificComponentsIfJacksonNotPresent() throws Exception { hide(JACKSON); @@ -135,10 +128,7 @@ public class EnableSpringDataWebSupportIntegrationTests { assertThat(names, not(hasItem("jacksonGeoModule"))); } - /** - * @see DATACMNS-626 - */ - @Test + @Test // DATACMNS-626 public void registersFormatters() { ApplicationContext context = WebTestUtils.createApplicationContext(SampleConfig.class); @@ -151,10 +141,7 @@ public class EnableSpringDataWebSupportIntegrationTests { assertThat(conversionService.canConvert(Point.class, String.class), is(true)); } - /** - * @see DATACMNS-630 - */ - @Test + @Test // DATACMNS-630 public void createsProxyForInterfaceBasedControllerMethodParameter() throws Exception { WebApplicationContext applicationContext = WebTestUtils.createApplicationContext(SampleConfig.class); @@ -172,10 +159,7 @@ public class EnableSpringDataWebSupportIntegrationTests { andExpect(status().isOk()); } - /** - * @see DATACMNS-660 - */ - @Test + @Test // DATACMNS-660 public void picksUpWebConfigurationMixins() { ApplicationContext context = WebTestUtils.createApplicationContext(SampleConfig.class); diff --git a/src/test/java/org/springframework/data/web/config/PageableResourcesAssemblerIntegrationTests.java b/src/test/java/org/springframework/data/web/config/PageableResourcesAssemblerIntegrationTests.java index 28e58fe1e..7692b7150 100644 --- a/src/test/java/org/springframework/data/web/config/PageableResourcesAssemblerIntegrationTests.java +++ b/src/test/java/org/springframework/data/web/config/PageableResourcesAssemblerIntegrationTests.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. @@ -80,10 +80,7 @@ public class PageableResourcesAssemblerIntegrationTests { assertThat(resources.getLink(Link.REL_SELF), is(notNullValue())); } - /** - * @see DATACMNS-471 - */ - @Test + @Test // DATACMNS-471 public void setsUpPagedResourcesAssemblerFromManualXmlConfig() { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("manual.xml", getClass()); @@ -91,10 +88,7 @@ public class PageableResourcesAssemblerIntegrationTests { context.close(); } - /** - * @see DATACMNS-471 - */ - @Test + @Test // DATACMNS-471 public void setsUpPagedResourcesAssemblerFromJavaConfigXmlConfig() { ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("via-config-class.xml", getClass()); diff --git a/src/test/java/org/springframework/data/web/config/SpringDataWebConfigurationUnitTests.java b/src/test/java/org/springframework/data/web/config/SpringDataWebConfigurationUnitTests.java index dd3140eb7..99e95e0b1 100644 --- a/src/test/java/org/springframework/data/web/config/SpringDataWebConfigurationUnitTests.java +++ b/src/test/java/org/springframework/data/web/config/SpringDataWebConfigurationUnitTests.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. @@ -35,10 +35,7 @@ import org.springframework.web.method.support.HandlerMethodArgumentResolver; */ public class SpringDataWebConfigurationUnitTests { - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void shouldNotAddQuerydslPredicateArgumentResolverWhenQuerydslNotPresent() throws ClassNotFoundException, InstantiationException, IllegalAccessException { diff --git a/src/test/java/org/springframework/data/web/querydsl/QuerydslPredicateArgumentResolverUnitTests.java b/src/test/java/org/springframework/data/web/querydsl/QuerydslPredicateArgumentResolverUnitTests.java index 552541565..ed5215cfa 100644 --- a/src/test/java/org/springframework/data/web/querydsl/QuerydslPredicateArgumentResolverUnitTests.java +++ b/src/test/java/org/springframework/data/web/querydsl/QuerydslPredicateArgumentResolverUnitTests.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,44 +71,29 @@ public class QuerydslPredicateArgumentResolverUnitTests { request = new MockHttpServletRequest(); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void supportsParameterReturnsTrueWhenMethodParameterIsPredicateAndAnnotatedCorrectly() { assertThat(resolver.supportsParameter(getMethodParameterFor("simpleFind", Predicate.class)), is(true)); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void supportsParameterReturnsTrueWhenMethodParameterIsPredicateButNotAnnotatedAsSuch() { assertThat(resolver.supportsParameter(getMethodParameterFor("predicateWithoutAnnotation", Predicate.class)), is(true)); } - /** - * @see DATACMNS-669 - */ - @Test(expected = IllegalArgumentException.class) + @Test(expected = IllegalArgumentException.class) // DATACMNS-669 public void supportsParameterShouldThrowExceptionWhenMethodParameterIsNoPredicateButAnnotatedAsSuch() { resolver.supportsParameter(getMethodParameterFor("nonPredicateWithAnnotation", String.class)); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void supportsParameterReturnsFalseWhenMethodParameterIsNoPredicate() { assertThat(resolver.supportsParameter(getMethodParameterFor("nonPredicateWithoutAnnotation", String.class)), is(false)); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void resolveArgumentShouldCreateSingleStringParameterPredicateCorrectly() throws Exception { request.addParameter("firstname", "rand"); @@ -119,10 +104,7 @@ public class QuerydslPredicateArgumentResolverUnitTests { assertThat(predicate, is((Predicate) QUser.user.firstname.eq("rand"))); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void resolveArgumentShouldCreateMultipleParametersPredicateCorrectly() throws Exception { request.addParameter("firstname", "rand"); @@ -134,10 +116,7 @@ public class QuerydslPredicateArgumentResolverUnitTests { assertThat(predicate, is((Predicate) QUser.user.firstname.eq("rand").and(QUser.user.lastname.eq("al'thor")))); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void resolveArgumentShouldCreateNestedObjectPredicateCorrectly() throws Exception { request.addParameter("address.city", "two rivers"); @@ -150,10 +129,7 @@ public class QuerydslPredicateArgumentResolverUnitTests { assertThat(predicate, is((Predicate) eq)); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void resolveArgumentShouldResolveTypePropertyFromPageCorrectly() throws Exception { request.addParameter("address.city", "tar valon"); @@ -164,10 +140,7 @@ public class QuerydslPredicateArgumentResolverUnitTests { assertThat(predicate, is((Predicate) QUser.user.address.city.eq("tar valon"))); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void resolveArgumentShouldHonorCustomSpecification() throws Exception { request.addParameter("firstname", "egwene"); @@ -180,10 +153,7 @@ public class QuerydslPredicateArgumentResolverUnitTests { .and(QUser.user.lastname.toLowerCase().eq("al'vere")))); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void shouldCreatePredicateForNonStringPropertyCorrectly() throws Exception { request.addParameter("inceptionYear", "978"); @@ -194,10 +164,7 @@ public class QuerydslPredicateArgumentResolverUnitTests { assertThat(predicate, is((Predicate) QUser.user.inceptionYear.eq(978L))); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void shouldCreatePredicateForNonStringListPropertyCorrectly() throws Exception { request.addParameter("inceptionYear", new String[] { "978", "998" }); @@ -208,10 +175,7 @@ public class QuerydslPredicateArgumentResolverUnitTests { assertThat(predicate, is((Predicate) QUser.user.inceptionYear.in(978L, 998L))); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 public void shouldExcludePropertiesCorrectly() throws Exception { request.addParameter("address.street", "downhill"); @@ -223,10 +187,7 @@ public class QuerydslPredicateArgumentResolverUnitTests { assertThat(predicate.toString(), is(QUser.user.inceptionYear.eq(973L).toString())); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 @SuppressWarnings("rawtypes") public void extractTypeInformationShouldUseTypeExtractedFromMethodReturnTypeIfPredicateNotAnnotated() { @@ -236,10 +197,7 @@ public class QuerydslPredicateArgumentResolverUnitTests { assertThat(type, is((TypeInformation) ClassTypeInformation.from(User.class))); } - /** - * @see DATACMNS-669 - */ - @Test + @Test // DATACMNS-669 @SuppressWarnings("rawtypes") public void detectsDomainTypesCorrectly() {