简体   繁体   中英

Rest-Assured: How to clean up test data?

I'm trying to start writing new integration tests for my rest apis. One the basic requirement is to be able to create a user but user cannot delete itself. Only system's superUser is allowed to delete this user. What is the best way of doing test data cleanup?

I can do superUser login using hardcoded email and password and then do the cleanup, but I really don't like the credentials to be hardcoded in the test code...

如果您正在使用TestNG / JUnit运行测试,则在@After部分中,我将使用有经验的超级用户进行清理。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM