Commit 119b6884 authored by Marcel's avatar Marcel

fix #3 support selfhoster

parent 4df72947
Pipeline #31652454 passed with stage
in 1 minute and 13 seconds
......@@ -18,6 +18,8 @@ songbeamer:
### Instance
Die Churchtools Instanz bezeichnet die Subdomain von Churchtools, also den ersten Teil (vor `.church.tools`).
Selfhoster geben einfach ihre Domain an, bspw. `churchtools.meine-gemeinde.de`.
Wichtig: Es wird eine Transportverschlüsselung mit TLS vorausgesetzt.
### User-ID
......
......@@ -5,7 +5,7 @@
<groupId>de.apis-stuttgart</groupId>
<artifactId>churchtools-to-songbeamer</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
<packaging>jar</packaging>
<name>churchtools-to-songbeamer</name>
......
......@@ -24,6 +24,10 @@ public class ChurchtoolsConfig {
return "";
}
if (instance.contains(".")) {
return "https://" + instance + "/index.php";
}
return "https://" + instance + ".church.tools/index.php";
}
}
package de.apisstuttgart.churchtoolstosongbeamer.config;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class ChurchtoolsConfigTest {
@Test
public void testUnsetInstance() {
ChurchtoolsConfig config = new ChurchtoolsConfig();
assertEquals("", config.getUrlBase());
}
@Test
public void testChurchToolsSaaSInstance() {
ChurchtoolsConfig config = new ChurchtoolsConfig();
config.setInstance("test");
assertEquals("https://test.church.tools/index.php", config.getUrlBase());
}
@Test
public void testSelfhosterInstance() {
ChurchtoolsConfig config = new ChurchtoolsConfig();
config.setInstance("example.com");
assertEquals("https://example.com/index.php", config.getUrlBase());
}
}
package de.apisstuttgart.churchtoolstosongbeamer.domain;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
public class CtAgendaItemTest {
@Test
public void testGetDuration() {
CtAgendaItem ctAgendaItem = new CtAgendaItem();
ctAgendaItem.setDuration("1234");
assertEquals("20:34", ctAgendaItem.getDuration());
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment