What is mockito What is it It is a unit testing framework in java language Usage scenarios Unit testing can also be performed even when the resource environment is imperfect to ensure development progress and program correctness. The entire project usually relies on multiple components such as databases, cache databases, third-party systems, etc. . In […]
Tag: moc
Windows builds googlemock c++ test project (CLion) from scratch
1. Introduction to Gmock Gmock is a set of auxiliary testing tools developed by Google. It is often used in conjunction with GTest. It is mainly used to simulate the interfaces agreed by other modules for self-testing. That is, the interface form has been defined, but the implementation has not been given. We use Gmock […]
Springboot combines Mockito to write unit tests practices and principles
Article directory Preface 1. Use Best Practices scenes to be used @SpyBean failure scenario Solve the problem of Mock failure Avoid FactoryBean implementation Use @MockBean, but specify name Personal recommendation 2. Principle 1. @MockBean 2.@SpyBean method call Summarize Foreword I believe that all those who read my blog are Javaers, and they generally use the […]
Stm32 Max6675 K-type thermocouple collects temperature values (code + related methods)
K-type thermocouple temperature collection is a small requirement in the new project. Originally, an NTC thermistor was used, but the maximum temperature could only reach 200 degrees, and it was not very sensitive after 150 degrees, so a thermocouple was used instead. , the previous part is my accumulation of knowledge about thermocouples, ideas and […]
Principles and characteristics of thermistors, RTDs, and thermocouples
Table of Contents 1. Thermistor 2. RTD characteristics 3. Thermocouple 4. The difference between thermistors, RTDs and thermocouples 1. Thermistor A thermistor is a sensor resistor whose resistance changes as temperature changes. According to different temperature coefficients, they are divided into positive temperature coefficient thermistor (PTC thermistor, Positive Temperature Coefficient thermistor) and negative temperature coefficient […]
Mock test for interface testing
1. Mock test 1. Mock test scenario Front-end and back-end data interaction Third-party system data interaction Hardware device decoupling 2. The value and significance of Mock testing No reliance on third-party data Save work Save joint debugging 3. Mock core elements Matching rules: mock interface, which interfaces to change, and where is the data in […]
Python interface automation: use of Mock service
Mock implementation principle and implementation mechanism At some point, when the backend is developing the interface, the processing logic is very complicated. When testing, how should the backend test without completing the interface? 1. What is mock The word Mock means simulation in English, so we can guess that the main function of this library […]
21. Go unit testing tool mockey and convey
Article directory Preface assertion mock Overall usage: Specific examples mock structure method mock ordinary functions serialized mock MySQL and Redis single test go-sqlmock miniredis F&Q 1. How to disable inlining and compilation optimizations Foreword At work, with the rapid development of business, the size and complexity of code will also increase rapidly, and the stability […]
junit combines MockMvc in spring-test to test the SpringMvc interface method
The following is the Controller in the SpringMvc project import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import lombok.extern.slf4j.Slf4j; /** * @Author: daysurprise * @Mote: I bloom in life, like a flower in the dawn * @Desc: Service provider recharge and account web interface */ @Slf4j @RestController public class LevySeparateAccountingController { /** * Service provider […]
Element-UIMock.js, case home page navigation, left menu
一.Mock.js 1. What is Mock.js Mock.js is a JavaScript library for generating mock data. It can simulate the back-end API interface and be used for interface debugging and testing during front-end development to improve the efficiency of automated testing. Using Mock.js, you can quickly create virtual data, and set the data type, format, and rules […]