Teste die neuen Domain Optionen

This commit is contained in:
Timotheus Pokorra 2023-12-12 10:55:37 +01:00
parent 0941515461
commit fea2612a48

View File

@ -9,6 +9,7 @@ import java.io.IOException;
import java.net.UnknownHostException;
import java.util.HashMap;
import java.util.Map;
import java.util.Arrays;
import org.apache.xmlrpc.XmlRpcException;
import org.apache.xmlrpc.client.XmlRpcClient;
@ -158,7 +159,8 @@ public class DomainTest {
setParams = new HashMap<String, Object>();
whereParams = new HashMap<String, String>();
setParams.put("validsubdomainnames", "www2");
setParams.put("domainoptions", new String[] {"greylisting", "letsencrypt"});
String[] newDomainOptions = new String[] {"greylisting", "letsencrypt", "passenger", "passengerfriendlyerrorpages", "cgi", "fastcgi"};
setParams.put("domainoptions", newDomainOptions);
whereParams.put("name", "exampleupdate.de");
params = new Object[] { user,
cas.getServiceTicket(grantingTicketURL, RemoteTestHelper.getBackendURL()),
@ -174,11 +176,11 @@ public class DomainTest {
assertTrue("Domain name should be exampleupdate.de but is " + row.get("name"), "exampleupdate.de".equals(row.get("name")));
assertTrue("ValidSubdomainNames should be www2 but is " + row.get("validsubdomainnames"), "www2".equals(row.get("validsubdomainnames")));
Object[] domainoptions = (Object[]) row.get("domainoptions");
String options = "";
for (Object option: domainoptions) {
options += option + " ";
}
assertTrue("Domainoptions should be greylisting letsencrypt but are " + options, "greylisting letsencrypt ".equals(options));
String[] checkDomainOptions = Arrays.asList(domainoptions).toArray(new String[0]);
Arrays.sort(newDomainOptions);
Arrays.sort(checkDomainOptions);
assertTrue("Domainoptions should be " + Arrays.toString(newDomainOptions) + " but are " + Arrays.toString(checkDomainOptions),
Arrays.toString(newDomainOptions).equals(Arrays.toString(checkDomainOptions)));
}
else {
fail("Map<?, ?> expected");