Browse Source

DATAMONGO-1389 - Fixed test case to verify type predicting bean registration.

Related ticket: DATACMNS-821.
pull/344/merge
Oliver Gierke 10 years ago
parent
commit
bb0a42733d
  1. 17
      spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/config/MongoRepositoriesRegistrarIntegrationTests.java

17
spring-data-mongodb/src/test/java/org/springframework/data/mongodb/repository/config/MongoRepositoriesRegistrarIntegrationTests.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2012 the original author or authors. * Copyright 2012-2016 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -15,8 +15,11 @@
*/ */
package org.springframework.data.mongodb.repository.config; package org.springframework.data.mongodb.repository.config;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.*; import static org.junit.Assert.*;
import java.util.Arrays;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -55,9 +58,7 @@ public class MongoRepositoriesRegistrarIntegrationTests {
@Autowired ApplicationContext context; @Autowired ApplicationContext context;
@Test @Test
public void testConfiguration() { public void testConfiguration() {}
}
/** /**
* @see DATAMONGO-901 * @see DATAMONGO-901
@ -65,12 +66,8 @@ public class MongoRepositoriesRegistrarIntegrationTests {
@Test @Test
public void registersTypePredictingPostProcessor() { public void registersTypePredictingPostProcessor() {
for (String name : context.getBeanDefinitionNames()) { Iterable<String> beanNames = Arrays.asList(context.getBeanDefinitionNames());
if (name.startsWith("org.springframework.data.repository.core.support.RepositoryInterfaceAwareBeanPostProcessor")) {
return;
}
}
fail("Expected to find a bean with name starting with RepositoryInterfaceAwareBeanPostProcessor"); assertThat(beanNames, hasItem(containsString("RepositoryFactoryBeanSupport_Predictor")));
} }
} }

Loading…
Cancel
Save