PropertyFromFileTest

public class PropertyFromFileTest {

	private static Properties properties;
	
	@BeforeClass
	public static void setUpBeforeClass() throws IOException{ //우리의 관심사는 테스트이므로 IOException을 여기서 처리할 필요가 없다.

		Reader reader = new FileReader("src/test/message.properties");
		properties = new Properties();
		properties.load(reader);		
		reader.close();
	}
	
	@Test
	public void testProperty(){
		String key = "key";
		String actual = (String)properties.get(key);
		assertEquals(key, actual);
		assertThat(key, is(actual));
	}
	
	@Test
	public void testPropertyEndWithSpace(){
		String key = "key.endWithSpace";
		String actual = (String)properties.get(key);
		
		//assertThat("value.endWithSpace", is(not(actual))); //불명확하다.
		String expected = "value.endWithSpace" + " ";
		assertThat(expected, is(actual)); //org.hamcrest.CoreMatchers.*
		assertEquals(expected, actual);
	}
	
	@Test
	public void testPropertyEndWithTab(){
		String key = "key.endWithTab";
		String actual = (String)properties.get(key);
		
		//assertThat(expected, is(not(actual))); 
		String expected = "value.endWithTab" + "\t";
		assertThat(expected, is(actual));
		assertEquals(expected, actual);
	}
}
- message.properties
key = value
key.endWithSpace = value.endWithSpace //공백을 넣어 둔다.
key.endWithTab = value.endWithTab    //Tab을 넣어 둔다.