Fix a bug in the CmAgent JUnit