Improve coverage in flow/controller/node
[appc.git] / appc-config / appc-flow-controller / provider / src / test / java / org / onap / appc / flow / controller / node / PropertiesLoaderTest.java
1 package org.onap.appc.flow.controller.node;
2
3 import java.io.FileNotFoundException;
4 import java.io.IOException;
5 import java.util.Properties;
6 import org.junit.Assert;
7 import org.junit.Rule;
8 import org.junit.Test;
9 import org.junit.rules.ExpectedException;
10
11 public class PropertiesLoaderTest {
12
13   @Rule
14   public ExpectedException expectedException = ExpectedException.none();
15
16   @Test
17   public void should_load_property_file() throws IOException {
18     Properties properties = PropertiesLoader.load("src/test/resources/properties_loader.properties");
19
20     Assert.assertEquals("OK", properties.getProperty("test"));
21   }
22
23   @Test
24   public void should_throw_if_file_does_not_exists() throws IOException {
25     expectedException.expect(FileNotFoundException.class);
26     PropertiesLoader.load("src/test/resources/non_existent.properties");
27   }
28
29 }