コード例 #1
0
 @Test
 public void testGetBooleanValueUnexpectedText() throws Exception {
   ScopeExtDO value = Mockito.mock(ScopeExtDO.class);
   Mockito.when(value.getValue()).thenReturn("foobar");
   Mockito.when(
           scopeExtDao.getLowestExistingConfigurationItem(
               Matchers.any(Long.class), Matchers.anyString()))
       .thenReturn(null);
   Boolean booleanValue = configService.isBooleanActive(null, null, null);
   Assert.assertFalse("Boolean values should be false if ext value is not 'true'.", booleanValue);
 }
コード例 #2
0
 @Test
 public void testGetBooleanNull() throws Exception {
   ScopeExtDO value = Mockito.mock(ScopeExtDO.class);
   Mockito.when(value.getValue()).thenReturn(null);
   Mockito.when(
           scopeExtDao.getLowestExistingConfigurationItem(
               Matchers.any(Long.class), Matchers.anyString()))
       .thenReturn(null);
   Boolean booleanValue = configService.isBooleanActive(null, null, null);
   Assert.assertFalse("Boolean values should default to false.", booleanValue);
 }