Add test for SMBC
[rhynodge.git] / src / test / java / net / pterodactylus / rhynodge / engine / ConfigurationTest.java
1 package net.pterodactylus.rhynodge.engine;
2
3 import java.io.IOException;
4 import java.io.InputStream;
5
6 import org.hamcrest.MatcherAssert;
7 import org.hamcrest.Matchers;
8 import org.junit.Test;
9
10 /**
11  * Unit test for {@link Configuration}.
12  *
13  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
14  */
15 public class ConfigurationTest {
16
17         @Test
18         public void configurationCanBeReadFromJsonFile() throws IOException {
19                 InputStream inputStream = getClass().getResourceAsStream("configuration.json");
20                 Configuration configuration = Configuration.from(inputStream);
21                 MatcherAssert.assertThat(configuration.getSmtpHostname(), Matchers.is("localhost"));
22                 MatcherAssert.assertThat(configuration.getErrorEmailSender(), Matchers.is("errors@rhynodge.net"));
23                 MatcherAssert.assertThat(configuration.getErrorEmailRecipient(), Matchers.is("errors@user.net"));
24         }
25
26 }