The springboot comes with a test module.Annotations require:@SpringApplicationConfiguration (classes = computeserviceapplication. Class)This allows the environment context to be introduced.The complete notes are as follows:@RunWith (Springjunit4classrunner. Class= computeserviceapplication. class ) @WebAppConfiguration@BeforeInitializing an MOCKMVC instance Public void throws Exception { = mockmvcbuilders.webappcontextsetup (WAC). build ();
Currently there is a jar running, after uploading a new jar, you need to delete the old, execute the new, accidentally may have deleted the new, wrote a script, do the next record#!/bin/Bashpath=/work/server/Filehead=server-Filetail=Jarabspath=${path}${filehead}*. ${filetail}jarcount=`ls-L $absPath |WC-l 'Echo$jarCountifTest $jarCount-le1 Then Echo "Only one Jar File, exist!"ExitfiMaxTime=0Temptime=0NewFile="" for file inch`ls-A $absPath ' DoTemptime=`Stat-C%Y $file` ifTest $maxTime-LT $temp
Spring-boot Project Thermal Deployment Idea Tool:
(1), pom file introduction: All need to be true
(2), idea compiler set File→setting→compiler
(3) Idea setting
Shortcut keys Ctrl+alt+shift/
Check
Restart the project to take effect. Parental test is effective.
The 1th Chapter Spring Boot Introduction1-1 Spring Boot Blog _ Course GuideWhat is 1-2 Spring Boot?2nd. Opening Spring Boot's first WEB project2-1-Initialize the first web project2-2-Co
A: PrefaceOften at the time of development, the configuration files in the project, in the personal development of a set of configuration files, a set of configuration files in the test environment, a set of configuration files in the formal environment, this time if the configuration file complex, need to change a lot of things, and because of the iterative process, it is necessary to switch frequently, problems inevitably occur.Two: the solution of
configuration file:Management.context-path=/endpointsTo start the test:3.6 Endpoint Protection3.3.6.1 using springsecurity configuration ItemsApplication security mechanism, we can use Spring security,Spring security is for the entire application, after use to access the application, the HTTP Basic Authentication dialog box will pop up. L Join DependencyL Join C
Course Catalogue and:01. Spring Boot Hello world_ HD. mp402. Spring Boot Returns JSON data _ HD. mp403, Spring Boot Perfect use Fastjson parsing JSON data _ HD. mp404, Spring
Spring boot needs to write a lot of JUnit code to test the rest API, which makes it a headache for people who don't know the code. If you use the Rest Client tool to test the rest API, many rest client tools do not support automated testing, and repeat the tests every time, which can take too much time to do repetitive
Every time eclipse uses the run as-a Maven install, it always runs JUnit test, some of which are associated with databases, and some are more dangerous. How do I skip the test skip testing?The Spring-boot-maven-plugin plugin has integrated the Maven-surefire-plugin plug-in to add only in Pom.xml
1
2
3
4
5
6
It is impor
Spring Boot can be configured with the properties file, Yaml file, environment variables, and command line parameters. Attribute values can be injected into the application by, @Value annotations, environment or configurationproperties. The configuration is prioritized as follows:
If Devtools is used, the ~/.spring-
this, we need to configure Tomcatembeddedservletcontainerfactory and add Tomcat's Connector to implement it.At this point we need to add the following configuration in the configuration file: packagecom.wisely.ch7_4;Importorg.springframework.boot.SpringApplication;Importorg.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public classch74application { public Static voidmain (string[] Args) {springapplication.run (ch74application.class, args); } @Bean publicembedd
(under the project root) where the dependencies section is a dependency configuration: note: The following code is automatically generated without any modification, here is just a description of the configurationdependencies {compile(‘org.springframework.boot:spring-boot-starter-actuator‘)compile(‘org.springframework.boot:spring-boot-starter-data-jpa‘)compile(‘org.springframework.boot:spring-
values for No limit) spring.redis.pool.max-active=8# connection pool maximum blocking wait time (using negative values means there is no limit) spring.redis.pool.max-wait=-1# The maximum idle connection in the connection pool spring.redis.pool.max-idle=8# the minimum idle connection in the connection pool spring.redis.pool.min-idle=0# connection time-out (in milliseconds) spring.redis.timeout =0 Where the configuration of spring.redis.database usually uses 0, Redis can set the number of databa
controllersrc/mainunder Create a new package cn.zxuqian.controllers and create a new class in it, name HelloController and add the following code:package cn.zxuqian.controllers;import org.springframework.web.bind.annotation.RequestMapping;import org.springframework.web.bind.annotation.RestController;@RestControllerpublicclass HelloController { @RequestMapping("/") publicindex() { return"Hello World!"; } }
@RestControllerMark this class as a rest controller and be rea
Tag: Run the Access test event blank to avoid the annotation system tellingOverviewSpring Boot monitoring Core is spring-boot-starter-actuator dependency, after increasing the dependency, spring boot will default to configure some
1: It is easy to read the configuration of the custom properties in the Application.properties, so there are not too many descriptions here:Custom properties and loadingFor example, define the following properties:
com.blog.title=spring Boot Tutorial
The corresponding configuration properties are then loaded by @Value ("${Property Name}") annotations, as follows
Spring Boot Basics Tutorial1th QuarterInstallation and use of toolsSpring Boot Documenthttps://qbgbook.gitbooks.io/spring-boot-reference-guide-zh/content/I.%20Spring%20Boot%20Documentation/I. Tools used in the courseSpring Tool Suite:https://spring.io/tools/sts/allEclipse:ht
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.