Fix sonar violation, add more test cases
Test for Shutdown Thread