(NewHellocontroller ()). build (); } @Test Public voidGethello ()throwsException {mvc.perform (Mockmvcrequestbuilders.get ("/hello"). Accept (Mediatype.application_json)). Andexpect (Status (). IsOk ()). Andexpect (Content (). s Tring (Equalto ("Hello World"))); } }
Use MockServletContext to build an empty one WebApplicationContext so that we can create HelloController it @Before and pass it to the function in the function MockMvcBuilders.standaloneSetup() .
Note that the following
Abstract: Honghu Cloud distributed micro-service clouds system-eureka we build on the Eureka project for Honghu Cloud, the entire build process is simple, I will record every step of the construction process, I hope to help everyone. 1. Create a MAVEN project named Common-eureka, inheriting Commonservice, with the following pom.xml configuration file:Honghu
We've introduced the knowledge points of spring cloud and oauth2 in the previous few, and today we're going to use spring cloud and oauth2 to build Commonservice-sso services, In this section we are just building Commonservice-sso foundation platforms, gossiping less, directly documenting the steps:
Create the MAVEN project Commonservice-sso, where the Pom.xml file is configured as follows:
Configurin
Today formally introduced the Spring Cloud-honghu Enterprise distributed micro-service cloud architecture, my side combined with the current majority of enterprises general requirements, including the selection of technology is more stringent, harsh, not only to use the industry's most popular technology, but also with international standards, in the next 5-10 ye
Honghu Cloud distributed micro-service clouds system-eurekaWe build the following for the Eureka project of Honghu Cloud, the whole building process is simple, I will record every step of the construction process, I hope to help everyone.
Create a Maven project named Common-eureka, which inherits the Commonservice, and the specific pom.xml configuration
Register-with-eureka:true # whether to get registration information from Eureka Fetch-registry:fals E Availability-zones:honghu:honghuzone Service-url:honghuzone:http://honghu:[emailprotected]:8 761/eureka/defaultzone:http://honghu:[emailprotected]:8761/eureka/instance:prefer-ip-address:true h Ostname:localhost metadataMap:zone:honghuZone User: ${security.user.name} password: {SECURITY.USER.PA ssWOrd} # Specify Environment Environment:dev #指定数据中心 Dat
. Configuring the Application.yml File# server (Eureka default port is:8761) Server:port:8761# springspring:application:name:particle-commonservice-Erueka # eurekaeureka:client: # Register to Eureka Register-with-eureka:true# Whether to get registration information from Eureka Fetch-registry:falseAvailability-Zones:honghu:honghuZone Service-url:honghuZone:http://Honghu:[email protected]:8761/eureka/Defaultzone:http://Honghu:[email protected]:8761/eure
Absrtact: Springcloud's sub-projects can be broadly divided into two categories: one is the encapsulation and abstraction of the existing mature framework spring boot, and the largest number of projects; the second is the development of a subset of the infrastructure for distributed systems, such as Springcloud Stream is Kafka, activemq such a role. Developer's practice of microservices, the first category of sub-projects is already sufficient to useBrief introductionHonghu
In the previous article we introduced the integration of Spring Cloud service architecture-Honghu Cloud architecture Common-service Code Structure analysis, this section we will common-service the entire project to be analyzed, the entire construction process to record, Let
deployment, the run as-to-Spring Boot App is performed manually with the following results:Console Run Results:To access the console and log in:Console Run Effect:From now on, I will be documenting the process and essence of the recent development of the spring cloud micro-service cloud architecture to help more friends who are interested in developing the Sprin
The technical finishing needed to do a microservices architecture:View:H5, Vue.js, Spring Tag, React, AngularJsSpring boot/spring Cloud:Zuul, Ribbon, feign, Turbine, Hystrix, Oauthor2, Sleuth, API Gateway, Spring Cloud, Config Eureka, SSO, Spring Cloud,BUS, Turbine, Zipkin, Cache, Spring Cloud Admin, API Gateway, ELK Spring C
Distributed, microservices, cloud architectureJava language development, cross-platform, high-performance, high-availability, secure, service-based, modular, component-driven development modelFrom now on, I will record the process and the essence of the recently developed Springcloud micro-service cloud architecture, a
SOURCE structureJava Development, MAVEN modular construction, service-independent packaging, distributed deployment, continuous integration, version controlFrom now on, I will record the process and the essence of the recent development of Spring Cloud micro-service cloud architecture, and help more friends who are int
SOURCE structureJava Development, MAVEN modular construction, service-independent packaging, distributed deployment, continuous integration, version controlFrom now on, I will record the process and the essence of the recently developed Springcloud micro-service cloud architecture, and help more friends who are interested in developing the Spring
SOURCE structureJava Development, MAVEN modular construction, service-independent packaging, distributed deployment, continuous integration, version controlFrom now on, I will record the process and the essence of the recently developed Springcloud micro-service cloud architecture, and help more friends who are interested in developing the Spring
SOURCE structureJava Development, MAVEN modular construction, service-independent packaging, distributed deployment, continuous integration, version controlFrom now on, I will record the process and the essence of the recently developed Springcloud micro-service cloud architecture, and help more friends who are interested in developing the Spring
SOURCE structureJava Development, MAVEN modular construction, service-independent packaging, distributed deployment, continuous integration, version controlFrom now on, I will record the process and the essence of the recently developed Springcloud micro-service cloud architecture, and help more friends who are interested in developing the Spring
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.