SGF-92 - Improved error message in case no region can be found.
If the region referenced by an entity managed by a repository cannot be found in the application context we now throw an exception with an error message indicating the missing configuration.
This commit is contained in:
@@ -15,10 +15,13 @@
|
||||
*/
|
||||
package org.springframework.data.gemfire.repository.support;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.data.gemfire.mapping.Regions;
|
||||
import org.springframework.data.gemfire.repository.sample.PersonRepository;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
|
||||
import com.gemstone.bp.edu.emory.mathcs.backport.java.util.Collections;
|
||||
|
||||
/**
|
||||
* Integration test for {@link GemfireRepositoryFactory}.
|
||||
*
|
||||
@@ -33,4 +36,12 @@ public class GemfireRepositoryFactoryIntegrationTests extends AbstractGemfireRep
|
||||
GemfireRepositoryFactory factory = new GemfireRepositoryFactory(regions, null);
|
||||
return factory.getRepository(PersonRepository.class);
|
||||
}
|
||||
|
||||
@Test(expected = IllegalStateException.class)
|
||||
@SuppressWarnings("unchecked")
|
||||
public void throwsExceptionIfReferencedRegionIsNotConfigured() {
|
||||
|
||||
GemfireRepositoryFactory factory = new GemfireRepositoryFactory(Collections.emptySet(), null);
|
||||
factory.getRepository(PersonRepository.class);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user