[BAEL-9497] Fix failing context tests - part 1 (#7719)

* fixed context dependency issue and added LiveContext notes in persistence-modules/spring-data-couchbase-2 module

* fixed Context tests and added notes for spring-cloud-bus/spring-cloud-config-client module

* Added context test in spring-cloud-data-flow/spring-cloud-data-flow-stream-processing/data-flow-server module, mainly due to incompatible dependencies, plus fixed parent pom path in different modules

* fixed context tests for spring-cloud/spring-cloud-task/springcloudtaskbatch module, renamed ContextLiveTest as IntegrationTest, now configured to run with an H2 embedded instance. Moved the run note to the application

* Added SpringContextLiveTests in persistence-modules/spring-data-mongodb module
This commit is contained in:
Ger Roza
2019-09-06 06:19:30 -03:00
committed by Josh Cummings
parent c709251eeb
commit e9e4f63313
19 changed files with 199 additions and 58 deletions

View File

@@ -1,4 +1,5 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.baeldung</groupId>
@@ -59,13 +60,24 @@
<version>${spring-framework.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>javax.el</groupId>
<artifactId>javax.el-api</artifactId>
<version>${javax.el.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
<version>${javax.el.version}</version>
</dependency>
</dependencies>
<properties>
<spring-framework.version>4.3.4.RELEASE</spring-framework.version>
<spring-framework.version>4.3.4.RELEASE</spring-framework.version>
<spring-data-couchbase.version>2.1.5.RELEASE</spring-data-couchbase.version>
<hibernate-validator.version>5.3.3.Final</hibernate-validator.version>
<joda-time.version>2.9.6</joda-time.version>
<javax.el.version>3.0.0</javax.el.version>
</properties>
</project>

View File

@@ -9,6 +9,45 @@ import org.springframework.test.context.TestExecutionListeners;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.support.DependencyInjectionTestExecutionListener;
/**
* This LiveTest requires:
*
* 1- Couchbase instance running (e.g. with `docker run -d --name db -p 8091-8096:8091-8096 -p 11210-11211:11210-11211 couchbase`)
*
*
* 2- Couchbase configured with (we can use the console in localhost:8091):
*
* 2.1- Buckets: named 'baeldung' and 'baeldung2'
*
* 2.2- Security: users 'baeldung' and 'baeldung2'. Note: in newer versions an empty password is not allowed, then we have to change the passwords in the project)
*
* 2.3- Spacial View: Add new spacial view (in Index tab) in document 'campus_spatial', view 'byLocation' with the following function:
* {@code
* function (doc) {
* if (doc.location &&
* doc._class == "org.baeldung.spring.data.couchbase.model.Campus") {
* emit([doc.location.x, doc.location.y], null);
* }
* }}
*
* 2.4- MapReduce Views: Add new views in document 'campus':
* 2.4.1- view 'all' with function:
* {@code
* function (doc, meta) {
* if(doc._class == "org.baeldung.spring.data.couchbase.model.Campus") {
* emit(meta.id, null);
* }
* }}
*
* 2.4.2- view 'byName' with function:
* {@code
* function (doc, meta) {
* if(doc._class == "org.baeldung.spring.data.couchbase.model.Campus" &&
* doc.name) {
* emit(doc.name, null);
* }
* }}
*/
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(classes = { MultiBucketCouchbaseConfig.class, MultiBucketIntegrationTestConfig.class })
@TestExecutionListeners(listeners = { DependencyInjectionTestExecutionListener.class })