diff --git a/modules/telestion-api/src/test/java/de/wuespace/telestion/api/verticle/ConfigurationTest.java b/modules/telestion-api/src/test/java/de/wuespace/telestion/api/verticle/ConfigurationTest.java new file mode 100644 index 00000000..c06cba4a --- /dev/null +++ b/modules/telestion-api/src/test/java/de/wuespace/telestion/api/verticle/ConfigurationTest.java @@ -0,0 +1,82 @@ +package de.wuespace.telestion.api.verticle; + +import de.wuespace.telestion.api.message.JsonMessage; +import org.junit.jupiter.api.Nested; +import org.junit.jupiter.api.Test; + +import static org.hamcrest.Matchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + +/** + *

+ *

Configuration Tests

+ * Corresponding tests for the configuration classes provided by the Telestion Project. + *

+ *

+ *

{@link TelestionConfiguration}

+ * This test checks if {@link TelestionConfiguration}: + * + *

+ *

+ *

Provided Configurations

+ * In contrast to the base interface {@link TelestionConfiguration} the other provided Configurations: + * + *

+ * + * @author Cedric Boes (cb0s) + */ +public final class ConfigurationTest { + @Nested + public class TelestionConfigTest { + @Test + public void shouldBeInterface() { + // Needs to be an interface to be implemented by `Records` + assertThat(TelestionConfiguration.class.isInterface(), is(true)); + } + + @Test + public void shouldExtendJsonMessage() { + assertThat(JsonMessage.class.isAssignableFrom(TelestionConfiguration.class), is(true)); + } + } + + @Nested + public class ProvidedConfigurationTest { + @Test + public void shouldImplementTelestionConfiguration() { + assertThat(TelestionConfiguration.class.isAssignableFrom(NoConfiguration.class), is(true)); + assertThat(TelestionConfiguration.class.isAssignableFrom(UntypedConfiguration.class), is(true)); + } + + @Test + public void shouldBeRecord() { + assertThat(NoConfiguration.class.isRecord(), is(true)); + assertThat(UntypedConfiguration.class.isRecord(), is(true)); + } + + @Test + public void shouldBeInstantiable() { + // Should not throw exceptions + new NoConfiguration(); + new UntypedConfiguration(); + } + } +}