Skip to content

Commit bb0a427

Browse files
committed
DATAMONGO-1389 - Fixed test case to verify type predicting bean registration.
Related ticket: DATACMNS-821.
1 parent a2ae08e commit bb0a427

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

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

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012 the original author or authors.
2+
* Copyright 2012-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -15,8 +15,11 @@
1515
*/
1616
package org.springframework.data.mongodb.repository.config;
1717

18+
import static org.hamcrest.CoreMatchers.*;
1819
import static org.junit.Assert.*;
1920

21+
import java.util.Arrays;
22+
2023
import org.junit.Test;
2124
import org.junit.runner.RunWith;
2225
import org.springframework.beans.factory.annotation.Autowired;
@@ -55,22 +58,16 @@ public MongoOperations mongoTemplate() throws Exception {
5558
@Autowired ApplicationContext context;
5659

5760
@Test
58-
public void testConfiguration() {
59-
60-
}
61+
public void testConfiguration() {}
6162

6263
/**
6364
* @see DATAMONGO-901
6465
*/
6566
@Test
6667
public void registersTypePredictingPostProcessor() {
6768

68-
for (String name : context.getBeanDefinitionNames()) {
69-
if (name.startsWith("org.springframework.data.repository.core.support.RepositoryInterfaceAwareBeanPostProcessor")) {
70-
return;
71-
}
72-
}
69+
Iterable<String> beanNames = Arrays.asList(context.getBeanDefinitionNames());
7370

74-
fail("Expected to find a bean with name starting with RepositoryInterfaceAwareBeanPostProcessor");
71+
assertThat(beanNames, hasItem(containsString("RepositoryFactoryBeanSupport_Predictor")));
7572
}
7673
}

0 commit comments

Comments
 (0)