Skip to content

Commit 6369569

Browse files
committed
DATAREST-978 - Migrate ticket references in test code to Spring Framework style.
1 parent 130582a commit 6369569

File tree

99 files changed

+518
-1777
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

99 files changed

+518
-1777
lines changed

spring-data-rest-core/src/test/java/org/springframework/data/rest/core/PathUnitTests.java

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2013-2014 the original author or authors.
2+
* Copyright 2013-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -68,18 +68,12 @@ public void doesNotPrefixAbsoluteUris() {
6868
assertThat(new Path("http://localhost").toString(), is("http://localhost"));
6969
}
7070

71-
/**
72-
* @see DATAREST-222
73-
*/
74-
@Test
71+
@Test // DATAREST-222
7572
public void doesNotMatchIfReferenceContainsReservedCharacters() {
7673
assertThat(new Path("/foobar").matches("barfoo{?foo}"), is(false));
7774
}
7875

79-
/**
80-
* @see DATAREST-222
81-
*/
82-
@Test
76+
@Test // DATAREST-222
8377
public void doesNotMatchNullReference() {
8478
assertThat(new Path("/foobar").matches(null), is(false));
8579
}

spring-data-rest-core/src/test/java/org/springframework/data/rest/core/RepositoryRestConfigurationUnitTests.java

+10-37
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2016 the original author or authors.
2+
* Copyright 2015-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -51,40 +51,28 @@ public void setUp() {
5151
new MetadataConfiguration(), mock(EnumTranslationConfiguration.class));
5252
}
5353

54-
/**
55-
* @see DATAREST-34
56-
*/
57-
@Test
54+
@Test // DATAREST-34
5855
public void returnsBodiesIfAcceptHeaderPresentByDefault() {
5956

6057
assertThat(configuration.returnBodyOnCreate(MediaType.APPLICATION_JSON_VALUE), is(true));
6158
assertThat(configuration.returnBodyOnUpdate(MediaType.APPLICATION_JSON_VALUE), is(true));
6259
}
6360

64-
/**
65-
* @see DATAREST-34
66-
*/
67-
@Test
61+
@Test // DATAREST-34
6862
public void doesNotReturnBodiesIfNoAcceptHeaderPresentByDefault() {
6963

7064
assertThat(configuration.returnBodyOnCreate(null), is(false));
7165
assertThat(configuration.returnBodyOnUpdate(null), is(false));
7266
}
7367

74-
/**
75-
* @see DATAREST-34
76-
*/
77-
@Test
68+
@Test // DATAREST-34
7869
public void doesNotReturnBodiesIfEmptyAcceptHeaderPresentByDefault() {
7970

8071
assertThat(configuration.returnBodyOnCreate(""), is(false));
8172
assertThat(configuration.returnBodyOnUpdate(""), is(false));
8273
}
8374

