Skip to content

Commit f1b5c8d

Browse files
authored
Merge pull request #2 from ExpediaInc/upgrade-versions
Update Spring Cloud version to Brixton RC2 because the old version do…
2 parents bcc02f3 + 978fa10 commit f1b5c8d

File tree

2 files changed

+20
-19
lines changed

2 files changed

+20
-19
lines changed

grpc-spring-boot-starter-demo/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ clean.dependsOn cleanProtoGen
5555

5656
dependencyManagement {
5757
imports {
58-
mavenBom 'org.springframework.cloud:spring-cloud-starter-parent:Brixton.M4'
58+
mavenBom 'org.springframework.cloud:spring-cloud-starter-parent:Brixton.SR3'
5959
}
6060
}
6161

grpc-spring-boot-starter-demo/src/test/java/org/lognet/springboot/grpc/GreeterAppTest.java

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,25 @@
11
package org.lognet.springboot.grpc;
22

3-
import com.google.common.util.concurrent.ListenableFuture;
4-
import io.grpc.ManagedChannel;
5-
import io.grpc.ManagedChannelBuilder;
6-
import io.grpc.examples.GreeterGrpc;
7-
import io.grpc.examples.GreeterOuterClass;
8-
import io.netty.handler.codec.http.HttpMethod;
3+
import static org.junit.Assert.assertEquals;
4+
95
import org.junit.After;
106
import org.junit.Before;
117
import org.junit.Test;
128
import org.junit.runner.RunWith;
139
import org.lognet.springboot.grpc.demo.GreeterApp;
14-
import org.springframework.boot.test.IntegrationTest;
1510
import org.springframework.boot.test.SpringApplicationConfiguration;
1611
import org.springframework.boot.test.TestRestTemplate;
1712
import org.springframework.boot.test.WebIntegrationTest;
18-
import org.springframework.http.HttpEntity;
1913
import org.springframework.http.HttpStatus;
2014
import org.springframework.http.ResponseEntity;
21-
import org.springframework.test.annotation.DirtiesContext;
2215
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
2316

2417
import java.util.concurrent.ExecutionException;
2518

26-
import static org.junit.Assert.assertEquals;
19+
import io.grpc.ManagedChannel;
20+
import io.grpc.ManagedChannelBuilder;
21+
import io.grpc.examples.GreeterGrpc;
22+
import io.grpc.examples.GreeterOuterClass;
2723

2824
/**
2925
* Created by alexf on 28-Jan-16.
@@ -33,33 +29,38 @@
3329
@WebIntegrationTest
3430

3531
public class GreeterAppTest {
32+
3633
private ManagedChannel channel;
34+
3735
@Before
38-
public void setup(){
36+
public void setup() {
3937
channel = ManagedChannelBuilder.forAddress("localhost", 6565)
40-
.usePlaintext(true)
41-
.build();
38+
.usePlaintext(true)
39+
.build();
4240

4341
}
42+
4443
@After
45-
public void tearDown(){
44+
public void tearDown() {
4645
channel.shutdown();
4746
}
4847

4948
@Test
50-
public void simpleGreeting () throws ExecutionException, InterruptedException {
49+
public void simpleGreeting() throws ExecutionException, InterruptedException {
5150

5251
final GreeterGrpc.GreeterFutureStub greeterFutureStub = GreeterGrpc.newFutureStub(channel);
53-
final GreeterOuterClass.HelloRequest helloRequest = GreeterOuterClass.HelloRequest.newBuilder().setName("John").build();
52+
final GreeterOuterClass.HelloRequest
53+
helloRequest =
54+
GreeterOuterClass.HelloRequest.newBuilder().setName("John").build();
5455
final String replay = greeterFutureStub.sayHello(helloRequest).get().getMessage();
5556
System.out.println(replay);
5657
}
5758

5859
@Test
59-
public void actuatorTest () throws ExecutionException, InterruptedException {
60+
public void actuatorTest() throws ExecutionException, InterruptedException {
6061
final TestRestTemplate template = new TestRestTemplate();
6162

62-
ResponseEntity<String> response = template.getForEntity("http://localhost:8080/env",String.class);
63+
ResponseEntity<String> response = template.getForEntity("http://localhost:8080/env", String.class);
6364
assertEquals(HttpStatus.OK, response.getStatusCode());
6465
}
6566

0 commit comments

Comments
 (0)