From the course: Building Role-Based Access using AI for Java Developers

Unlock this course with a free trial

Join today to access over 25,500 courses taught by industry experts.

Testing the personal contract service for non-owner accounts

Testing the personal contract service for non-owner accounts

From the course: Building Role-Based Access using AI for Java Developers

Testing the personal contract service for non-owner accounts

- [Instructor] We should write one more test to ensure that our role-based access control in the context of personal accounts is working. So far we have tested that for the owner contract flow, it works fine, which is the happy path. But what if some other person tries to access the contract created by Alice? What will happen then? And this is where we can truly assert that our implementation is working fine. Let's write one more test with the same pattern by writing a use case and letting AI write the test implementation for us. So I'm going to come here and then say test and then I'm going to say void and then it gives a addition test non-owner account flow, which is nice. And then we are going to write our doc string. So it says create personal account for Alice. Yes, create a contract for Alice. Yes. Validate that the contract has been created and then it says update the contract as Bob, but Bob has not been created. So this solution is not useful. So first we'll say create a…

Contents