New Zealand has won international praise for its tackling of the coronavirus pandemic, with the island country going months without community transmission.