Skip to content

Commit aae309d

Browse files
dyc87112zhaiyongchao
authored andcommitted
Spring Boot整合Dubbo
1 parent b595d29 commit aae309d

File tree

3 files changed

+7
-36
lines changed

3 files changed

+7
-36
lines changed

Chapter9-2-1/consumer/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,6 @@
2929
<artifactId>spring-boot-starter</artifactId>
3030
</dependency>
3131

32-
<dependency>
33-
<groupId>org.springframework.boot</groupId>
34-
<artifactId>spring-boot-starter-web</artifactId>
35-
</dependency>
36-
3732
<dependency>
3833
<groupId>org.springframework.boot</groupId>
3934
<artifactId>spring-boot-starter-test</artifactId>

Chapter9-2-1/consumer/src/main/java/com/didispace/web/ComputeController.java

Lines changed: 0 additions & 24 deletions
This file was deleted.
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,24 @@
11
package com.didispace;
22

3-
import org.junit.Before;
3+
import com.didispace.service.ComputeService;
4+
import org.junit.Assert;
45
import org.junit.Test;
56
import org.junit.runner.RunWith;
7+
import org.springframework.beans.factory.annotation.Autowired;
68
import org.springframework.boot.test.SpringApplicationConfiguration;
79
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
8-
import org.springframework.test.context.web.WebAppConfiguration;
910

1011

1112
@RunWith(SpringJUnit4ClassRunner.class)
1213
@SpringApplicationConfiguration(classes = Application.class)
13-
@WebAppConfiguration
1414
public class ApplicationTests {
1515

16-
@Before
17-
public void setUp() throws Exception {
18-
}
16+
@Autowired
17+
ComputeService computeService;
1918

2019
@Test
21-
public void getHello() throws Exception {
20+
public void testAdd() throws Exception {
21+
Assert.assertEquals("compute-service:add", new Integer(3), computeService.add(1, 2));
2222
}
2323

2424
}

0 commit comments

Comments
 (0)