84-
/**
85-
* @see DATAREST-34
86-
*/
87-
@Test
75+
@Test // DATAREST-34
8876
public void doesNotReturnBodyForUpdateIfExplicitlyDeactivated() {
8977

9078
configuration.setReturnBodyOnUpdate(false);
@@ -94,10 +82,7 @@ public void doesNotReturnBodyForUpdateIfExplicitlyDeactivated() {
9482
assertThat(configuration.returnBodyOnUpdate(MediaType.APPLICATION_JSON_VALUE), is(false));
9583
}
9684

97-
/**
98-
* @see DATAREST-34
99-
*/
100-
@Test
85+
@Test // DATAREST-34
10186
public void doesNotReturnBodyForCreateIfExplicitlyDeactivated() {
10287

10388
configuration.setReturnBodyOnCreate(false);
@@ -107,10 +92,7 @@ public void doesNotReturnBodyForCreateIfExplicitlyDeactivated() {
10792
assertThat(configuration.returnBodyOnCreate(MediaType.APPLICATION_JSON_VALUE), is(false));
10893
}
10994

110-
/**
111-
* @see DATAREST-34
112-
*/
113-
@Test
95+
@Test // DATAREST-34
11496
public void returnsBodyForUpdateIfExplicitlyActivated() {
11597

11698
configuration.setReturnBodyOnUpdate(true);
@@ -120,10 +102,7 @@ public void returnsBodyForUpdateIfExplicitlyActivated() {
120102
assertThat(configuration.returnBodyOnUpdate(MediaType.APPLICATION_JSON_VALUE), is(true));
121103
}
122104

123-
/**
124-
* @see DATAREST-34
125-
*/
126-
@Test
105+
@Test // DATAREST-34
127106
public void returnsBodyForCreateIfExplicitlyActivated() {
128107

129108
configuration.setReturnBodyOnCreate(true);
@@ -133,21 +112,15 @@ public void returnsBodyForCreateIfExplicitlyActivated() {
133112
assertThat(configuration.returnBodyOnCreate(MediaType.APPLICATION_JSON_VALUE), is(true));
134113
}
135114

136-
/**
137-
* @see DATAREST-776
138-
*/
139-
@Test
115+
@Test // DATAREST-776
140116
public void considersDomainTypeOfValueRepositoryLookupTypes() {
141117

142118
configuration.withEntityLookup().forLookupRepository(ProfileRepository.class);
143119

144120
assertThat(configuration.isLookupType(Profile.class), is(true));
145121
}
146122

147-
/**
148-
* @see DATAREST-573
149-
*/
150-
@Test
123+
@Test // DATAREST-573
151124
public void configuresCorsProcessing() {
152125

153126
RepositoryCorsRegistry registry = configuration.getCorsRegistry();

spring-data-rest-core/src/test/java/org/springframework/data/rest/core/UriToEntityConverterUnitTests.java

+11-41
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015-2016 the original author or authors.
2+
* Copyright 2015-2017 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -70,10 +70,7 @@ public void setUp() {
7070
repositories);
7171
}
7272

73-
/**
74-
* @see DATAREST-427
75-
*/
76-
@Test
73+
@Test // DATAREST-427
7774
public void supportsOnlyEntitiesWithIdProperty() {
7875

7976
Set<ConvertiblePair> result = converter.getConvertibleTypes();
@@ -82,37 +79,25 @@ public void supportsOnlyEntitiesWithIdProperty() {
8279
assertThat(result, not(hasItem(new ConvertiblePair(URI.class, NonEntity.class))));
8380
}
8481

85-
/**
86-
* @see DATAREST-427
87-
*/
88-
@Test
82+
@Test // DATAREST-427
8983
public void cannotConvertEntityWithIdPropertyIfStringConversionMissing() {
9084
assertThat(converter.matches(URI_TYPE, ENTITY_TYPE), is(false));
9185
}
9286

93-
/**
94-
* @see DATAREST-427
95-
*/
96-
@Test
87+
@Test // DATAREST-427
9788
public void canConvertEntityWithIdPropertyAndFromStringConversionPossible() {
9889

9990
doReturn(mock(RepositoryInformation.class)).when(repositories).getRepositoryInformationFor(ENTITY_TYPE.getType());
10091

10192
assertThat(converter.matches(URI_TYPE, ENTITY_TYPE), is(true));
10293
}
10394

104-
/**
105-
* @see DATAREST-427
106-
*/
107-
@Test
95+
@Test // DATAREST-427
10896
public void cannotConvertEntityWithoutIdentifier() {
10997
assertThat(converter.matches(URI_TYPE, TypeDescriptor.valueOf(NonEntity.class)), is(false));
11098
}
11199

112-
/**
113-
* @see DATAREST-427
114-
*/
115-
@Test
100+
@Test // DATAREST-427
116101
public void invokesConverterWithLastUriPathSegment() {
117102

118103
Entity reference = new Entity();
@@ -124,42 +109,27 @@ public void invokesConverterWithLastUriPathSegment() {
124109
assertThat(converter.convert(URI.create("/foo/bar/1"), URI_TYPE, ENTITY_TYPE), is((Object) reference));
125110
}
126111

127-
/**
128-
* @see DATAREST-427
129-
*/
130-
@Test(expected = ConversionFailedException.class)
112+
@Test(expected = ConversionFailedException.class) // DATAREST-427
131113
public void rejectsUnknownType() {
132114
converter.convert(URI.create("/foo/1"), URI_TYPE, STRING_TYPE);
133115
}
134116

135-
/**
136-
* @see DATAREST-427
137-
*/
138-
@Test(expected = ConversionFailedException.class)
117+
@Test(expected = ConversionFailedException.class) // DATAREST-427
139118
public void rejectsUriWithLessThanTwoSegments() {
140119
converter.convert(URI.create("1"), URI_TYPE, ENTITY_TYPE);
141120
}
142121

143-
/**
144-
* @see DATAREST-741
145-
*/
146-
@Test(expected = IllegalArgumentException.class)
122+
@Test(expected = IllegalArgumentException.class) // DATAREST-741
147123
public void rejectsNullPersistentEntities() {
148124
new UriToEntityConverter(null, invokerFactory, repositories);
149125
}
150126

151-
/**
152-
* @see DATAREST-741
153-
*/
154-
@Test(expected = IllegalArgumentException.class)
127+
@Test(expected = IllegalArgumentException.class) // DATAREST-741
155128
public void rejectsNullRepositoryInvokerFactory() {
156129
new UriToEntityConverter(mock(PersistentEntities.class), null, repositories);
157130
}
158131

159-
/**
160-
* @see DATAREST-741
161-
*/
162-
@Test(expected = IllegalArgumentException.class)
132+
@Test(expected = IllegalArgumentException.class) // DATAREST-741
163133
public void rejectsNullRepositories() {
164134
new UriToEntityConverter(mock(PersistentEntities.class), invokerFactory, null);
165135
}

spring-data-rest-core/src/test/java/org/springframework/data/rest/core/ValidationErrorsUnitTests.java

+3-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016 the original author or authors.
2+
* Copyright 2016-2017 original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -47,10 +47,7 @@ public void setUp() {
4747
this.entities = new PersistentEntities(Arrays.asList(context));
4848
}
4949

50-
/**
51-
* @see DATAREST-798
52-
*/
53-
@Test
50+
@Test // DATAREST-798
5451
public void exposesNestedViolationsCorrectly() {
5552

5653
ValidationErrors errors = new ValidationErrors(new Foo(), entities);
@@ -62,10 +59,7 @@ public void exposesNestedViolationsCorrectly() {
6259
assertThat(errors.getFieldError().getField(), is("bars[0].field"));
6360
}
6461

65-
/**
66-
* @see DATAREST-801
67-
*/
68-
@Test
62+
@Test // DATAREST-801
6963
public void getsTheNestedFieldsValue() {
7064
expectedErrorBehavior(new ValidationErrors(new Foo(), entities));
7165
}

0 commit comments

Comments
 (0)