Camunda.Api.Client icon indicating copy to clipboard operation
Camunda.Api.Client copied to clipboard

Tests and refactoring

Open gaensebluemchenritter opened this issue 5 years ago • 4 comments

Hi there,

looking into Camunda.Api.Client we see that there are only two tests - and they are failing right now (at least we cannot get them to work in the master branch). We also see, that many class definitions are within other classes files, sometimes even within other classes - not sure, if that was indeed done on purpose or just out of convenience, but it makes it very hard to actually find some of the classes ...

So we have thought about a refactoring of the project and redoing the tests - and adding tests whenever we have the time. Also we think about introducing just enough interface-definitions to be able to unit test user code rather easily instead of using wrapper interfaces and classes in order to do so.

A first starting point for a discussion can be found here: https://github.com/gaensebluemchenritter/Camunda.Api.Client/tree/Refactoring

Both tests are working right now and restructuring as well as pulling out embedded classes is done. Additional interface-definitions are still missing, however ...

Disclaimer: this is not meant as criticism, but we strongly believe that restructuring and refactoring the code will help in the future, making it easier to actually apply changes, enhancements, bugfixes, ... this also is naught but a starting point for a discussion, if this would indeed be helpful and if the structure is valid and self-explanatory enough. If there is no intention of thinking about stuff like that, it is ok - I just thought it could be interesting enough to talk about it.

gaensebluemchenritter avatar Dec 17 '19 16:12 gaensebluemchenritter

Additional remark:

Yes, these are breaking changes, so rather than not user code would have to be changed as well!

gaensebluemchenritter avatar Dec 18 '19 07:12 gaensebluemchenritter

Did some further updates:

  • introduced interfaces for client and main services - user code can do unit tests without having to define wrapper classes and other workarounds
  • added 2 missing resources/methods for identity service: GetPasswordPolicy and ValidatePassword
  • introduced subdirectories for specific history services

I found that the authorization service is missing completely - if I find time I'll try to add that and start looking into the TODO comments ...

gaensebluemchenritter avatar Jan 15 '20 08:01 gaensebluemchenritter

further updates:

  • Upgraded to Refit 5.0.23 (see https://github.com/jlucansky/Camunda.Api.Client/issues/44)
  • added Batch service endpoint
  • added DecisionRequirementsDefinition service endpoint

gaensebluemchenritter avatar Mar 05 '20 15:03 gaensebluemchenritter

further updates:

  • Upgraded to Refit 5.1.67 (se #44)
  • added further missing services (in Case Execution)

gaensebluemchenritter avatar Apr 24 '20 12:04 gaensebluemchenritter