DATAJPA-442 - Enable CDI repositories to be instantiated eagerly.
From the CDI extension we now use the callback newly introduced in Spring Data Commons to enable it to trigger eager initialization. See also: DATACMNS-416.
This commit is contained in:
@@ -27,6 +27,8 @@ import org.apache.webbeans.cditest.CdiTestContainer;
|
||||
import org.apache.webbeans.cditest.CdiTestContainerLoader;
|
||||
import org.junit.BeforeClass;
|
||||
import org.junit.Test;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Integration tests for Spring Data JPA CDI extension.
|
||||
@@ -36,12 +38,17 @@ import org.junit.Test;
|
||||
*/
|
||||
public class CdiExtensionIntegrationTests {
|
||||
|
||||
private static Logger LOGGER = LoggerFactory.getLogger(CdiExtensionIntegrationTests.class);
|
||||
|
||||
static CdiTestContainer container;
|
||||
|
||||
@BeforeClass
|
||||
public static void setUp() throws Exception {
|
||||
|
||||
container = CdiTestContainerLoader.getCdiContainer();
|
||||
container.bootContainer();
|
||||
|
||||
LOGGER.debug("CDI container bootstrapped!");
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -17,6 +17,9 @@ package org.springframework.data.jpa.repository.cdi;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.springframework.data.repository.cdi.Eager;
|
||||
|
||||
@Eager
|
||||
public interface PersonRepository {
|
||||
|
||||
List<Person> findAll();
|
||||
|
||||
Reference in New Issue
Block a user