DATAREST-978 - Migrate ticket references in test code to Spring Framework style.
This commit is contained in:
@@ -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.
|
||||
@@ -68,18 +68,12 @@ public class PathUnitTests {
|
||||
assertThat(new Path("http://localhost").toString(), is("http://localhost"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-222
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-222
|
||||
public void doesNotMatchIfReferenceContainsReservedCharacters() {
|
||||
assertThat(new Path("/foobar").matches("barfoo{?foo}"), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-222
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-222
|
||||
public void doesNotMatchNullReference() {
|
||||
assertThat(new Path("/foobar").matches(null), is(false));
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -51,40 +51,28 @@ public class RepositoryRestConfigurationUnitTests {
|
||||
new MetadataConfiguration(), mock(EnumTranslationConfiguration.class));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-34
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-34
|
||||
public void returnsBodiesIfAcceptHeaderPresentByDefault() {
|
||||
|
||||
assertThat(configuration.returnBodyOnCreate(MediaType.APPLICATION_JSON_VALUE), is(true));
|
||||
assertThat(configuration.returnBodyOnUpdate(MediaType.APPLICATION_JSON_VALUE), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-34
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-34
|
||||
public void doesNotReturnBodiesIfNoAcceptHeaderPresentByDefault() {
|
||||
|
||||
assertThat(configuration.returnBodyOnCreate(null), is(false));
|
||||
assertThat(configuration.returnBodyOnUpdate(null), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-34
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-34
|
||||
public void doesNotReturnBodiesIfEmptyAcceptHeaderPresentByDefault() {
|
||||
|
||||
assertThat(configuration.returnBodyOnCreate(""), is(false));
|
||||
assertThat(configuration.returnBodyOnUpdate(""), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-34
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-34
|
||||
public void doesNotReturnBodyForUpdateIfExplicitlyDeactivated() {
|
||||
|
||||
configuration.setReturnBodyOnUpdate(false);
|
||||
@@ -94,10 +82,7 @@ public class RepositoryRestConfigurationUnitTests {
|
||||
assertThat(configuration.returnBodyOnUpdate(MediaType.APPLICATION_JSON_VALUE), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-34
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-34
|
||||
public void doesNotReturnBodyForCreateIfExplicitlyDeactivated() {
|
||||
|
||||
configuration.setReturnBodyOnCreate(false);
|
||||
@@ -107,10 +92,7 @@ public class RepositoryRestConfigurationUnitTests {
|
||||
assertThat(configuration.returnBodyOnCreate(MediaType.APPLICATION_JSON_VALUE), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-34
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-34
|
||||
public void returnsBodyForUpdateIfExplicitlyActivated() {
|
||||
|
||||
configuration.setReturnBodyOnUpdate(true);
|
||||
@@ -120,10 +102,7 @@ public class RepositoryRestConfigurationUnitTests {
|
||||
assertThat(configuration.returnBodyOnUpdate(MediaType.APPLICATION_JSON_VALUE), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-34
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-34
|
||||
public void returnsBodyForCreateIfExplicitlyActivated() {
|
||||
|
||||
configuration.setReturnBodyOnCreate(true);
|
||||
@@ -133,10 +112,7 @@ public class RepositoryRestConfigurationUnitTests {
|
||||
assertThat(configuration.returnBodyOnCreate(MediaType.APPLICATION_JSON_VALUE), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-776
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-776
|
||||
public void considersDomainTypeOfValueRepositoryLookupTypes() {
|
||||
|
||||
configuration.withEntityLookup().forLookupRepository(ProfileRepository.class);
|
||||
@@ -144,10 +120,7 @@ public class RepositoryRestConfigurationUnitTests {
|
||||
assertThat(configuration.isLookupType(Profile.class), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-573
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-573
|
||||
public void configuresCorsProcessing() {
|
||||
|
||||
RepositoryCorsRegistry registry = configuration.getCorsRegistry();
|
||||
|
||||
@@ -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.
|
||||
@@ -70,10 +70,7 @@ public class UriToEntityConverterUnitTests {
|
||||
repositories);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-427
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-427
|
||||
public void supportsOnlyEntitiesWithIdProperty() {
|
||||
|
||||
Set<ConvertiblePair> result = converter.getConvertibleTypes();
|
||||
@@ -82,18 +79,12 @@ public class UriToEntityConverterUnitTests {
|
||||
assertThat(result, not(hasItem(new ConvertiblePair(URI.class, NonEntity.class))));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-427
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-427
|
||||
public void cannotConvertEntityWithIdPropertyIfStringConversionMissing() {
|
||||
assertThat(converter.matches(URI_TYPE, ENTITY_TYPE), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-427
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-427
|
||||
public void canConvertEntityWithIdPropertyAndFromStringConversionPossible() {
|
||||
|
||||
doReturn(mock(RepositoryInformation.class)).when(repositories).getRepositoryInformationFor(ENTITY_TYPE.getType());
|
||||
@@ -101,18 +92,12 @@ public class UriToEntityConverterUnitTests {
|
||||
assertThat(converter.matches(URI_TYPE, ENTITY_TYPE), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-427
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-427
|
||||
public void cannotConvertEntityWithoutIdentifier() {
|
||||
assertThat(converter.matches(URI_TYPE, TypeDescriptor.valueOf(NonEntity.class)), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-427
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-427
|
||||
public void invokesConverterWithLastUriPathSegment() {
|
||||
|
||||
Entity reference = new Entity();
|
||||
@@ -124,42 +109,27 @@ public class UriToEntityConverterUnitTests {
|
||||
assertThat(converter.convert(URI.create("/foo/bar/1"), URI_TYPE, ENTITY_TYPE), is((Object) reference));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-427
|
||||
*/
|
||||
@Test(expected = ConversionFailedException.class)
|
||||
@Test(expected = ConversionFailedException.class) // DATAREST-427
|
||||
public void rejectsUnknownType() {
|
||||
converter.convert(URI.create("/foo/1"), URI_TYPE, STRING_TYPE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-427
|
||||
*/
|
||||
@Test(expected = ConversionFailedException.class)
|
||||
@Test(expected = ConversionFailedException.class) // DATAREST-427
|
||||
public void rejectsUriWithLessThanTwoSegments() {
|
||||
converter.convert(URI.create("1"), URI_TYPE, ENTITY_TYPE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-741
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREST-741
|
||||
public void rejectsNullPersistentEntities() {
|
||||
new UriToEntityConverter(null, invokerFactory, repositories);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-741
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREST-741
|
||||
public void rejectsNullRepositoryInvokerFactory() {
|
||||
new UriToEntityConverter(mock(PersistentEntities.class), null, repositories);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-741
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREST-741
|
||||
public void rejectsNullRepositories() {
|
||||
new UriToEntityConverter(mock(PersistentEntities.class), invokerFactory, null);
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -47,10 +47,7 @@ public class ValidationErrorsUnitTests {
|
||||
this.entities = new PersistentEntities(Arrays.asList(context));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-798
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-798
|
||||
public void exposesNestedViolationsCorrectly() {
|
||||
|
||||
ValidationErrors errors = new ValidationErrors(new Foo(), entities);
|
||||
@@ -62,10 +59,7 @@ public class ValidationErrorsUnitTests {
|
||||
assertThat(errors.getFieldError().getField(), is("bars[0].field"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-801
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-801
|
||||
public void getsTheNestedFieldsValue() {
|
||||
expectedErrorBehavior(new ValidationErrors(new Foo(), entities));
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -31,58 +31,37 @@ import org.springframework.data.rest.core.config.ProjectionDefinitionConfigurati
|
||||
@SuppressWarnings("rawtypes")
|
||||
public class ProjectionDefinitionConfigurationUnitTests {
|
||||
|
||||
/**
|
||||
* @see DATAREST-221
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREST-221
|
||||
public void rejectsNullProjectionTypeForAutoConfiguration() {
|
||||
new ProjectionDefinitionConfiguration().addProjection(null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-221
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREST-221
|
||||
public void rejectsUnannotatedClassForConfigurationShortcut() {
|
||||
new ProjectionDefinitionConfiguration().addProjection(String.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-221
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREST-221
|
||||
public void rejectsNullProjectionTypeForManualConfiguration() {
|
||||
new ProjectionDefinitionConfiguration().addProjection(null, "name", Object.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-221
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREST-221
|
||||
public void rejectsNullNameForManualConfiguration() {
|
||||
new ProjectionDefinitionConfiguration().addProjection(String.class, (String) null, Object.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-221
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREST-221
|
||||
public void rejectsEmptyNameForManualConfiguration() {
|
||||
new ProjectionDefinitionConfiguration().addProjection(String.class, "", Object.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-221
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREST-221
|
||||
public void rejectsEmptySourceTypes() {
|
||||
new ProjectionDefinitionConfiguration().addProjection(String.class, "name", new Class<?>[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-221
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-221
|
||||
public void findsRegisteredProjection() {
|
||||
|
||||
ProjectionDefinitionConfiguration configuration = new ProjectionDefinitionConfiguration();
|
||||
@@ -91,10 +70,7 @@ public class ProjectionDefinitionConfigurationUnitTests {
|
||||
assertThat(configuration.getProjectionType(String.class, "name"), is(equalTo((Class) Integer.class)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-221
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-221
|
||||
public void registersAnnotatedProjection() {
|
||||
|
||||
ProjectionDefinitionConfiguration configuration = new ProjectionDefinitionConfiguration();
|
||||
@@ -103,10 +79,7 @@ public class ProjectionDefinitionConfigurationUnitTests {
|
||||
assertThat(configuration.getProjectionType(Integer.class, "name"), is(equalTo((Class) SampleProjection.class)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-221
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-221
|
||||
public void defaultsNameToSimpleClassNameIfNotAnnotated() {
|
||||
|
||||
ProjectionDefinitionConfiguration configuration = new ProjectionDefinitionConfiguration();
|
||||
@@ -115,10 +88,7 @@ public class ProjectionDefinitionConfigurationUnitTests {
|
||||
assertThat(configuration.getProjectionType(Integer.class, "default"), is(equalTo((Class) Default.class)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-221
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-221
|
||||
public void definitionEquals() {
|
||||
|
||||
ProjectionDefinition objectName = ProjectionDefinition.of(Object.class, Object.class, "name");
|
||||
@@ -139,10 +109,7 @@ public class ProjectionDefinitionConfigurationUnitTests {
|
||||
assertThat(objectName, is(not(new Object())));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-385
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-385
|
||||
public void returnsProjectionForParentClass() {
|
||||
|
||||
ProjectionDefinitionConfiguration configuration = new ProjectionDefinitionConfiguration();
|
||||
@@ -153,18 +120,12 @@ public class ProjectionDefinitionConfigurationUnitTests {
|
||||
assertThat(configuration.getProjectionType(Child.class, "summary"), is(typeCompatibleWith(ParentProjection.class)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-221
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-221
|
||||
public void defaultsParamternameToProjection() {
|
||||
assertThat(new ProjectionDefinitionConfiguration().getParameterName(), is("projection"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-747
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-747
|
||||
public void returnsMostConcreteProjectionForSourceType() {
|
||||
|
||||
ProjectionDefinitionConfiguration configuration = new ProjectionDefinitionConfiguration();
|
||||
|
||||
@@ -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.
|
||||
@@ -82,82 +82,52 @@ public class RepositoryEventIntegrationTests {
|
||||
person = people.save(new Person("Jane", "Doe"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-388
|
||||
*/
|
||||
@Test(expected = EventHandlerInvokedException.class)
|
||||
@Test(expected = EventHandlerInvokedException.class) // DATAREST-388
|
||||
public void shouldDispatchBeforeCreate() throws Exception {
|
||||
appCtx.publishEvent(new BeforeCreateEvent(person));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-388
|
||||
*/
|
||||
@Test(expected = EventHandlerInvokedException.class)
|
||||
@Test(expected = EventHandlerInvokedException.class) // DATAREST-388
|
||||
public void shouldDispatchAfterCreate() throws Exception {
|
||||
appCtx.publishEvent(new AfterCreateEvent(person));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-388
|
||||
*/
|
||||
@Test(expected = EventHandlerInvokedException.class)
|
||||
@Test(expected = EventHandlerInvokedException.class) // DATAREST-388
|
||||
public void shouldDispatchBeforeSave() throws Exception {
|
||||
appCtx.publishEvent(new BeforeSaveEvent(person));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-388
|
||||
*/
|
||||
@Test(expected = EventHandlerInvokedException.class)
|
||||
@Test(expected = EventHandlerInvokedException.class) // DATAREST-388
|
||||
public void shouldDispatchAfterSave() throws Exception {
|
||||
appCtx.publishEvent(new AfterSaveEvent(person));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-388
|
||||
*/
|
||||
@Test(expected = EventHandlerInvokedException.class)
|
||||
@Test(expected = EventHandlerInvokedException.class) // DATAREST-388
|
||||
public void shouldDispatchBeforeDelete() throws Exception {
|
||||
appCtx.publishEvent(new BeforeDeleteEvent(person));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-388
|
||||
*/
|
||||
@Test(expected = EventHandlerInvokedException.class)
|
||||
@Test(expected = EventHandlerInvokedException.class) // DATAREST-388
|
||||
public void shouldDispatchAfterDelete() throws Exception {
|
||||
appCtx.publishEvent(new AfterDeleteEvent(person));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-388
|
||||
*/
|
||||
@Test(expected = EventHandlerInvokedException.class)
|
||||
@Test(expected = EventHandlerInvokedException.class) // DATAREST-388
|
||||
public void shouldDispatchBeforeLinkSave() throws Exception {
|
||||
appCtx.publishEvent(new BeforeLinkSaveEvent(person, new Object()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-388
|
||||
*/
|
||||
@Test(expected = EventHandlerInvokedException.class)
|
||||
@Test(expected = EventHandlerInvokedException.class) // DATAREST-388
|
||||
public void shouldDispatchAfterLinkSave() throws Exception {
|
||||
appCtx.publishEvent(new AfterLinkSaveEvent(person, new Object()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-388
|
||||
*/
|
||||
@Test(expected = EventHandlerInvokedException.class)
|
||||
@Test(expected = EventHandlerInvokedException.class) // DATAREST-388
|
||||
public void shouldDispatchBeforeLinkDelete() throws Exception {
|
||||
appCtx.publishEvent(new BeforeLinkDeleteEvent(person, new Object()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-388
|
||||
*/
|
||||
@Test(expected = EventHandlerInvokedException.class)
|
||||
@Test(expected = EventHandlerInvokedException.class) // DATAREST-388
|
||||
public void shouldDispatchAfterLinkDelete() throws Exception {
|
||||
appCtx.publishEvent(new AfterLinkDeleteEvent(person, new Object()));
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -40,9 +40,10 @@ public interface PersonRepository extends PagingAndSortingRepository<Person, UUI
|
||||
Page<Person> findByCreatedGreaterThan(@Param("date") Date date, Pageable pageable);
|
||||
|
||||
/**
|
||||
* @see DATAREST-107 - this method matches the earlier one, causing an ambiguous mapping except for the exported
|
||||
* This method matches the earlier one, causing an ambiguous mapping except for the exported
|
||||
* setting
|
||||
*/
|
||||
// DATAREST-107
|
||||
@RestResource(rel = "firstname", path = "firstname", exported = false)
|
||||
Person findByFirstName(@Param("firstName") String firstName);
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
@@ -35,10 +35,7 @@ import org.springframework.util.MultiValueMap;
|
||||
*/
|
||||
public class AnnotatedEventHandlerInvokerUnitTests {
|
||||
|
||||
/**
|
||||
* @see DATAREST-582
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-582
|
||||
@SuppressWarnings("unchecked")
|
||||
public void doesNotDiscoverMethodsOnProxyClasses() {
|
||||
|
||||
@@ -55,10 +52,7 @@ public class AnnotatedEventHandlerInvokerUnitTests {
|
||||
assertThat(methods.get(BeforeCreateEvent.class), hasSize(1));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-606
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-606
|
||||
public void invokesPrivateEventHandlerMethods() {
|
||||
|
||||
SampleWithPrivateHandler sampleHandler = new SampleWithPrivateHandler();
|
||||
|
||||
@@ -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.
|
||||
@@ -47,10 +47,7 @@ import org.springframework.http.HttpMethod;
|
||||
@RunWith(MockitoJUnitRunner.class)
|
||||
public class CrudMethodsSupportedHttpMethodsUnitTests {
|
||||
|
||||
/**
|
||||
* @see DATACMNS-589, DATAREST-409
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACMNS-589, DATAREST-409
|
||||
public void doesNotSupportAnyHttpMethodForEmptyRepository() {
|
||||
|
||||
SupportedHttpMethods supportedMethods = getSupportedHttpMethodsFor(RawRepository.class);
|
||||
@@ -62,10 +59,7 @@ public class CrudMethodsSupportedHttpMethodsUnitTests {
|
||||
assertMethodsSupported(supportedMethods, ITEM, false, GET, PUT, POST, PATCH, DELETE, HEAD);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-217, DATAREST-330, DATACMNS-589, DATAREST-409
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-217, DATAREST-330, DATACMNS-589, DATAREST-409
|
||||
public void defaultsSupportedHttpMethodsForItemResource() {
|
||||
|
||||
SupportedHttpMethods supportedHttpMethods = getSupportedHttpMethodsFor(SampleRepository.class);
|
||||
@@ -74,10 +68,7 @@ public class CrudMethodsSupportedHttpMethodsUnitTests {
|
||||
assertMethodsSupported(supportedHttpMethods, ITEM, false, POST);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-217, DATAREST-330, DATACMNS-589, DATAREST-409
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-217, DATAREST-330, DATACMNS-589, DATAREST-409
|
||||
public void defaultsSupportedHttpMethodsForCollectionResource() {
|
||||
|
||||
SupportedHttpMethods supportedHttpMethods = getSupportedHttpMethodsFor(SampleRepository.class);
|
||||
@@ -86,10 +77,7 @@ public class CrudMethodsSupportedHttpMethodsUnitTests {
|
||||
assertMethodsSupported(supportedHttpMethods, COLLECTION, false, PUT, PATCH, DELETE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATACMNS-589, DATAREST-409
|
||||
*/
|
||||
@Test
|
||||
@Test // DATACMNS-589, DATAREST-409
|
||||
public void doesNotSupportDeleteIfDeleteMethodIsNotExported() {
|
||||
|
||||
SupportedHttpMethods supportedHttpMethods = getSupportedHttpMethodsFor(HidesDelete.class);
|
||||
@@ -97,10 +85,7 @@ public class CrudMethodsSupportedHttpMethodsUnitTests {
|
||||
assertMethodsSupported(supportedHttpMethods, ITEM, false, DELETE);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-523
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-523
|
||||
public void exposesMethodsForProperties() {
|
||||
|
||||
KeyValueMappingContext context = new KeyValueMappingContext();
|
||||
@@ -121,18 +106,12 @@ public class CrudMethodsSupportedHttpMethodsUnitTests {
|
||||
allOf(hasItem(GET), not(hasItems(DELETE, PATCH, PUT, POST))));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-825
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-825
|
||||
public void supportsDeleteIfFindOneIsHidden() {
|
||||
assertMethodsSupported(getSupportedHttpMethodsFor(HidesFindOne.class), ITEM, true, DELETE, PATCH, PUT, OPTIONS);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-825
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-825
|
||||
public void doesNotSupportDeleteIfNoFindOneAvailable() {
|
||||
assertMethodsSupported(getSupportedHttpMethodsFor(NoFindOne.class), ITEM, false, DELETE);
|
||||
}
|
||||
|
||||
@@ -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 MappingResourceMetadataUnitTests {
|
||||
new PersistentEntities(Arrays.asList(context)));
|
||||
MappingResourceMetadata metadata = new MappingResourceMetadata(entity, resourceMappings);
|
||||
|
||||
/**
|
||||
* @see DATAREST-514
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-514
|
||||
public void allowsLookupOfPropertyByMappedName() {
|
||||
|
||||
KeyValuePersistentProperty property = entity.getPersistentProperty("related");
|
||||
@@ -60,19 +57,13 @@ public class MappingResourceMetadataUnitTests {
|
||||
assertThat(metadata.getMappingFor(property).getPath().matches("foo"), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-518
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-518
|
||||
public void isNotExportedByDefault() {
|
||||
|
||||
assertThat(metadata.isExported(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-518
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-518
|
||||
public void isExportedIfExplicitlyAnnotated() {
|
||||
|
||||
MappingResourceMetadata metadata = new MappingResourceMetadata(context.getPersistentEntity(Related.class),
|
||||
|
||||
@@ -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.
|
||||
@@ -43,10 +43,7 @@ public class PersistentPropertyResourceMappingUnitTests {
|
||||
|
||||
KeyValueMappingContext mappingContext = new KeyValueMappingContext();
|
||||
|
||||
/**
|
||||
* @see DATAREST-175
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-175
|
||||
public void usesPropertyNameAsDefaultResourceMappingRelAndPath() {
|
||||
|
||||
ResourceMapping mapping = getPropertyMappingFor(Entity.class, "first");
|
||||
@@ -57,10 +54,7 @@ public class PersistentPropertyResourceMappingUnitTests {
|
||||
assertThat(mapping.isExported(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-175
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-175
|
||||
public void considersMappingAnnotationOnDomainClassProperty() {
|
||||
|
||||
ResourceMapping mapping = getPropertyMappingFor(Entity.class, "second");
|
||||
@@ -71,10 +65,7 @@ public class PersistentPropertyResourceMappingUnitTests {
|
||||
assertThat(mapping.isExported(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-175
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-175
|
||||
public void considersMappingAnnotationOnDomainClassPropertyMethod() {
|
||||
|
||||
ResourceMapping mapping = getPropertyMappingFor(Entity.class, "third");
|
||||
@@ -85,10 +76,7 @@ public class PersistentPropertyResourceMappingUnitTests {
|
||||
assertThat(mapping.isExported(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-233
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-233
|
||||
public void returnsDefaultDescriptionKey() {
|
||||
|
||||
ResourceMapping mapping = getPropertyMappingFor(Entity.class, "second");
|
||||
@@ -99,10 +87,7 @@ public class PersistentPropertyResourceMappingUnitTests {
|
||||
assertThat(description.getMessage(), is("rest.description.entity.second"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-233
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-233
|
||||
public void considersAtDescription() {
|
||||
|
||||
ResourceMapping mapping = getPropertyMappingFor(Entity.class, "fourth");
|
||||
|
||||
@@ -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.
|
||||
@@ -76,10 +76,7 @@ public class RepositoryCollectionResourceMappingUnitTests {
|
||||
assertThat(mapping.isExported(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-229
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-229
|
||||
public void detectsPagingRepository() {
|
||||
assertThat(getResourceMappingFor(PersonRepository.class).isPagingResource(), is(true));
|
||||
}
|
||||
@@ -92,10 +89,7 @@ public class RepositoryCollectionResourceMappingUnitTests {
|
||||
assertThat(mapping.getItemResourceRel(), is("bar"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-445
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-445
|
||||
public void usesDomainTypeFromRepositoryMetadata() {
|
||||
|
||||
RepositoryMetadata metadata = new DefaultRepositoryMetadata(PersonRepository.class) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015 the original author or authors.
|
||||
* Copyright 2015-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.
|
||||
@@ -38,10 +38,7 @@ import org.springframework.data.rest.core.mapping.RepositoryDetectionStrategy.Re
|
||||
@SuppressWarnings("serial")
|
||||
public class RepositoryDetectionStrategiesUnitTests {
|
||||
|
||||
/**
|
||||
* @see DATAREST-473
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-473
|
||||
public void allExposesAllRepositories() {
|
||||
|
||||
assertExposures(ALL, new HashMap<Class<?>, Boolean>() {
|
||||
@@ -54,10 +51,7 @@ public class RepositoryDetectionStrategiesUnitTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-473
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-473
|
||||
public void defaultHonorsVisibilityAndAnnotations() {
|
||||
|
||||
assertExposures(DEFAULT, new HashMap<Class<?>, Boolean>() {
|
||||
@@ -70,10 +64,7 @@ public class RepositoryDetectionStrategiesUnitTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-473
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-473
|
||||
public void visibilityHonorsTypeVisibilityOnly() {
|
||||
|
||||
assertExposures(VISIBILITY, new HashMap<Class<?>, Boolean>() {
|
||||
@@ -86,11 +77,7 @@ public class RepositoryDetectionStrategiesUnitTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-473
|
||||
*/
|
||||
|
||||
@Test
|
||||
@Test // DATAREST-473
|
||||
public void annotatedHonorsAnnotationsOnly() {
|
||||
|
||||
assertExposures(ANNOTATED, new HashMap<Class<?>, Boolean>() {
|
||||
|
||||
@@ -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.
|
||||
@@ -61,10 +61,7 @@ public class RepositoryMethodResourceMappingUnitTests {
|
||||
assertThat(mapping.getPath(), is(new Path("bar")));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-31
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-31
|
||||
public void doesNotDiscoverAnyParametersIfNotAnnotated() throws Exception {
|
||||
|
||||
Method method = PersonRepository.class.getMethod("findByLastname", String.class);
|
||||
@@ -73,10 +70,7 @@ public class RepositoryMethodResourceMappingUnitTests {
|
||||
assertThat(mapping.getParametersMetadata().getParameterNames(), is(emptyIterable()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-31
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-31
|
||||
public void resolvesParameterNamesIfNotAnnotated() throws Exception {
|
||||
|
||||
Method method = PersonRepository.class.getMethod("findByFirstname", String.class);
|
||||
@@ -86,10 +80,7 @@ public class RepositoryMethodResourceMappingUnitTests {
|
||||
assertThat(mapping.getParametersMetadata().getParameterNames(), hasItem("firstname"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-229
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-229
|
||||
public void considersPagingFinderAPagingResource() throws Exception {
|
||||
|
||||
Method method = PersonRepository.class.getMethod("findByEmailAddress", String.class, Pageable.class);
|
||||
@@ -107,10 +98,7 @@ public class RepositoryMethodResourceMappingUnitTests {
|
||||
assertThat(mapping.getRel(), is("findByEmailAddress"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-384
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-384
|
||||
public void considersResourceSortableIfSortParameterIsPresent() throws Exception {
|
||||
|
||||
Method method = PersonRepository.class.getMethod("findByEmailAddress", String.class, Sort.class);
|
||||
@@ -124,10 +112,7 @@ public class RepositoryMethodResourceMappingUnitTests {
|
||||
assertThat(mapping.isSortableResource(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-467
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-467
|
||||
@SuppressWarnings("rawtypes")
|
||||
public void returnsDomainTypeAsProjectionSourceType() throws Exception {
|
||||
|
||||
@@ -137,10 +122,7 @@ public class RepositoryMethodResourceMappingUnitTests {
|
||||
assertThat(mapping.getReturnedDomainType(), is(equalTo((Class) Person.class)));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-699
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-699
|
||||
public void doesNotIncludePageableAsParameter() throws Exception {
|
||||
|
||||
Method method = PersonRepository.class.getMethod("findByLastname", String.class, Pageable.class);
|
||||
|
||||
@@ -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.
|
||||
@@ -89,10 +89,7 @@ public class RepositoryResourceMappingsIntegrationTests {
|
||||
assertThat(creditCardMapping.getSearchResourceMappings().isExported(), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-112
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-112
|
||||
public void usesPropertyNameAsRelForPropertyResourceMapping() {
|
||||
|
||||
Repositories repositories = new Repositories(factory);
|
||||
@@ -107,10 +104,7 @@ public class RepositoryResourceMappingsIntegrationTests {
|
||||
assertThat(mapping.isExported(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-111
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-111
|
||||
public void exposesResourceByPath() {
|
||||
|
||||
assertThat(mappings.exportsTopLevelResourceFor("people"), is(true));
|
||||
@@ -123,10 +117,7 @@ public class RepositoryResourceMappingsIntegrationTests {
|
||||
assertThat(mappings.exportsTopLevelResourceFor("creditCards"), is(false));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-107
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-107
|
||||
public void skipsSearchMethodsNotExported() {
|
||||
|
||||
ResourceMetadata creditCardMetadata = mappings.getMetadataFor(CreditCard.class);
|
||||
@@ -145,10 +136,7 @@ public class RepositoryResourceMappingsIntegrationTests {
|
||||
assertThat(methodNames, hasItems("findByFirstName", "findByCreatedGreaterThan"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-325
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-325
|
||||
public void exposesMethodResourceMappingInPackageProtectedButExportedRepo() {
|
||||
|
||||
ResourceMetadata metadata = mappings.getMetadataFor(Author.class);
|
||||
|
||||
@@ -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.
|
||||
@@ -51,10 +51,7 @@ public class TypeBasedCollectionResourceMappingUnitTests {
|
||||
assertThat(mapping.isExported(), is(true));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-99
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-99
|
||||
public void doesNotExportNonPublicTypesByDefault() {
|
||||
|
||||
CollectionResourceMapping mapping = new TypeBasedCollectionResourceMapping(HiddenSample.class);
|
||||
|
||||
@@ -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.
|
||||
@@ -81,34 +81,22 @@ public class DefaultSelfLinkProviderUnitTests {
|
||||
this.provider = new DefaultSelfLinkProvider(entities, entityLinks, lookups);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-724
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREST-724
|
||||
public void rejectsNullEntities() {
|
||||
new DefaultSelfLinkProvider(null, entityLinks, lookups);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-724
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREST-724
|
||||
public void rejectsNullEntityLinks() {
|
||||
new DefaultSelfLinkProvider(entities, null, lookups);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-724
|
||||
*/
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
@Test(expected = IllegalArgumentException.class) // DATAREST-724
|
||||
public void rejectsNullEntityLookups() {
|
||||
new DefaultSelfLinkProvider(entities, entityLinks, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-724
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-724
|
||||
public void usesEntityIdIfNoLookupDefined() {
|
||||
|
||||
Profile profile = new Profile("Name", "Type");
|
||||
@@ -117,10 +105,7 @@ public class DefaultSelfLinkProviderUnitTests {
|
||||
assertThat(link.getHref(), Matchers.endsWith(profile.getId().toString()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-724
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-724
|
||||
@SuppressWarnings("unchecked")
|
||||
public void usesEntityLookupIfDefined() {
|
||||
|
||||
@@ -135,10 +120,7 @@ public class DefaultSelfLinkProviderUnitTests {
|
||||
assertThat(link.getHref(), Matchers.endsWith("foo"));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-724
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-724
|
||||
public void rejectsLinkCreationForUnknownEntity() {
|
||||
|
||||
exception.expect(IllegalArgumentException.class);
|
||||
|
||||
@@ -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.
|
||||
@@ -52,10 +52,7 @@ public class DomainObjectMergerTests {
|
||||
this.merger = new DomainObjectMerger(new Repositories(context.getBeanFactory()), new DefaultConversionService());
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-130
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-130
|
||||
public void mergeNewValue() {
|
||||
|
||||
Person incoming = new Person("Bilbo", "Baggins");
|
||||
@@ -67,10 +64,7 @@ public class DomainObjectMergerTests {
|
||||
assertThat(existingDomainObject.getLastName(), is(incoming.getLastName()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-130
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-130
|
||||
public void mergeNullValue() {
|
||||
|
||||
Person incoming = new Person(null, null);
|
||||
@@ -82,10 +76,7 @@ public class DomainObjectMergerTests {
|
||||
assertThat(existingDomainObject.getLastName(), is(incoming.getLastName()));
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-327
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-327
|
||||
public void doesNotMergeEmptyCollectionsForReferences() {
|
||||
|
||||
Person bilbo = new Person("Bilbo", "Baggins");
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2014 the original author or authors.
|
||||
* Copyright 2014-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.
|
||||
@@ -31,10 +31,7 @@ import org.junit.Test;
|
||||
*/
|
||||
public class DomainObjectMergerUnitTests {
|
||||
|
||||
/**
|
||||
* @see DATAREST-327
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-327
|
||||
public void considersEmptyObjectsEmpty() {
|
||||
|
||||
assertThat(isNullOrEmpty(null), is(true));
|
||||
|
||||
@@ -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.
|
||||
@@ -76,26 +76,17 @@ public class UnwrappingRepositoryInvokerFactoryUnitTests {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-511
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-511
|
||||
public void unwrapsValuesForFindOne() {
|
||||
assertFindOneValueForSource(source, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-511
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-511
|
||||
public void unwrapsValuesForQuery() {
|
||||
assertQueryValueForSource(source, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @see DATAREST-724
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-724
|
||||
@SuppressWarnings("unchecked")
|
||||
public void usesRegisteredEntityLookup() {
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2015 the original author or authors.
|
||||
* Copyright 2015-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.
|
||||
@@ -34,10 +34,7 @@ import org.springframework.util.ReflectionUtils.MethodCallback;
|
||||
*/
|
||||
public class MethodsUnitTests {
|
||||
|
||||
/**
|
||||
* @see DATAREST-582
|
||||
*/
|
||||
@Test
|
||||
@Test // DATAREST-582
|
||||
public void userMethodsFilterSkipsMethodsIntroducedByProxying() throws Exception {
|
||||
|
||||
ProxyFactory factory = new ProxyFactory();
|
||||
|
||||
Reference in New Issue
Block a user