Skip to content

Commit 65a8ebc

Browse files
author
Daniel Bustamante Ospina
committed
Test travis config
1 parent a30cb76 commit 65a8ebc

File tree

6 files changed

+77
-5
lines changed

6 files changed

+77
-5
lines changed

.travis.yml

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
language: java
22

3+
git:
4+
quiet: true
5+
6+
services:
7+
- rabbitmq
8+
39
jdk:
410
- oraclejdk8
11+
- oraclejdk11
512

6-
os:
7-
- linux
8-
9-
script: ./gradlew build
13+
before_cache:
14+
- rm -f $HOME/.gradle/caches/modules-2/modules-2.lock
15+
- rm -fr $HOME/.gradle/caches/*/plugin-resolution/
16+
cache:
17+
directories:
18+
- $HOME/.gradle/caches/
19+
- $HOME/.gradle/wrapper/
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dependencies {
2+
compile project(":async-commons-starter")
3+
compile('org.springframework.boot:spring-boot-starter')
4+
}
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
package org.reactivecommons.test;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.reactivecommons.async.api.AsyncQuery;
6+
import org.reactivecommons.async.api.DirectAsyncGateway;
7+
import org.reactivecommons.async.api.HandlerRegistry;
8+
import org.reactivecommons.async.impl.config.annotations.EnableDirectAsyncGateway;
9+
import org.reactivecommons.async.impl.config.annotations.EnableMessageListeners;
10+
import org.springframework.beans.factory.annotation.Autowired;
11+
import org.springframework.beans.factory.annotation.Value;
12+
import org.springframework.boot.SpringApplication;
13+
import org.springframework.boot.autoconfigure.SpringBootApplication;
14+
import org.springframework.boot.test.context.SpringBootTest;
15+
import org.springframework.context.annotation.Bean;
16+
import org.springframework.test.context.junit4.SpringRunner;
17+
import reactor.core.publisher.Mono;
18+
import reactor.test.StepVerifier;
19+
20+
import java.time.Duration;
21+
22+
import static reactor.core.publisher.Mono.*;
23+
24+
@SpringBootTest
25+
@RunWith(SpringRunner.class)
26+
public class DirectAsyncGatewayTest {
27+
28+
@Autowired
29+
private DirectAsyncGateway gateway;
30+
31+
@Value("${spring.application.name}")
32+
private String appName;
33+
34+
@Test
35+
public void shouldReceiveResponse() {
36+
final Mono<Integer> reply = gateway.requestReply(new AsyncQuery<>("double", 42), appName, Integer.class);
37+
StepVerifier.create(reply.timeout(Duration.ofSeconds(15)))
38+
.expectNext(42*2)
39+
.verifyComplete();
40+
}
41+
42+
43+
@SpringBootApplication
44+
@EnableDirectAsyncGateway
45+
@EnableMessageListeners
46+
static class App{
47+
public static void main(String[] args) {
48+
SpringApplication.run(App.class, args);
49+
}
50+
51+
@Bean
52+
public HandlerRegistry registry() {
53+
return HandlerRegistry.register().serveQuery("double", rqt -> just(rqt*2), Long.class);
54+
}
55+
}
56+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
spring.application.name=testApp

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
version=0.0.3-beta1
1+
version=0.0.5-beta1
22
springBootVersion=2.1.1.RELEASE

main.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ subprojects {
2929

3030
dependencies {
3131
testImplementation 'org.springframework.boot:spring-boot-starter-test'
32+
testImplementation 'io.projectreactor:reactor-test'
3233
compileOnly 'org.projectlombok:lombok'
3334
annotationProcessor 'org.projectlombok:lombok'
3435
testAnnotationProcessor 'org.projectlombok:lombok'

0 commit comments

Comments
 (0)