ConfigurationDaoHelper { public String getClobProperty(String configurationKey) { String clob = ""; ConfigurationEntity configurationEntity = configurationDao.getConfigurationByKey(configurationKey); if (configurationEntity != null && StringUtils.isNotBlank(configurationEntity.getValueClob())) { clob = configurationEntity.getValueClob(); } return clob; }  void checkNotAllowedMethod(String methodName); String getClobProperty(String configurationKey); @SuppressWarnings("unchecked") T getXmlClobPropertyAndUnmarshallToObject(Class<T> classType, String configurationKey);  }
@Test public void testGetClobProperty() { ConfigurationEntity configurationEntity = mock(ConfigurationEntity.class); when(configurationEntity.getValueClob()).thenReturn(CONFIGURATION_VALUE); when(configurationDao.getConfigurationByKey(CONFIGURATION_KEY)).thenReturn(configurationEntity); String result = configurationDaoHelper.getClobProperty(CONFIGURATION_KEY); verify(configurationDao).getConfigurationByKey(CONFIGURATION_KEY); verifyNoMoreInteractionsHelper(); assertEquals(CONFIGURATION_VALUE, result); }
@Test public void testGetClobPropertyConfigurationNoExists() { when(configurationDao.getConfigurationByKey(CONFIGURATION_KEY)).thenReturn(null); String result = configurationDaoHelper.getClobProperty(CONFIGURATION_KEY); verify(configurationDao).getConfigurationByKey(CONFIGURATION_KEY); verifyNoMoreInteractionsHelper(); assertEquals("", result); }
@Test public void testGetClobPropertyConfigurationValueIsBlank() { ConfigurationEntity configurationEntity = mock(ConfigurationEntity.class); when(configurationEntity.getValueClob()).thenReturn(BLANK_TEXT); when(configurationDao.getConfigurationByKey(CONFIGURATION_KEY)).thenReturn(configurationEntity); String result = configurationDaoHelper.getClobProperty(CONFIGURATION_KEY); verify(configurationDao).getConfigurationByKey(CONFIGURATION_KEY); verifyNoMoreInteractionsHelper(); assertEquals("", result); }