package org.cacert.gigi.ping;
import static org.junit.Assert.*;
+import static org.junit.Assume.*;
import java.io.IOException;
import java.net.URL;
import org.cacert.gigi.pages.account.domain.DomainOverview;
import org.cacert.gigi.testUtils.IOUtils;
import org.cacert.gigi.testUtils.PingTest;
-import org.cacert.gigi.testUtils.TestEmailReciever.TestMail;
+import org.cacert.gigi.testUtils.TestEmailReceiver.TestMail;
import org.cacert.gigi.util.DNSUtil;
import org.cacert.gigi.util.RandomToken;
import org.junit.Test;
public void testEmailAndDNS(int dnsVariant, int emailVariant, boolean successDNS, boolean successMail) throws IOException, InterruptedException, SQLException, NamingException {
String test = getTestProps().getProperty("domain.dnstest");
+ assumeNotNull(test);
URL u = new URL("https://" + getServerName() + DomainOverview.PATH);
Matcher m = initailizeDomainForm(u);
"&adddomain&csrf=" + csrf;
URL u2 = sendDomainForm(u, content);
- TestMail mail = getMailReciever().recieve();
+ TestMail mail = getMailReciever().receive();
if (emailVariant == 0) {
- String link = mail.extractLink();
- new URL(link).openConnection().getHeaderField("");
+ mail.verify();
}
waitForPings(2);
private String readDNS(String token) throws NamingException {
String test = getTestProps().getProperty("domain.dnstest");
+ assumeNotNull(test);
String targetDomain = token + "._cacert._auth." + test;
- String[] data = DNSUtil.getTXTEntries(targetDomain, getTestProps().getProperty("domain.testns"));
+ String testns = getTestProps().getProperty("domain.testns");
+ assumeNotNull(testns);
+ String[] data = DNSUtil.getTXTEntries(targetDomain, testns);
assertEquals(1, data.length);
return data[0];