assertThat(port, not(0));
}
@Test
public void testTestMode() {
PropertiesWrapper wrapper = mock(PropertiesWrapper.class);
config.setControllerProperties(wrapper);
// When dev_mode false and pluginsupport is true, it should be true
when(wrapper.getPropertyBoolean(PROP_CONTROLLER_DEV_MODE)).thenReturn(false);
when(wrapper.getPropertyBoolean(PROP_CONTROLLER_PLUGIN_SUPPORT)).thenReturn(false);
assertThat(config.isPluginSupported(), is(false));
// When dev_mode true and pluginsupport is false, it should be false
when(wrapper.getPropertyBoolean(PROP_CONTROLLER_DEV_MODE)).thenReturn(true);
when(wrapper.getPropertyBoolean(PROP_CONTROLLER_PLUGIN_SUPPORT)).thenReturn(false);
assertThat(config.isPluginSupported(), is(false));
// When dev_mode false and pluginsupport is false, it should be false
when(wrapper.getPropertyBoolean(PROP_CONTROLLER_DEV_MODE)).thenReturn(false);
when(wrapper.getPropertyBoolean(PROP_CONTROLLER_PLUGIN_SUPPORT)).thenReturn(false);
assertThat(config.isPluginSupported(), is(false));
// When dev_mode true and pluginsupport is true, it should be false
when(wrapper.getPropertyBoolean(PROP_CONTROLLER_DEV_MODE)).thenReturn(true);
when(wrapper.getPropertyBoolean(PROP_CONTROLLER_PLUGIN_SUPPORT)).thenReturn(true);
assertThat(config.isPluginSupported(), is(true));
when(wrapper.getPropertyBoolean(PROP_CONTROLLER_DEV_MODE)).thenReturn(true);
when(wrapper.getPropertyBoolean(PROP_CONTROLLER_SECURITY)).thenReturn(true);
assertThat(config.isSecurityEnabled(), is(false));
when(wrapper.getPropertyBoolean(PROP_CONTROLLER_DEV_MODE)).thenReturn(false);
when(wrapper.getPropertyBoolean(PROP_CONTROLLER_SECURITY)).thenReturn(true);
assertThat(config.isSecurityEnabled(), is(true));
when(wrapper.getPropertyBoolean(PROP_CONTROLLER_DEV_MODE)).thenReturn(false);
when(wrapper.getPropertyBoolean(PROP_CONTROLLER_SECURITY)).thenReturn(false);
assertThat(config.isSecurityEnabled(), is(false));
}