I class called NullMetricsPublisher, there are a few methods inside, for example one of them void publish(). As the class name already indicates that the class should doing nothing. The void publish() method is essentially empty.
void publish() {
// do nothing in this method
}
However, we do want to unit test it, make sure no logic inside the method at all. Wondering anyone know how to test an empty method of a class in Java?
Aucun commentaire:
Enregistrer un commentaire