DATAREST-978 - Migrate ticket references in test code to Spring Framework style.

This commit is contained in:
Mark Paluch
2017-01-13 10:07:39 +01:00
parent 992512cf96
commit 6bb989018c
99 changed files with 518 additions and 1777 deletions

View File

@@ -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.
@@ -22,7 +22,6 @@ import javax.persistence.Entity;
/**
* @author Alex Leigh
* @see DATAREST-872
*/
@Data
@Entity

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.
@@ -29,7 +29,6 @@ import javax.persistence.OneToOne;
/**
* @author Alex Leigh
* @see DATAREST-872
*/
@Data
@Entity

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.
@@ -25,7 +25,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
/**
* @author Greg Turnquist
* @author Oliver Gierke
* @see DATAREST-463
*/
@Entity
public class Item {

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.
@@ -22,7 +22,6 @@ import org.springframework.web.bind.annotation.CrossOrigin;
* @author Greg Turnquist
* @author Oliver Gierke
* @author Mark Paluch
* @see DATAREST-463
*/
@CrossOrigin
public interface ItemRepository extends CrudRepository<Item, Long> {}

View File

@@ -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.
@@ -27,7 +27,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo;
/**
* @author Alex Leigh
* @see DATAREST-872
*/
@Data
@Entity

View File

@@ -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.
@@ -27,7 +27,6 @@ import com.fasterxml.jackson.annotation.JsonTypeInfo;
/**
* @author Alex Leigh
* @see DATAREST-872
*/
@Data
@Entity

View File

@@ -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.
@@ -22,7 +22,6 @@ import javax.persistence.Entity;
/**
* @author Alex Leigh
* @see DATAREST-872
*/
@Data
@Entity

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.
@@ -24,7 +24,6 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
/**
* @author Greg Turnquist
* @author Oliver Gierke
* @see DATAREST-463
*/
@Entity
public class User {

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.
@@ -20,6 +20,5 @@ import org.springframework.data.repository.CrudRepository;
/**
* @author Greg Turnquist
* @author Oliver Gierke
* @see DATAREST-463
*/
interface UserRepository extends CrudRepository<User, Long> {}

View File

@@ -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.
@@ -41,28 +41,19 @@ public class RepositoryControllerIntegrationTests extends AbstractControllerInte
@Autowired RepositoryController controller;
/**
* @see DATAREST-333
*/
@Test
@Test // DATAREST-333
public void rootResourceExposesGetOnly() {
HttpEntity<?> response = controller.optionsForRepositories();
assertAllowHeaders(response, HttpMethod.GET);
}
/**
* @see DATAREST-333, DATAREST-330
*/
@Test
@Test // DATAREST-333, DATAREST-330
public void headRequestReturnsNoContent() {
assertThat(controller.headForRepositories().getStatusCode(), is(HttpStatus.NO_CONTENT));
}
/**
* @see DATAREST-160, DATAREST-333, DATAREST-463
*/
@Test
@Test // DATAREST-160, DATAREST-333, DATAREST-463
public void exposesLinksToRepositories() {
RepositoryLinksResource resource = controller.listRepositories().getBody();

View File

@@ -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.
@@ -66,10 +66,7 @@ public class RepositoryEntityControllerIntegrationTests extends AbstractControll
@Autowired PersistentEntityResourceAssembler assembler;
@Autowired PersistentEntities entities;
/**
* @see DATAREST-217
*/
@Test(expected = HttpRequestMethodNotSupportedException.class)
@Test(expected = HttpRequestMethodNotSupportedException.class) // DATAREST-217
public void returnsNotFoundForListingEntitiesIfFindAllNotExported() throws Exception {
repository.save(new Address());
@@ -78,10 +75,7 @@ public class RepositoryEntityControllerIntegrationTests extends AbstractControll
controller.getCollectionResource(request, null, null, null);
}
/**
* @see DATAREST-217
*/
@Test(expected = HttpRequestMethodNotSupportedException.class)
@Test(expected = HttpRequestMethodNotSupportedException.class) // DATAREST-217
public void rejectsEntityCreationIfSaveIsNotExported() throws Exception {
RootResourceInformation request = getResourceInformation(Address.class);
@@ -89,10 +83,7 @@ public class RepositoryEntityControllerIntegrationTests extends AbstractControll
controller.postCollectionResource(request, null, null, MediaType.APPLICATION_JSON_VALUE);
}
/**
* @see DATAREST-301
*/
@Test
@Test // DATAREST-301
public void setsExpandedSelfUriInLocationHeader() throws Exception {
RootResourceInformation information = getResourceInformation(Order.class);
@@ -106,28 +97,19 @@ public class RepositoryEntityControllerIntegrationTests extends AbstractControll
assertThat(entity.getHeaders().getLocation().toString(), not(Matchers.endsWith("{?projection}")));
}
/**
* @see DATAREST-330
*/
@Test
@Test // DATAREST-330
public void exposesHeadForCollectionResourceIfExported() throws Exception {
ResponseEntity<?> entity = controller.headCollectionResource(getResourceInformation(Person.class),
new DefaultedPageable(null, false));
assertThat(entity.getStatusCode(), is(HttpStatus.NO_CONTENT));
}
/**
* @see DATAREST-330
*/
@Test(expected = ResourceNotFoundException.class)
@Test(expected = ResourceNotFoundException.class) // DATAREST-330
public void doesNotExposeHeadForCollectionResourceIfNotExported() throws Exception {
controller.headCollectionResource(getResourceInformation(CreditCard.class), new DefaultedPageable(null, false));
}
/**
* @see DATAREST-330
*/
@Test
@Test // DATAREST-330
public void exposesHeadForItemResourceIfExported() throws Exception {
Address address = repository.save(new Address());
@@ -138,48 +120,33 @@ public class RepositoryEntityControllerIntegrationTests extends AbstractControll
assertThat(entity.getStatusCode(), is(HttpStatus.NO_CONTENT));
}
/**
* @see DATAREST-330
*/
@Test(expected = ResourceNotFoundException.class)
@Test(expected = ResourceNotFoundException.class) // DATAREST-330
public void doesNotExposeHeadForItemResourceIfNotExisting() throws Exception {
controller.headForItemResource(getResourceInformation(CreditCard.class), 1L, assembler);
}
/**
* @see DATAREST-333
*/
@Test
@Test // DATAREST-333
public void doesNotExposeMethodsForOptionsIfNotHttpMethodsSupportedForCollectionResource() {
HttpEntity<?> response = controller.optionsForCollectionResource(getResourceInformation(Address.class));
assertAllowHeaders(response, OPTIONS);
}
/**
* @see DATAREST-333
*/
@Test
@Test // DATAREST-333
public void exposesSupportedHttpMethodsInAllowHeaderForOptionsRequestToCollectionResource() {
HttpEntity<?> response = controller.optionsForCollectionResource(getResourceInformation(Person.class));
assertAllowHeaders(response, GET, POST, HEAD, OPTIONS);
}
/**
* @see DATAREST-333
*/
@Test
@Test // DATAREST-333
public void exposesSupportedHttpMethodsInAllowHeaderForOptionsRequestToItemResource() {
HttpEntity<?> response = controller.optionsForItemResource(getResourceInformation(Person.class));
assertAllowHeaders(response, GET, PUT, PATCH, DELETE, HEAD, OPTIONS);
}
/**
* @see DATAREST-333, DATAREST-348
*/
@Test
@Test // DATAREST-333, DATAREST-348
public void optionsForItermResourceSetsAllowPatchHeader() {
ResponseEntity<?> entity = controller.optionsForItemResource(getResourceInformation(Person.class));
@@ -194,10 +161,7 @@ public class RepositoryEntityControllerIntegrationTests extends AbstractControll
MediaType.APPLICATION_JSON_VALUE));
}
/**
* @see DATAREST-34
*/
@Test
@Test // DATAREST-34
public void returnsBodyOnPutForUpdateIfAcceptHeaderPresentByDefault() throws Exception {
RootResourceInformation request = getResourceInformation(Order.class);
@@ -210,10 +174,7 @@ public class RepositoryEntityControllerIntegrationTests extends AbstractControll
MediaType.APPLICATION_JSON_VALUE).hasBody(), is(true));
}
/**
* @see DATAREST-34
*/
@Test
@Test // DATAREST-34
public void returnsBodyForCreatingPutIfAcceptHeaderPresentByDefault() throws HttpRequestMethodNotSupportedException {
RootResourceInformation request = getResourceInformation(Order.class);
@@ -224,10 +185,7 @@ public class RepositoryEntityControllerIntegrationTests extends AbstractControll
MediaType.APPLICATION_JSON_VALUE).hasBody(), is(true));
}
/**
* @see DATAREST-34
*/
@Test
@Test // DATAREST-34
public void returnsBodyForPostIfAcceptHeaderIsPresentByDefault() throws Exception {
RootResourceInformation request = getResourceInformation(Order.class);
@@ -239,10 +197,7 @@ public class RepositoryEntityControllerIntegrationTests extends AbstractControll
.hasBody(), is(true));
}
/**
* @see DATAREST-34
*/
@Test
@Test // DATAREST-34
public void doesNotReturnBodyForPostIfNoAcceptHeaderPresentByDefault() throws Exception {
RootResourceInformation request = getResourceInformation(Order.class);
@@ -255,10 +210,7 @@ public class RepositoryEntityControllerIntegrationTests extends AbstractControll
is(false));
}
/**
* @see DATAREST-581
*/
@Test
@Test // DATAREST-581
public void createsEtagForProjectedEntityCorrectly() throws Exception {
Address address = repository.save(new Address());
@@ -278,10 +230,7 @@ public class RepositoryEntityControllerIntegrationTests extends AbstractControll
assertThat(entity.getHeaders().getETag(), is(notNullValue()));
}
/**
* @see DATAREST-724
*/
@Test
@Test // DATAREST-724
public void deletesEntityWithCustomLookupCorrectly() throws Exception {
Address address = repository.save(new Address());

View File

@@ -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.
@@ -112,66 +112,42 @@ public class RepositorySearchControllerIntegrationTests extends AbstractControll
tester.withContentResource(new HasSelfLink(BASE.slash(metadata.getPath()).slash("{id}")));
}
/**
* @see DATAREST-330
*/
@Test(expected = ResourceNotFoundException.class)
@Test(expected = ResourceNotFoundException.class) // DATAREST-330
public void doesNotExposeHeadForSearchResourceIfResourceDoesnHaveSearches() {
controller.headForSearches(getResourceInformation(Author.class));
}
/**
* @see DATAREST-330
*/
@Test(expected = ResourceNotFoundException.class)
@Test(expected = ResourceNotFoundException.class) // DATAREST-330
public void exposesHeadForSearchResourceIfResourceIsNotExposed() {
controller.headForSearches(getResourceInformation(CreditCard.class));
}
/**
* @see DATAREST-330
*/
@Test
@Test // DATAREST-330
public void exposesHeadForSearchResourceIfResourceIsExposed() {
controller.headForSearches(getResourceInformation(Person.class));
}
/**
* @see DATAREST-330
*/
@Test
@Test // DATAREST-330
public void exposesHeadForExistingQueryMethodResource() {
controller.headForSearch(getResourceInformation(Person.class), "findByCreatedUsingISO8601Date");
}
/**
* @see DATAREST-330
*/
@Test(expected = ResourceNotFoundException.class)
@Test(expected = ResourceNotFoundException.class) // DATAREST-330
public void doesNotExposeHeadForInvalidQueryMethodResource() {
controller.headForSearch(getResourceInformation(Person.class), "foobar");
}
/**
* @see DATAREST-333
*/
@Test
@Test // DATAREST-333
public void searchResourceSupportsGetOnly() {
assertAllowHeaders(controller.optionsForSearches(getResourceInformation(Person.class)), HttpMethod.GET);
}
/**
* @see DATAREST-333
*/
@Test(expected = ResourceNotFoundException.class)
@Test(expected = ResourceNotFoundException.class) // DATAREST-333
public void returns404ForOptionsForRepositoryWithoutSearches() {
controller.optionsForSearches(getResourceInformation(Address.class));
}
/**
* @see DATAREST-333
*/
@Test
@Test // DATAREST-333
public void queryMethodResourceSupportsGetOnly() {
RootResourceInformation resourceInformation = getResourceInformation(Person.class);
@@ -180,10 +156,7 @@ public class RepositorySearchControllerIntegrationTests extends AbstractControll
assertAllowHeaders(response, HttpMethod.GET);
}
/**
* @see DATAREST-502
*/
@Test
@Test // DATAREST-502
public void interpretsUriAsReferenceToRelatedEntity() {
MultiValueMap<String, Object> parameters = new LinkedMultiValueMap<String, Object>(1);
@@ -197,10 +170,7 @@ public class RepositorySearchControllerIntegrationTests extends AbstractControll
assertThat(result.getBody(), is(instanceOf(Resources.class)));
}
/**
* @see DATAREST-515
*/
@Test
@Test // DATAREST-515
public void repositorySearchResourceExposesDomainType() {
RepositorySearchesResource searches = controller.listSearches(getResourceInformation(Person.class));

View File

@@ -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,20 +40,14 @@ import org.springframework.transaction.annotation.Transactional;
@Transactional
public class RootResourceInformationIntegrationTests extends AbstractControllerIntegrationTests {
/**
* @see DATAREST-217
*/
@Test
@Test // DATAREST-217
public void getIsNotSupportedIfFindAllIsNotExported() {
SupportedHttpMethods supportedMethods = getResourceInformation(Address.class).getSupportedMethods();
assertThat(supportedMethods.getMethodsFor(COLLECTION), not(hasItem(GET)));
}
/**
* @see DATAREST-217
*/
@Test
@Test // DATAREST-217
public void postIsNotSupportedIfSaveIsNotExported() {
SupportedHttpMethods supportedMethods = getResourceInformation(Address.class).getSupportedMethods();

View File

@@ -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.
@@ -91,10 +91,7 @@ public class AlpsControllerIntegrationTests extends AbstractControllerIntegratio
configuration.setEnableEnumTranslation(false);
}
/**
* @see DATAREST-230
*/
@Test
@Test // DATAREST-230
public void exposesAlpsCollectionResources() throws Exception {
Link profileLink = client.discoverUnique("profile");
@@ -105,10 +102,7 @@ public class AlpsControllerIntegrationTests extends AbstractControllerIntegratio
.andExpect(jsonPath("$.alps.descriptors[*].name", hasItems("people", "person")));
}
/**
* @see DATAREST-638
*/
@Test
@Test // DATAREST-638
public void verifyThatAlpsIsDefaultProfileFormat() throws Exception {
Link profileLink = client.discoverUnique("profile");
@@ -120,10 +114,7 @@ public class AlpsControllerIntegrationTests extends AbstractControllerIntegratio
}
/**
* @see DATAREST-463
*/
@Test
@Test // DATAREST-463
public void verifyThatAttributesIgnoredDontAppearInAlps() throws Exception {
Link profileLink = client.discoverUnique("profile");
@@ -138,10 +129,7 @@ public class AlpsControllerIntegrationTests extends AbstractControllerIntegratio
.andExpect(jsonPath("$.alps.descriptors[*].descriptors[*].name", not(hasItems("manager", "curator"))));
}
/**
* @see DATAREST-494
*/
@Test
@Test // DATAREST-494
public void linksToJsonSchemaFromRepresentationDescriptor() throws Exception {
Link profileLink = client.discoverUnique("profile");
@@ -156,10 +144,7 @@ public class AlpsControllerIntegrationTests extends AbstractControllerIntegratio
assertThat(href, endsWith("/profile/items"));
}
/**
* @see DATAREST-516
*/
@Test
@Test // DATAREST-516
public void referenceToAssociatedEntityDesciptorPointsToRepresentationDescriptor() throws Exception {
Link profileLink = client.discoverUnique("profile");
@@ -176,10 +161,7 @@ public class AlpsControllerIntegrationTests extends AbstractControllerIntegratio
assertThat(rt, allOf(containsString(ProfileController.PROFILE_ROOT_MAPPING), endsWith("-representation")));
}
/**
* @see DATAREST-630
*/
@Test
@Test // DATAREST-630
public void onlyExposesIdAttributesWhenExposedInTheConfiguration() throws Exception {
Link profileLink = client.discoverUnique("profile");
@@ -190,10 +172,7 @@ public class AlpsControllerIntegrationTests extends AbstractControllerIntegratio
.andExpect(jsonPath("$.alps.descriptors[*].descriptors[*].name", hasItems("id", "name")));
}
/**
* @see DATAREST-683
*/
@Test
@Test // DATAREST-683
public void enumValueListingsAreTranslatedIfEnabled() throws Exception {
configuration.setEnableEnumTranslation(true);
@@ -211,10 +190,7 @@ public class AlpsControllerIntegrationTests extends AbstractControllerIntegratio
assertThat(value, is("Male, Female, Undefined"));
}
/**
* @see DATAREST-753
*/
@Test
@Test // DATAREST-753
public void alpsCanHandleGroovyDomainObjects() throws Exception {
Link profileLink = client.discoverUnique("profile");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2017 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 CorsIntegrationTests extends AbstractWebIntegrationTests {
}
}
/**
* @see DATAREST-573
*/
@Test
@Test // DATAREST-573
public void appliesSelectiveDefaultCorsConfiguration() throws Exception {
Link findItems = client.discoverUnique("items");
@@ -81,10 +78,7 @@ public class CorsIntegrationTests extends AbstractWebIntegrationTests {
header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, "GET,HEAD,POST,PUT,PATCH,DELETE,OPTIONS,TRACE"));
}
/**
* @see DATAREST-573
*/
@Test
@Test // DATAREST-573
public void appliesGlobalCorsConfiguration() throws Exception {
Link findBooks = client.discoverUnique("books");
@@ -103,10 +97,9 @@ public class CorsIntegrationTests extends AbstractWebIntegrationTests {
}
/**
* @see DATAREST-573
* @see BooksXmlController
*/
@Test
@Test // DATAREST-573
public void appliesCorsConfigurationOnCustomControllers() throws Exception {
// Preflight request
@@ -128,10 +121,9 @@ public class CorsIntegrationTests extends AbstractWebIntegrationTests {
}
/**
* @see DATAREST-573
* @see BooksPdfController
*/
@Test
@Test // DATAREST-573
public void appliesCorsConfigurationOnCustomControllerMethod() throws Exception {
// Preflight request
@@ -144,10 +136,7 @@ public class CorsIntegrationTests extends AbstractWebIntegrationTests {
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, containsString("GET,PUT,POST")));
}
/**
* @see DATAREST-573
*/
@Test
@Test // DATAREST-573
public void appliesCorsConfigurationOnRepository() throws Exception {
Link authorsLink = client.discoverUnique("authors");
@@ -162,10 +151,7 @@ public class CorsIntegrationTests extends AbstractWebIntegrationTests {
.andExpect(header().string(HttpHeaders.ACCESS_CONTROL_ALLOW_METHODS, "GET,PATCH"));
}
/**
* @see DATAREST-573
*/
@Test
@Test // DATAREST-573
public void appliesCorsConfigurationOnRepositoryToCustomControllers() throws Exception {
// Preflight request

View File

@@ -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.
@@ -77,10 +77,7 @@ public class DataRest262Tests {
mapper.setVisibility(PropertyAccessor.FIELD, Visibility.ANY);
}
/**
* @see DATAREST-262
*/
@Test
@Test // DATAREST-262
public void deserializesNestedAssociation() throws Exception {
Airport airport = repository.save(new Airport());
@@ -90,10 +87,7 @@ public class DataRest262Tests {
assertThat(result.orgOrDstFlightPart.airport.id, is(airport.id));
}
/**
* @see DATAREST-262
*/
@Test
@Test // DATAREST-262
@Ignore
public void serializesLinksToNestedAssociations() throws Exception {

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.
@@ -87,10 +87,7 @@ public class DataRest363Tests {
this.frodo = personRepository.save(new Person("Frodo", "Baggins"));
}
/**
* @see DATAREST-363
*/
@Test
@Test // DATAREST-363
public void testBasics() throws Exception {
ResultActions frodoActions = testMvcClient.follow("/people/".concat(frodo.getId().toString()));

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2017 original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -90,10 +90,7 @@ public class JpaDefaultPageableWebTests extends AbstractWebIntegrationTests {
super.setUp();
}
/**
* @see DATAREST-906
*/
@Test
@Test // DATAREST-906
public void executesSearchThatTakesAMappedSortProperty() throws Exception {
Link findBySortedLink = client.discoverUnique("books", "search", "find-spring-books-sorted");
@@ -112,10 +109,7 @@ public class JpaDefaultPageableWebTests extends AbstractWebIntegrationTests {
andExpect(jsonPath("$._embedded.books[1].title").doesNotExist());
}
/**
* @see DATAREST-906
*/
@Test
@Test // DATAREST-906
public void shouldApplyDefaultPageable() throws Exception {
mvc.perform(get("/books/default-pageable"))//
@@ -123,10 +117,7 @@ public class JpaDefaultPageableWebTests extends AbstractWebIntegrationTests {
.andExpect(jsonPath("$.size").value(1));
}
/**
* @see DATAREST-906
*/
@Test
@Test // DATAREST-906
public void shouldOverrideDefaultPageable() throws Exception {
mvc.perform(get("/books/default-pageable?size=10"))//

View File

@@ -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.
@@ -115,10 +115,7 @@ public class JpaWebTests extends CommonWebTests {
return map;
}
/**
* @see DATAREST-99
*/
@Test
@Test // DATAREST-99
public void doesNotExposeCreditCardRepository() throws Exception {
mvc.perform(get("/")). //
@@ -143,10 +140,7 @@ public class JpaWebTests extends CommonWebTests {
assertDoesNotHaveLinkWithRel(Link.REL_NEXT, response);
}
/**
* @see DATAREST-169
*/
@Test
@Test // DATAREST-169
public void exposesLinkForRelatedResource() throws Exception {
MockHttpServletResponse response = client.request("/");
@@ -158,10 +152,7 @@ public class JpaWebTests extends CommonWebTests {
assertThat(client.request(creatorLink), is(notNullValue()));
}
/**
* @see DATAREST-200
*/
@Test
@Test // DATAREST-200
public void exposesInlinedEntities() throws Exception {
MockHttpServletResponse response = client.request("/");
@@ -171,10 +162,7 @@ public class JpaWebTests extends CommonWebTests {
assertHasJsonPathValue("$..lineItems", orders);
}
/**
* @see DATAREST-199
*/
@Test
@Test // DATAREST-199
public void createsOrderUsingPut() throws Exception {
mvc.perform(//
@@ -183,10 +171,7 @@ public class JpaWebTests extends CommonWebTests {
).andExpect(status().isCreated());
}
/**
* @see DATAREST-117
*/
@Test
@Test // DATAREST-117
public void createPersonThenVerifyIgnoredAttributesDontExist() throws Exception {
Link peopleLink = client.discoverUnique("people");
@@ -206,10 +191,7 @@ public class JpaWebTests extends CommonWebTests {
assertJsonPathDoesntExist("$.weight", response);
}
/**
* @see DATAREST-95
*/
@Test
@Test // DATAREST-95
public void createThenPatch() throws Exception {
Link peopleLink = client.discoverUnique("people");
@@ -233,10 +215,7 @@ public class JpaWebTests extends CommonWebTests {
assertThat((String) JsonPath.read(frodo.getContentAsString(), "$.lastName"), is("Baggins"));
}
/**
* @see DATAREST-150
*/
@Test
@Test // DATAREST-150
public void createThenPut() throws Exception {
Link peopleLink = client.discoverUnique("people");
@@ -268,10 +247,7 @@ public class JpaWebTests extends CommonWebTests {
assertPersonWithNameAndSiblingLink("Billy Bob");
}
/**
* @see DATAREST-219
*/
@Test
@Test // DATAREST-219
public void manipulatePropertyCollectionRestfullyWithMultiplePosts() throws Exception {
List<Link> links = preparePersonResources(new Person("Frodo", "Baggins"), //
@@ -288,10 +264,7 @@ public class JpaWebTests extends CommonWebTests {
assertSiblingNames(frodosSiblingLink, "Bilbo", "Merry", "Pippin");
}
/**
* @see DATAREST-219
*/
@Test
@Test // DATAREST-219
public void manipulatePropertyCollectionRestfullyWithSinglePost() throws Exception {
List<Link> links = preparePersonResources(new Person("Frodo", "Baggins"), //
@@ -306,10 +279,7 @@ public class JpaWebTests extends CommonWebTests {
assertSiblingNames(frodosSiblingLink, "Bilbo", "Merry", "Pippin");
}
/**
* @see DATAREST-219
*/
@Test
@Test // DATAREST-219
public void manipulatePropertyCollectionRestfullyWithMultiplePuts() throws Exception {
List<Link> links = preparePersonResources(new Person("Frodo", "Baggins"), //
@@ -328,10 +298,7 @@ public class JpaWebTests extends CommonWebTests {
assertSiblingNames(frodosSiblingsLink, "Merry", "Pippin");
}
/**
* @see DATAREST-219
*/
@Test
@Test // DATAREST-219
public void manipulatePropertyCollectionRestfullyWithSinglePut() throws Exception {
List<Link> links = preparePersonResources(new Person("Frodo", "Baggins"), //
@@ -351,10 +318,7 @@ public class JpaWebTests extends CommonWebTests {
assertSiblingNames(frodoSiblingLink, "Merry", "Pippin");
}
/**
* @see DATAREST-219
*/
@Test
@Test // DATAREST-219
public void manipulatePropertyCollectionRestfullyWithDelete() throws Exception {
List<Link> links = preparePersonResources(new Person("Frodo", "Baggins"), //
@@ -374,10 +338,7 @@ public class JpaWebTests extends CommonWebTests {
assertSiblingNames(frodosSiblingsLink, "Bilbo", "Merry");
}
/**
* @see DATAREST-50
*/
@Test
@Test // DATAREST-50
public void propertiesCanHaveNulls() throws Exception {
Link peopleLink = client.discoverUnique("people");
@@ -394,10 +355,7 @@ public class JpaWebTests extends CommonWebTests {
assertNull(JsonPath.read(responseBody, "$.lastName"));
}
/**
* @see DATAREST-238
*/
@Test
@Test // DATAREST-238
public void putShouldWorkDespiteExistingLinks() throws Exception {
Link peopleLink = client.discoverUnique("people");
@@ -419,10 +377,7 @@ public class JpaWebTests extends CommonWebTests {
assertJsonPathEquals("$.firstName", "Bilbo", overwrittenResponse);
}
/**
* @see DATAREST-217
*/
@Test
@Test // DATAREST-217
public void doesNotAllowGetToCollectionResourceIfFindAllIsNotExported() throws Exception {
Link link = client.discoverUnique("addresses");
@@ -431,10 +386,7 @@ public class JpaWebTests extends CommonWebTests {
andExpect(status().isMethodNotAllowed());
}
/**
* @see DATAREST-217
*/
@Test
@Test // DATAREST-217
public void doesNotAllowPostToCollectionResourceIfSaveIsNotExported() throws Exception {
Link link = client.discoverUnique("addresses");
@@ -447,9 +399,8 @@ public class JpaWebTests extends CommonWebTests {
* Checks, that the server only returns the properties contained in the projection requested.
*
* @see OrderSummary
* @see DATAREST-221
*/
@Test
@Test // DATAREST-221
public void returnsProjectionIfRequested() throws Exception {
Link orders = client.discoverUnique("orders");
@@ -468,18 +419,12 @@ public class JpaWebTests extends CommonWebTests {
assertJsonPathDoesntExist("$.lineItems", response);
}
/**
* @see DATAREST-261
*/
@Test
@Test // DATAREST-261
public void relProviderDetectsCustomizedMapping() {
assertThat(relProvider.getCollectionResourceRelFor(Person.class), is("people"));
}
/**
* @see DATAREST-311
*/
@Test
@Test // DATAREST-311
public void onlyLinksShouldAppearWhenExecuteSearchCompact() throws Exception {
Link peopleLink = client.discoverUnique("people");
@@ -505,10 +450,7 @@ public class JpaWebTests extends CommonWebTests {
assertThat(JsonPath.<JSONArray> read(responseBody, "$.content"), hasSize(0));
}
/**
* @see DATAREST-317
*/
@Test
@Test // DATAREST-317
public void rendersExcerptProjectionsCorrectly() throws Exception {
Link authorsLink = client.discoverUnique("authors");
@@ -531,10 +473,7 @@ public class JpaWebTests extends CommonWebTests {
client.follow(new Link(href)).andExpect(client.hasLinkWithRel("books"));
}
/**
* @see DATAREST-353
*/
@Test
@Test // DATAREST-353
public void returns404WhenTryingToDeleteANonExistingResource() throws Exception {
Link receiptsLink = client.discoverUnique("receipts");
@@ -543,10 +482,7 @@ public class JpaWebTests extends CommonWebTests {
andExpect(status().isNotFound());
}
/**
* @see DATAREST-384
*/
@Test
@Test // DATAREST-384
public void exectuesSearchThatTakesASort() throws Exception {
Link booksLink = client.discoverUnique("books");
@@ -569,10 +505,7 @@ public class JpaWebTests extends CommonWebTests {
andExpect(client.hasLinkWithRel("self"));
}
/**
* @see DATAREST-160
*/
@Test
@Test // DATAREST-160
public void returnConflictWhenConcurrentlyEditingVersionedEntity() throws Exception {
Link receiptLink = client.discoverUnique("receipts");
@@ -599,10 +532,7 @@ public class JpaWebTests extends CommonWebTests {
.andExpect(status().isPreconditionFailed());
}
/**
* @see DATAREST-423
*/
@Test
@Test // DATAREST-423
public void invokesCustomControllerAndBindsDomainObjectCorrectly() throws Exception {
MockHttpServletResponse authorsResponse = client.request(client.discoverUnique("authors"));
@@ -613,10 +543,7 @@ public class JpaWebTests extends CommonWebTests {
andExpect(status().isIAmATeapot());
}
/**
* @see DATAREST-523
*/
@Test
@Test // DATAREST-523
public void augmentsCollectionAssociationUsingPost() throws Exception {
List<Link> links = preparePersonResources(new Person("Frodo", "Baggins"), //
@@ -637,10 +564,7 @@ public class JpaWebTests extends CommonWebTests {
}
}
/**
* @see DATAREST-658
*/
@Test
@Test // DATAREST-658
public void returnsLinkHeadersForHeadRequestToItemResource() throws Exception {
MockHttpServletResponse response = client.request(client.discoverUnique("people"));
@@ -655,10 +579,7 @@ public class JpaWebTests extends CommonWebTests {
assertThat(links.hasLink("person"), is(true));
}
/**
* @see DATAREST-883
*/
@Test
@Test // DATAREST-883
public void exectuesSearchThatTakesAMappedSortProperty() throws Exception {
Link findBySortedLink = client.discoverUnique("books", "search", "find-by-sorted");
@@ -679,10 +600,7 @@ public class JpaWebTests extends CommonWebTests {
andExpect(client.hasLinkWithRel("self"));
}
/**
* @see DATAREST-883
*/
@Test
@Test // DATAREST-883
public void exectuesCustomQuerySearchThatTakesAMappedSortProperty() throws Exception {
Link findByLink = client.discoverUnique("books", "search", "find-spring-books-sorted");
@@ -702,10 +620,7 @@ public class JpaWebTests extends CommonWebTests {
andExpect(client.hasLinkWithRel("self"));
}
/**
* @see DATAREST-910
*/
@Test
@Test // DATAREST-910
public void callUnmappedCustomRepositoryController() throws Exception {
mvc.perform(post("/orders/search/sort")).andExpect(status().isOk());

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.
@@ -73,11 +73,7 @@ public class ProfileIntegrationTests extends AbstractControllerIntegrationTests
this.client = new TestMvcClient(mvc, this.discoverers);
}
/**
* @see DATAREST-230
* @see DATAREST-638
*/
@Test
@Test // DATAREST-230, DATAREST-638
public void exposesProfileLink() throws Exception {
client.follow(ROOT_URI)//
@@ -85,11 +81,7 @@ public class ProfileIntegrationTests extends AbstractControllerIntegrationTests
.andExpect(jsonPath("$._links.profile.href", endsWith(ProfileController.PROFILE_ROOT_MAPPING)));
}
/**
* @see DATAREST-230
* @see DATAREST-638
*/
@Test
@Test // DATAREST-230, DATAREST-638
public void profileRootLinkContainsMetadataForEachRepo() throws Exception {
Link profileLink = client.discoverUnique(new Link(ROOT_URI), ProfileResourceProcessor.PROFILE_REL);
@@ -104,10 +96,7 @@ public class ProfileIntegrationTests extends AbstractControllerIntegrationTests
assertThat(client.discoverUnique(profileLink, "addresses", MediaType.ALL), is(notNullValue()));
}
/**
* @see DATAREST-638
*/
@Test
@Test // DATAREST-638
public void profileLinkOnCollectionResourceLeadsToRepositorySpecificMetadata() throws Exception {
Link peopleLink = client.discoverUnique(new Link(ROOT_URI), "people");

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2017 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,7 +27,6 @@ import javax.persistence.Id;
*
* @author Greg Turnquist
* @author Oliver Gierke
* @see DATAREST-754
*/
@Entity
public class SimulatedGroovyDomainClass implements GroovyObject {

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2016 the original author or authors.
* Copyright 2016-2017 original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,5 @@ import org.springframework.data.rest.webmvc.jpa.groovy.SimulatedGroovyDomainClas
* Simulates a repository built on a Groovy domain object.
*
* @author Greg Turnquist
* @see DATAREST-754
*/
public interface SimulatedGroovyDomainClassRepository extends CrudRepository<SimulatedGroovyDomainClass, Long> {}

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.
@@ -69,10 +69,7 @@ public class Jackson2DatatypeHelperIntegrationTests {
em.clear();
}
/**
* @see DATAREST-500
*/
@Test
@Test // DATAREST-500
public void configuresHIbernate4ModuleToLoadLazyLoadingProxies() throws Exception {
PersistentEntity<?, ?> entity = entities.getPersistentEntity(Order.class);

View File

@@ -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.
@@ -126,10 +126,7 @@ public class PersistentEntitySerializationTests {
assertThat(p.getSiblings(), is(Collections.EMPTY_LIST));
}
/**
* @see DATAREST-238
*/
@Test
@Test // DATAREST-238
public void deserializePersonWithLinks() throws IOException {
String bilbo = "{\n" + " \"_links\" : {\n" + " \"self\" : {\n"
@@ -144,10 +141,7 @@ public class PersistentEntitySerializationTests {
assertThat(p.getLastName(), equalTo("Baggins"));
}
/**
* @see DATAREST-238
*/
@Test
@Test // DATAREST-238
public void serializesPersonEntity() throws IOException, InterruptedException {
PersistentEntity<?, ?> persistentEntity = repositories.getPersistentEntity(Person.class);
@@ -168,10 +162,7 @@ public class PersistentEntitySerializationTests {
assertThat(siblingLink.getHref(), endsWith(new UriTemplate("/{id}/siblings").expand(person.getId()).toString()));
}
/**
* @see DATAREST-248
*/
@Test
@Test // DATAREST-248
public void deserializesPersonWithLinkToOtherPersonCorrectly() throws Exception {
Person father = people.save(new Person("John", "Doe"));
@@ -182,10 +173,7 @@ public class PersistentEntitySerializationTests {
assertThat(result.getFather(), is(father));
}
/**
* @see DATAREST-248
*/
@Test
@Test // DATAREST-248
public void deserializesPersonWithLinkToOtherPersonsCorrectly() throws Exception {
Person firstSibling = people.save(new Person("John", "Doe"));
@@ -198,10 +186,7 @@ public class PersistentEntitySerializationTests {
assertThat(result.getSiblings(), hasItems(firstSibling, secondSibling));
}
/**
* @see DATAREST-248
*/
@Test
@Test // DATAREST-248
public void deserializesEmbeddedAssociationsCorrectly() throws Exception {
String content = TestUtils.readFileFromClasspath("order.json");
@@ -210,10 +195,7 @@ public class PersistentEntitySerializationTests {
assertThat(order.getLineItems(), hasSize(2));
}
/**
* @see DATAREST-250
*/
@Test
@Test // DATAREST-250
public void serializesReferencesWithinPagedResourceCorrectly() throws Exception {
Person creator = new Person("Dave", "Matthews");
@@ -235,10 +217,7 @@ public class PersistentEntitySerializationTests {
assertThat(JsonPath.read(result, "$._embedded.orders[*].lineItems"), is(notNullValue()));
}
/**
* @see DATAREST-521
*/
@Test
@Test // DATAREST-521
public void serializesLinksForExcerpts() throws Exception {
Person dave = new Person("Dave", "Matthews");
@@ -261,10 +240,7 @@ public class PersistentEntitySerializationTests {
assertThat(JsonPath.read(result, "$._embedded.father[*]._links.self"), is(notNullValue()));
}
/**
* @see DATAREST-521
*/
@Test
@Test // DATAREST-521
public void rendersAdditionalLinksRegisteredWithResource() throws Exception {
Person dave = new Person("Dave", "Matthews");
@@ -280,10 +256,7 @@ public class PersistentEntitySerializationTests {
assertThat(JsonPath.read(result, "$._links.processed"), is(notNullValue()));
}
/**
* @see DATAREST-697
*/
@Test
@Test // DATAREST-697
public void rendersProjectionWithinSimpleResourceCorrectly() throws Exception {
Person person = new Person("Dave", "Matthews");
@@ -297,10 +270,7 @@ public class PersistentEntitySerializationTests {
assertThat(JsonPath.read(result, "$._links.self"), is(notNullValue()));
}
/**
* @see DATAREST-880
*/
@Test
@Test // DATAREST-880
public void unwrapsNestedTypeCorrectly() throws Exception {
CreditCard creditCard = new CreditCard(new CreditCard.CCN("1234123412341234"));
@@ -308,10 +278,7 @@ public class PersistentEntitySerializationTests {
assertThat(JsonPath.read(mapper.writeValueAsString(creditCard), "$.ccn"), is("1234123412341234"));
}
/**
* @see DATAREST-872
*/
@Test
@Test // DATAREST-872
public void serializesInheritance() throws Exception {
Suite suite = new Suite();

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2014-2016 the original author or authors.
* Copyright 2014-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,10 +44,7 @@ public class BackendIdConverterHandlerMethodArgumentResolverIntegrationTests
@Autowired BackendIdHandlerMethodArgumentResolver resolver;
/**
* @see DATAREST-155
*/
@Test
@Test // DATAREST-155
public void translatesUriToBackendId() throws Exception {
Method method = ReflectionUtils.findMethod(SampleController.class, "resolveId", Serializable.class);

View File

@@ -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.
@@ -64,10 +64,7 @@ public class RepositoryEntityLinksIntegrationTests extends AbstractControllerInt
assertThat(link.getRel(), is("people"));
}
/**
* @see DATAREST-221
*/
@Test
@Test // DATAREST-221
public void returnsLinkWithProjectionTemplateVariableIfProjectionIsDefined() {
Link link = entityLinks.linkToSingleResource(Order.class, 1);
@@ -76,20 +73,14 @@ public class RepositoryEntityLinksIntegrationTests extends AbstractControllerInt
assertThat(link.getVariableNames(), hasItem(configuration.getProjectionConfiguration().getParameterName()));
}
/**
* @see DATAREST-155
*/
@Test
@Test // DATAREST-155
public void usesCustomGeneratedBackendId() {
Link link = entityLinks.linkToSingleResource(Book.class, 7L);
assertThat(link.expand().getHref(), endsWith("/7-7-7-7-7-7-7"));
}
/**
* @see DATAREST-317
*/
@Test
@Test // DATAREST-317
public void adaptsToExistingPageable() {
Link link = entityLinks.linkToPagedResource(Person.class, new PageRequest(0, 10));
@@ -99,10 +90,7 @@ public class RepositoryEntityLinksIntegrationTests extends AbstractControllerInt
assertThat(link.getVariableNames(), hasItems("sort", "projection"));
}
/**
* @see DATAREST-467
*/
@Test
@Test // DATAREST-467
public void returnsLinksToSearchResources() {
Links links = entityLinks.linksToSearchResources(Person.class);
@@ -114,10 +102,7 @@ public class RepositoryEntityLinksIntegrationTests extends AbstractControllerInt
assertThat(firstnameLink.getVariableNames(), hasItems("page", "size"));
}
/**
* @see DATAREST-467
*/
@Test
@Test // DATAREST-467
public void returnsLinkToSearchResource() {
Link link = entityLinks.linkToSearchResource(Person.class, "firstname");
@@ -127,11 +112,7 @@ public class RepositoryEntityLinksIntegrationTests extends AbstractControllerInt
assertThat(link.getVariableNames(), hasItems("firstname", "page", "size"));
}
/**
* @see DATAREST-467
* @see DATAREST-519
*/
@Test
@Test // DATAREST-467, DATAREST-519
public void prepopulatesPaginationInformationForSearchResourceLink() {
Link link = entityLinks.linkToSearchResource(Person.class, "firstname", new PageRequest(0, 10));
@@ -145,10 +126,7 @@ public class RepositoryEntityLinksIntegrationTests extends AbstractControllerInt
assertThat(components.getQueryParams(), allOf(hasKey("page"), hasKey("size")));
}
/**
* @see DATAREST-467
*/
@Test
@Test // DATAREST-467
public void returnsTemplatedLinkForSortedSearchResource() {
Link link = entityLinks.linkToSearchResource(Person.class, "lastname");
@@ -157,11 +135,7 @@ public class RepositoryEntityLinksIntegrationTests extends AbstractControllerInt
assertThat(link.getVariableNames(), hasItems("lastname", "sort"));
}
/**
* @see DATAREST-467
* @see DATAREST-519
*/
@Test
@Test // DATAREST-467, DATAREST-519
public void prepopulatesSortInformationForSearchResourceLink() {
Link link = entityLinks.linkToSearchResource(Person.class, "lastname", new Sort("firstname"));
@@ -175,12 +149,7 @@ public class RepositoryEntityLinksIntegrationTests extends AbstractControllerInt
assertThat(components.getQueryParams(), hasKey("sort"));
}
/**
* @see DATAREST-668
* @see DATAREST-519
* @see DATAREST-467
*/
@Test
@Test // DATAREST-668, DATAREST-519, DATAREST-467
public void addsProjectVariableToSearchResourceIfAvailable() {
for (Link link : entityLinks.linksToSearchResources(Book.class)) {