We are currently developing a public API for our app. The methods on this public API are mostly putting together functionality in different corners of the system. An example would be: (names have been changed to protect the innocent)
public String createAppUser(String app, String name, String email, byte[] pwd) {
Application appl = applicationModule.retrieve(app);
User user = userModule.createUser(name,email);
Digest digest = cryptoModule.createDigest(pwd);
authenticationModule.authorize(user,appl,digest);
accountingModule.createAccount(user,appl);
return user.getId();
}
When unit testing such a thing, the unit test is just a copy of the same workflow, with some additional noise to setup mocks, objects and validate interactions. Although I find unit-test of algorithmic parts of the application essential, in this 'workflow' part, I find unit-test a repetition of the workflow in question form. Following the DRY principle, it feels like a waste of time. What are the best practices in these cases?
Given that these methods are part of a public API, I would find more valuable to test them through a client and validate that the system effects have taken place. This is more 'system test' or 'integration test' and beyond the scope of unit test.
What would be the best test approach in this context?