@Test
public void testFromSystemProperties() throws Exception {

    AutomonPropertiesLoader.SysProperty sysProperty = mock(AutomonPropertiesLoader.SysProperty.class);
    Properties props = new Properties();
    props.put(AutomonPropertiesLoader.CONFIGURED_OPEN_MON, "com.mypackage.SystemPropertyPrecedence");
    when(sysProperty.getProperties()).thenReturn(props);
    when(sysProperty.getProperty(AutomonPropertiesLoader.CONFIGURED_OPEN_MON)).thenReturn("com.mypackage.SystemPropertyPrecedence");
    AutomonPropertiesLoader loader = new AutomonPropertiesLoader(sysProperty, "automon.xml");
    Properties properties = loader.getProperties();
    assertThat(properties.getProperty(AutomonPropertiesLoader.CONFIGURED_OPEN_MON)).isEqualTo("com.mypackage.SystemPropertyPrecedence");
}