I think this is pretty straightforward.

The key is having a product that is indeed good.

If it's good, you'll be proud to share it - the rest just depends on asking the testimonial sincerely. Think about this: it isn't about you, it's about them.

How can you make writing the testimonial something that benefits them - or even make them feel better because of it? Even a good way of following up and asking them works.