Add test-case for key management