Unit test - spring boot resume unit test

In the Spring project, unit test items need to be established for each layer of controller, service and dao. For different layers, we can use junit and mock in different ways. SpringBoot increases dependency <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test< ...

Posted on Tue, 10 Dec 2019 02:03:45 -0800 by zachrose

Solve the compatibility problem of the support library version: the support package is underlined in red when it is introduced

If the support library version of the referenced third-party library is lower (or inconsistent) than that in app build.gradle, the following problems may occur: all com.android.support libraries must use the exact same version specification(mixing versions can lead to runtime crashes) As shown in the figure below: It is difficult to chang ...

Posted on Mon, 09 Dec 2019 01:28:53 -0800 by Rabioza123

Unit test - establish multithreaded unit test

Unit test (1): spring boot establishes unit test Unit test (2) - Junit4+EasyMock build unit test Unit test (3) - establish multithreaded unit test Junit does not support multithreading. After a unit test case main process runs, other new threads will be GG Smecta. This article mark s a method of multithreading in Junit. Scheme 1 Add dependen ...

Posted on Fri, 06 Dec 2019 08:05:02 -0800 by ShadowIce

Spring ABCD tools and interface cases

1.spring tool class: ApplicationContextUtil.java, which can return the container object to load the configuration file package com.ahd.utils; import org.springframework.context.ApplicationContext; import org.springframework.context.support.ClassPathXmlApplicationContext; public class ApplicationContextUtil { static ApplicationContext ac= ...

Posted on Thu, 05 Dec 2019 18:54:23 -0800 by predhtz

Spring @Autowired injected into List and Map

Preface There is a code like this in our system. Many new students seem to be confused. Will null pointer be reported! In fact, spring supports the direct injection of interface based implementation classes. Example BeanInterface is just an interface without methods. package com.Autowired.ListMap; import org.springframework.core.annotatio ...

Posted on Thu, 05 Dec 2019 09:32:15 -0800 by tyr_82

Simple understanding of Java reflection

Reflect: Java reflection mechanism is to know all the properties and methods of any entity class in the running state; to any object, all its methods and properties can be called; this dynamic information acquisition and function of dynamically calling object methods are called reflection mechanism of Java language Get class object: Through API ...

Posted on Wed, 04 Dec 2019 01:06:25 -0800 by btubalinal

Common encryption and decryption -- Digital Signature

Original link: https://www.dubby.cn/detail.html?id=9125 Previously Common encryption and decryption (1) The message digest is mentioned in it. What's the difference between the digital signature and the message digest? In fact, a digital signature is a message digest with asymmetric encryption. The purpose of message digest is to ...

Posted on Sun, 01 Dec 2019 12:02:13 -0800 by Labbat

rabbitmq delay queue demo

Engineering structure:   Define the version that the jar package depends on. The version is very important. rabbit depends on spring and must be consistent. Otherwise, an error is reported <properties> <springframework.version>4.2.7.RELEASE</springframework.version> <spring-rabbit.version>1.6.1.RELEASE&l ...

Posted on Sun, 01 Dec 2019 09:03:33 -0800 by goldberg

Gradle Core: Gradle multi-project, multi-channel building, testing

Reference materialhttps://developer.android.goo... Android Gradle Multiple Project Build Android projects are generally divided into library projects, application projects, and test projects. The corresponding plug-ins are com.android.library, com.android.application, com.android.test. Usually there is only one application project, which is ev ...

Posted on Sat, 23 Nov 2019 18:09:58 -0800 by ifubad

TDD two hours implementation of custom expression template parser

Why rebuild a wheel? In many cases, users need to dynamically generate mail and PDF according to their custom templates. Among the open source components, there are two types of product families that are more suitable for the needs: Template rendering engines, such as FreeMarker and velocity, are powerful and unusual, but they are too flexibl ...

Posted on Tue, 19 Nov 2019 11:37:48 -0800 by jawaking00