From 13346c0115749dbf1e2a397f4f3fbe328232c602 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Tue, 20 May 2014 16:48:10 +0200 Subject: [PATCH] DATACMNS-494 - Fix test setup in JpaRepositoriesRegistrarUnitTests. We now explicitly set an Environment in JpaRepositoriesRegistrarUnitTests to make sure the registrar can work correctly. --- .../repository/config/JpaRepositoriesRegistrarUnitTests.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/springframework/data/jpa/repository/config/JpaRepositoriesRegistrarUnitTests.java b/src/test/java/org/springframework/data/jpa/repository/config/JpaRepositoriesRegistrarUnitTests.java index 969f38705..9aa34a6ee 100644 --- a/src/test/java/org/springframework/data/jpa/repository/config/JpaRepositoriesRegistrarUnitTests.java +++ b/src/test/java/org/springframework/data/jpa/repository/config/JpaRepositoriesRegistrarUnitTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2012 the original author or authors. + * Copyright 2012-2014 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,6 +24,7 @@ import org.junit.Before; import org.junit.Test; import org.springframework.beans.factory.support.BeanDefinitionRegistry; import org.springframework.beans.factory.support.DefaultListableBeanFactory; +import org.springframework.core.env.StandardEnvironment; import org.springframework.core.io.DefaultResourceLoader; import org.springframework.core.type.AnnotationMetadata; import org.springframework.core.type.StandardAnnotationMetadata; @@ -51,6 +52,7 @@ public class JpaRepositoriesRegistrarUnitTests { JpaRepositoriesRegistrar registrar = new JpaRepositoriesRegistrar(); registrar.setResourceLoader(new DefaultResourceLoader()); + registrar.setEnvironment(new StandardEnvironment()); registrar.registerBeanDefinitions(metadata, registry); Iterable names = Arrays.asList(registry.getBeanDefinitionNames());