1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

添加Test Provider

This commit is contained in:
程序员小墨 2022-11-05 19:41:21 +08:00
parent bbcccb81ca
commit 530d32f2af
10 changed files with 106 additions and 1 deletions

View File

@ -7,6 +7,8 @@
<file url="file://$PROJECT_DIR$/microservice-pojo/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/microservice-provider-miniprogram-8080/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/microservice-provider-miniprogram-8080/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/microservice-provider-test-8011/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/microservice-provider-test-8011/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/microservice-provider-user-8001/src/main/java" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/microservice-provider-user-8001/src/main/resources" charset="UTF-8" />
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />

View File

@ -0,0 +1,16 @@
<component name="ProjectRunConfigurationManager">
<configuration default="false" name="TestProvider" type="SpringBootApplicationConfigurationType" factoryName="Spring Boot" nameIsGenerated="true">
<option name="ACTIVE_PROFILES" />
<module name="microservice-provider-test-8011" />
<option name="SPRING_BOOT_MAIN_CLASS" value="com.cxyxiaomo.epp.TestProvider" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="com.cxyxiaomo.epp.*" />
<option name="ENABLED" value="true" />
</pattern>
</extension>
<method v="2">
<option name="Make" enabled="true" />
</method>
</configuration>
</component>

View File

@ -21,7 +21,6 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>

View File

@ -3,6 +3,8 @@ server:
max-http-header-size: 102400
spring:
application:
name: microservice-provider-miniprogram
datasource:
driver-class-name: com.mysql.cj.jdbc.Driver
url: jdbc:mysql://127.0.0.1:3306/epp?useUnicode=true&characterEncoding=UTF-8&useJDBCCompliantTimezoneShift=true&serverTimezone=UTC

View 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>

View File

@ -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);
}
}

View File

@ -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!";
}
}

View File

@ -0,0 +1,7 @@
server:
port: 8011
# Spring 配置
spring:
application:
name: microservice-provider-test

View File

@ -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 );
}
}

View File

@ -17,6 +17,7 @@
<module>microservice-pojo</module>
<module>microservice-provider-user-8001</module>
<module>microservice-provider-miniprogram-8080</module>
<module>microservice-provider-test-8011</module>
</modules>
<!-- 统一管理jar包版本 -->