Every Microservice that you write should have it’s own repository. It should have it’s own build plan which should create a build whenever you make changes in microservices code base/repository. Also a separate set of unit tests need to be triggered when you make changes to the microservice.
Below is the diagram which shows the points.
Testing Microservices
For testing your microservices, you can plan on writing unit tests and integration tests. Unit tests are isolated and should test all public and private methods in Microservices code. Integration tests should be written in such a way so that mock clients can successfully consume public APIs of microservices once it is deployed on server.
Microservices Template
When you are planning to create multiple microservices, it is a good idea to have a template of a microservice and then have developers create microservices from that template instead of writing microservices from scratch every time. This would help in standardizing common things like logging, configuration, authentication, building micro services and health checks across microservices. Otherwise each developer will implement his own idea of these common things and it will get messy.