18. How spring cloud uses spring test for unit test

Love official account: java paradise In the last part, I learned how spring cloud integrates reids and borrowed the restful interface in the form of web for testing. Is there any other way to unit test the code written by spring boot and spring cloud? Answer: there must be. This article explains how to use spring boot starter test for unit tes ...

Posted by mmponline on Mon, 04 May 2020 20:05:03 -0700

Several ways for spring boot to modify the default port number

Modify application.properties In the first way, we just need to add a sentence like this in application.properties: server.port=8004. Why can I modify the default port of spring boot in this way? Because there is such a class in SpringBoot: ServerProperties. Let's take a look at this class in general: @ConfigurationProperties(prefix = "serv ...

Posted by paperthinT on Mon, 04 May 2020 13:25:32 -0700

How Spring AOP generates proxy objects

The framework is to leave the complex to itself, the simple to coden, as simple as writing hello world When developing Spring AOP programs in the early years, aop was configured with xml files (now xml is not popular, annotation @ EnableAspectJAutoProxy is popular), and then framework parsing, For example: How is this configuration reso ...

Posted by slaeya on Mon, 04 May 2020 09:55:18 -0700

Getting Started with SpringCloud: Sleuth and Zipkin Distributed Link Tracking

The theoretical basis of Distributed Service Tracking in the industry today comes mainly from Google's paper "Dapper, a Large-Scale Distributed Systems Tracing Infrastructure". The most widely used open source implementation is Zipkin of Twitter. To achieve platform-independent, vendor-independent distributed service tracing, CNCF rel ...

Posted by valentin on Mon, 04 May 2020 00:28:23 -0700

SpringMvc initialization entry

In web Engineering, servlet can map to an http request path, and each servlet has its own life cycle. It uses init function to initialize and service function to provide services. Spring MVC makes use of these characteristics of servlet, and ingeniously integrates the initialization of container into the initialization ...

Posted by knight47 on Sun, 03 May 2020 16:40:46 -0700

After using knife4j, I finally gave up swagger UI

introduce knife4j is an enhanced solution for generating Api documents for Java MVC framework integration Swagger, formerly Swagger bootstrap UI, named kni4j in the hope that it can be as small, light and powerful as a dagger! The predecessor of knife4j is swagger bootstrap Ui. In order to adapt to the development of microservice architecture ...

Posted by oliverw92 on Sun, 03 May 2020 12:35:14 -0700

Using Mongodb to implement punch in and sign in system

Using excel file to import data and integrating mongodb to implement punch in system Environmental parameters Development tools: IDEA Basic environment: Maven+JDK8 Main technologies: SpringBoot, Mongodb Spring boot version: 2.2.6   The implementation steps are as follows: 1. Add dependency <dependency> <groupId>o ...

Posted by shinephp on Sun, 03 May 2020 07:56:41 -0700

The use of method handle in Java 7

Before JDK6, we used java reflection to implement dynamic method calls. Most frameworks use more reflection, such as mybatis, spring, etc. In JDK7, java.lang.invoke.MethodHandle (method handle) is added, which is called "modern reflection". In fact, reflection and java.lang.invoke.MethodHandle are both indirect ways to call methods, b ...

Posted by MikeA on Sun, 03 May 2020 06:05:52 -0700

Design pattern series -- single pattern

Definition Ensure that there is only one instance of a class in any case, such as in a running container, privatize the constructor, and provide a global access point. Implementation mode 1. Hungry Han style public class HungrySingleton { private static final HungrySingleton INSTANCE = new HungrySingleton(); private HungrySingleton() { } ...

Posted by meomike2000 on Sun, 03 May 2020 05:44:37 -0700

A standard ajax

A standard ajax Reader's words: after summarizing the past work, I found that I have made a lot of progress. In order to thank the fans for their support, I will strive to build a boutique blog, change the habit of making comments for myself. Again, I hope you can criticize and correct me. If you have solved your problem, remember to pay a ...

Posted by SoberDude on Sat, 02 May 2020 23:35:41 -0700