DATACMNS-973 - Migrate ticket references in test code to Spring Framework style.

This commit is contained in:
Mark Paluch
2017-01-13 08:45:25 +01:00
parent a946d651ff
commit 4eb1ae8de2
146 changed files with 1080 additions and 3893 deletions

View File

@@ -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() {

View File

@@ -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);

View File

@@ -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<Value> callback = new AnnotationDetectionMethodCallback<Value>(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);

View File

@@ -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<PropertyGetter> info = ClassTypeInformation.from(PropertyGetter.class);
assertThat(ClassTypeInformation.from(PropertyGetter.class), is(sameInstance(info)));
}
/**
* @see DATACMNS-39
*/
@Test
@Test // DATACMNS-39
public void resolvesWildCardTypeCorrectly() {
TypeInformation<ClassWithWildCardBound> 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<SuperGenerics> 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<ConcreteRoot> 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<ConcreteRootIntermediate> 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<Foo> 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<Concrete> 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<SampleTraversable> 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<SampleMap> information = ClassTypeInformation.from(SampleMap.class);

View File

@@ -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() {

View File

@@ -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());

View File

@@ -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<Integer, Integer> 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<Integer, Integer> 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<Integer, Integer> first = Pair.of(1, 2);

View File

@@ -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<Foo> 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<java.lang.String>"));
}
/**
* @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<NormalizedProfile> 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");

View File

@@ -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"));
}

View File

@@ -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()));
}

View File

@@ -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<String> input = Arrays.asList("a", "b", "c");

View File

@@ -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() {

View File

@@ -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);