Today, we did a unit test to debug the interface. We found that the interface call was successful, but we did not run the thread pool execution method. Instead, we directly skipped the execution code
ExecutorService pool = Executors.newFixedThreadPool( 2 );
public void callInterfaceCreditease(final String idcard,final String name,final String mobile){
try{
ExecutorService pool = Executors.newFixedThreadPool( 2 );
//Interface
pool.execute(new Runnable() {
@Override
public void run() {
creditCardCrediteaseService.doFetchCreditData(name, idcard, mobile);
}
});
//Release thread pool resources
pool.shutdown();
}catch(Exception e){
log.error("Calling interface exceptions:",e);
}
}
Read More:
- Maven skip unit test
- Maven skip unit test- maven.test.skip And skipstests
- Error in idea unit test command line is too long
- [Solved] Unit test automatically injects error reporting nullpointer
- Solve the problem of springboot and unit test starting applicationrunner
- Spring configuration transaction, JUnit unit test error “failed to load ApplicationContext”
- Using Mocha to test can not find module ‘. /build/release/scrypt’ (Fixed)
- Junit4 unit test reports an error invalid project specified
- python multiprocessing.pool NameError: name is not defined
- The usage of Java JUnit unit test and the solution of initialization error
- JMeter running error response code: non HTTP response code: java.lang.illegalargumentexception find and solve
- Solution to “error code is 0x4001” when Intel SGX is running
- Why use thread pools? Remember and understand
- An error is reported when installing the package directly in pycharm, but it can be installed through the terminal. Error non zero exit code (2)
- The 406 status code can not find acceptable representation is returned in spring MVC
- Spring MVC 406 status code / could not find acceptable representation
- Solve the error reported by Android studio directly running java.main
- Solution to the problem of spring boot running test class error creating bean with name ‘serverendpoint exporter’ defined
- Google browser chrome installation failed, error code: 0xa0430721 solution (★ pro test is feasible 〉)
- Error running ‘Tomcat 9‘: Address localhost:1099 is already in use