package johnny.me.controller;
import com.sparkpost.Client;
import com.sparkpost.model.responses.Response;
import com.sparkpost.exception.SparkPostException;
import org.springframework.stereotype.Service;
/**
* Sparkpost class sends the email using
* the sendmessage methood
*/
@Service public class SparkPostController {
String API_KEY = "API KEY";
Client client = new Client(API_KEY);
private static String from_email = "me@yahoo.com";
private static String subject = "Time equation";
private static String text = "";
public Response sendMessage(String recipient, String message) throws SparkPostException {
return client.sendMessage(from_email,recipient,subject,
text,message);
}
}
This my sparkpost controller class. Trying to make a unit test/ mock to send message. Also known as regression test Please be very specific fairly new to unit testing. Have my class made under the testing folder.Thats all i got.