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 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.
@@ -72,10 +72,7 @@ public abstract class AbstractPageRequestUnitTests {
assertNotEqualsAndHashcode(request, newPageRequest(0, 11));
}
/**
* @see DATACMNS-377
*/
@Test(expected = IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class) // DATACMNS-377
public void preventsPageSizeLessThanOne() {
newPageRequest(0, 0);
}

View File

@@ -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,50 +40,32 @@ public class ExampleMatcherUnitTests {
matcher = matching();
}
/**
* @see DATACMNS-810
*/
@Test
@Test // DATACMNS-810
public void defaultStringMatcherShouldReturnDefault() throws Exception {
assertThat(matcher.getDefaultStringMatcher(), is(StringMatcher.DEFAULT));
}
/**
* @see DATACMNS-810
*/
@Test
@Test // DATACMNS-810
public void ignoreCaseShouldReturnFalseByDefault() throws Exception {
assertThat(matcher.isIgnoreCaseEnabled(), is(false));
}
/**
* @see DATACMNS-810
*/
@Test
@Test // DATACMNS-810
public void ignoredPathsIsEmptyByDefault() throws Exception {
assertThat(matcher.getIgnoredPaths(), is(empty()));
}
/**
* @see DATACMNS-810
*/
@Test
@Test // DATACMNS-810
public void nullHandlerShouldReturnIgnoreByDefault() throws Exception {
assertThat(matcher.getNullHandler(), is(NullHandler.IGNORE));
}
/**
* @see DATACMNS-810
*/
@Test(expected = UnsupportedOperationException.class)
@Test(expected = UnsupportedOperationException.class) // DATACMNS-810
public void ignoredPathsIsNotModifiable() throws Exception {
matcher.getIgnoredPaths().add("¯\\_(ツ)_/¯");
}
/**
* @see DATACMNS-810
*/
@Test
@Test // DATACMNS-810
public void ignoreCaseShouldReturnTrueWhenIgnoreCaseEnabled() throws Exception {
matcher = matching().withIgnoreCase();
@@ -91,10 +73,7 @@ public class ExampleMatcherUnitTests {
assertThat(matcher.isIgnoreCaseEnabled(), is(true));
}
/**
* @see DATACMNS-810
*/
@Test
@Test // DATACMNS-810
public void ignoreCaseShouldReturnTrueWhenIgnoreCaseSet() throws Exception {
matcher = matching().withIgnoreCase(true);
@@ -102,10 +81,7 @@ public class ExampleMatcherUnitTests {
assertThat(matcher.isIgnoreCaseEnabled(), is(true));
}
/**
* @see DATACMNS-810
*/
@Test
@Test // DATACMNS-810
public void nullHandlerShouldReturnInclude() throws Exception {
matcher = matching().withIncludeNullValues();
@@ -113,10 +89,7 @@ public class ExampleMatcherUnitTests {
assertThat(matcher.getNullHandler(), is(NullHandler.INCLUDE));
}
/**
* @see DATACMNS-810
*/
@Test
@Test // DATACMNS-810
public void nullHandlerShouldReturnIgnore() throws Exception {
matcher = matching().withIgnoreNullValues();
@@ -124,10 +97,7 @@ public class ExampleMatcherUnitTests {
assertThat(matcher.getNullHandler(), is(NullHandler.IGNORE));
}
/**
* @see DATACMNS-810
*/
@Test
@Test // DATACMNS-810
public void nullHandlerShouldReturnConfiguredValue() throws Exception {
matcher = matching().withNullHandler(NullHandler.INCLUDE);
@@ -135,10 +105,7 @@ public class ExampleMatcherUnitTests {
assertThat(matcher.getNullHandler(), is(NullHandler.INCLUDE));
}
/**
* @see DATACMNS-810
*/
@Test
@Test // DATACMNS-810
public void ignoredPathsShouldReturnCorrectProperties() throws Exception {
matcher = matching().withIgnorePaths("foo", "bar", "baz");
@@ -147,10 +114,7 @@ public class ExampleMatcherUnitTests {
assertThat(matcher.getIgnoredPaths(), hasSize(3));
}
/**
* @see DATACMNS-810
*/
@Test
@Test // DATACMNS-810
public void ignoredPathsShouldReturnUniqueProperties() throws Exception {
matcher = matching().withIgnorePaths("foo", "bar", "foo");
@@ -159,10 +123,7 @@ public class ExampleMatcherUnitTests {
assertThat(matcher.getIgnoredPaths(), hasSize(2));
}
/**
* @see DATACMNS-810
*/
@Test
@Test // DATACMNS-810
public void withCreatesNewInstance() throws Exception {
matcher = matching().withIgnorePaths("foo", "bar", "foo");
@@ -176,40 +137,28 @@ public class ExampleMatcherUnitTests {
assertThat(configuredExampleSpec.isIgnoreCaseEnabled(), is(true));
}
/**
* @see DATACMNS-879
*/
@Test
@Test // DATACMNS-879
public void defaultMatcherRequiresAllMatching() {
assertThat(matching().isAllMatching(), is(true));
assertThat(matching().isAnyMatching(), is(false));
}
/**
* @see DATACMNS-879
*/
@Test
@Test // DATACMNS-879
public void allMatcherRequiresAllMatching() {
assertThat(matchingAll().isAllMatching(), is(true));
assertThat(matchingAll().isAnyMatching(), is(false));
}
/**
* @see DATACMNS-879
*/
@Test
@Test // DATACMNS-879
public void anyMatcherYieldsAnyMatching() {
assertThat(matchingAny().isAnyMatching(), is(true));
assertThat(matchingAny().isAllMatching(), is(false));
}
/**
* @see DATACMNS-900
*/
@Test
@Test // DATACMNS-900
public void shouldCompareUsingHashCodeAndEquals() throws Exception {
matcher = matching() //

View File

@@ -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,26 +44,17 @@ public class ExampleUnitTests {
example = Example.of(person);
}
/**
* @see DATACMNS-810
*/
@Test(expected = IllegalArgumentException.class)
@Test(expected = IllegalArgumentException.class) // DATACMNS-810
public void rejectsNullProbe() {
Example.of(null);
}
/**
* @see DATACMNS-810
*/
@Test
@Test // DATACMNS-810
public void returnsSampleObjectsClassAsProbeType() {
assertThat(example.getProbeType(), is(equalTo(Person.class)));
}
/**
* @see DATACMNS-900
*/
@Test
@Test // DATACMNS-900
public void shouldCompareUsingHashCodeAndEquals() throws Exception {
Example<Person> example = Example.of(person, matching().withIgnoreCase("firstname"));

View File

@@ -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<String> page = new PageImpl<String>(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<Integer> transformed = new PageImpl<String>(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<String>(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<String>(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<String>(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<String>(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<String>(Collections.<String> emptyList(), new PageRequest(1, 10), 0).getTotalElements(),

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.
@@ -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<Long>(10L, 20L).contains(null);
}
/**
* @see DATACMNS-651
*/
@Test
@Test // DATACMNS-651
public void usesBoundsInclusivelyByDefault() {
Range<Long> range = new Range<Long>(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<Long> range = new Range<Long>(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<Long> range = new Range<Long>(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<Long> range = new Range<Long>(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<Long> range = new Range<Long>(null, 20L);

View File

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