添加Test Provider
This commit is contained in:
		
							
								
								
									
										31
									
								
								backend/microservice-provider-test-8011/pom.xml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								backend/microservice-provider-test-8011/pom.xml
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,31 @@
 | 
			
		||||
<?xml version="1.0" encoding="UTF-8"?>
 | 
			
		||||
 | 
			
		||||
<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">
 | 
			
		||||
    <parent>
 | 
			
		||||
        <artifactId>epp</artifactId>
 | 
			
		||||
        <groupId>com.cxyxiaomo</groupId>
 | 
			
		||||
        <version>0.0.1-SNAPSHOT</version>
 | 
			
		||||
    </parent>
 | 
			
		||||
    <modelVersion>4.0.0</modelVersion>
 | 
			
		||||
 | 
			
		||||
    <artifactId>microservice-provider-test</artifactId>
 | 
			
		||||
 | 
			
		||||
    <properties>
 | 
			
		||||
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
 | 
			
		||||
        <maven.compiler.source>11</maven.compiler.source>
 | 
			
		||||
        <maven.compiler.target>11</maven.compiler.target>
 | 
			
		||||
    </properties>
 | 
			
		||||
 | 
			
		||||
    <dependencies>
 | 
			
		||||
        <!-- Spring Boot -->
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>org.springframework.boot</groupId>
 | 
			
		||||
            <artifactId>spring-boot-test</artifactId>
 | 
			
		||||
        </dependency>
 | 
			
		||||
        <dependency>
 | 
			
		||||
            <groupId>org.springframework.boot</groupId>
 | 
			
		||||
            <artifactId>spring-boot-starter-web</artifactId>
 | 
			
		||||
        </dependency>
 | 
			
		||||
    </dependencies>
 | 
			
		||||
</project>
 | 
			
		||||
@@ -0,0 +1,13 @@
 | 
			
		||||
package com.cxyxiaomo.epp;
 | 
			
		||||
 | 
			
		||||
import org.springframework.boot.SpringApplication;
 | 
			
		||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
 | 
			
		||||
 | 
			
		||||
// 启动类
 | 
			
		||||
 | 
			
		||||
@SpringBootApplication
 | 
			
		||||
public class TestProvider {
 | 
			
		||||
    public static void main(String[] args) {
 | 
			
		||||
        SpringApplication.run(TestProvider.class, args);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,14 @@
 | 
			
		||||
package com.cxyxiaomo.epp.controller;
 | 
			
		||||
 | 
			
		||||
// 提供 restful 服务
 | 
			
		||||
 | 
			
		||||
import org.springframework.web.bind.annotation.GetMapping;
 | 
			
		||||
import org.springframework.web.bind.annotation.RestController;
 | 
			
		||||
 | 
			
		||||
@RestController
 | 
			
		||||
public class TestController {
 | 
			
		||||
    @GetMapping("/")
 | 
			
		||||
    public String helloWorld() {
 | 
			
		||||
        return "Hello World!";
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
@@ -0,0 +1,7 @@
 | 
			
		||||
server:
 | 
			
		||||
  port: 8011
 | 
			
		||||
 | 
			
		||||
# Spring 配置
 | 
			
		||||
spring:
 | 
			
		||||
  application:
 | 
			
		||||
    name: microservice-provider-test
 | 
			
		||||
@@ -0,0 +1,20 @@
 | 
			
		||||
package com.cxyxiaomo.epp;
 | 
			
		||||
 | 
			
		||||
import static org.junit.Assert.assertTrue;
 | 
			
		||||
 | 
			
		||||
import org.junit.Test;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * Unit test for simple App.
 | 
			
		||||
 */
 | 
			
		||||
public class AppTest
 | 
			
		||||
{
 | 
			
		||||
    /**
 | 
			
		||||
     * Rigorous Test :-)
 | 
			
		||||
     */
 | 
			
		||||
    @Test
 | 
			
		||||
    public void shouldAnswerWithTrue()
 | 
			
		||||
    {
 | 
			
		||||
        assertTrue( true );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
		Reference in New Issue
	
	Block a user