@Test public void testBuildDeleteMessage() { final SystemCodes oldsc = new SystemCodes("categoryold","keyold","old"); final String expected = "<p class='delete-message'>Deleted System Codes with Value:<span class='primary-field'>old</span></p>"; Assert.assertEquals(expected, CrudUtil.buildDeleteMessage(oldsc)); }
public static String buildDeleteMessage(final BaseEntity obj) { final StringBuilder message = new StringBuilder( "<p class='delete-message'>Deleted "); final AuditableField pf = CacheUtil.getPrimaryField(obj); message.append(buildPrimaryField(pf, obj)).append("</p>"); return message.toString(); }
CrudUtil { public static String buildDeleteMessage(final BaseEntity obj) { final StringBuilder message = new StringBuilder( "<p class='delete-message'>Deleted "); final AuditableField pf = CacheUtil.getPrimaryField(obj); message.append(buildPrimaryField(pf, obj)).append("</p>"); return message.toString(); } }
CrudUtil { public static String buildDeleteMessage(final BaseEntity obj) { final StringBuilder message = new StringBuilder( "<p class='delete-message'>Deleted "); final AuditableField pf = CacheUtil.getPrimaryField(obj); message.append(buildPrimaryField(pf, obj)).append("</p>"); return message.toString(); } private  CrudUtil(); }
CrudUtil { public static String buildDeleteMessage(final BaseEntity obj) { final StringBuilder message = new StringBuilder( "<p class='delete-message'>Deleted "); final AuditableField pf = CacheUtil.getPrimaryField(obj); message.append(buildPrimaryField(pf, obj)).append("</p>"); return message.toString(); } private  CrudUtil(); static String buildCreateMessage(final BaseEntity obj); static List<String> getUpdatedFields(final BaseEntity oldObject,
			final BaseEntity newObject); static String convertAuditableFieldsToJson(BaseEntity obj); @SuppressWarnings({ "rawtypes", "unchecked" }) static String buildUpdateMessage(final BaseEntity oldObject,
			final BaseEntity newObject); static String buildDeleteMessage(final BaseEntity obj); static Map<String, Object> buildMapValues(final BaseEntity object); @SuppressWarnings("rawtypes") static Map<String, Object> buildMapValues(final BaseEntity object,
			final List<String> fields); static String buildURLParameters(final BaseEntity object); @SuppressWarnings("rawtypes") static String buildJpaQueryString(final BaseEntity example,
			final boolean exactMatch); @SuppressWarnings("rawtypes") static Object retrieveObjectValue(final Object obj,
			final String property); static Object retrieveNullableObjectValue(final Object obj,
			final String property); static Class<?> retrieveObjectType(final Object obj,
			final String property); static Boolean evaluateExpression(final Object obj,
			final String expression); @SuppressWarnings("unchecked") static String replaceSQLParameters(String sql, final Object obj); @SuppressWarnings({ "rawtypes" }) static List<Field> getAllFields(final Class clazz); @SuppressWarnings({ "rawtypes" }) static List<Field> getAllFields(final Class clazz,
			final boolean includeParent); @SuppressWarnings({ "rawtypes" }) static List<Method> getAllMethods(final Class clazz); @SuppressWarnings({ "rawtypes" }) static List<Method> getAllMethods(final Class clazz,
			final boolean includeParent); static List<MessageResponse> convertErrorMessage(
			final BindingResult bindingResult, final Locale locale,
			final MessageSource messageSource); static List<MessageResponse> buildSuccessMessage(
			final BaseEntity object, final String code, final Locale locale,
			final MessageSource messageSource); static boolean isCollection(final Object ob); static BaseEntity clone(final BaseEntity source); }
CrudUtil { public static String buildDeleteMessage(final BaseEntity obj) { final StringBuilder message = new StringBuilder( "<p class='delete-message'>Deleted "); final AuditableField pf = CacheUtil.getPrimaryField(obj); message.append(buildPrimaryField(pf, obj)).append("</p>"); return message.toString(); } private  CrudUtil(); static String buildCreateMessage(final BaseEntity obj); static List<String> getUpdatedFields(final BaseEntity oldObject,
			final BaseEntity newObject); static String convertAuditableFieldsToJson(BaseEntity obj); @SuppressWarnings({ "rawtypes", "unchecked" }) static String buildUpdateMessage(final BaseEntity oldObject,
			final BaseEntity newObject); static String buildDeleteMessage(final BaseEntity obj); static Map<String, Object> buildMapValues(final BaseEntity object); @SuppressWarnings("rawtypes") static Map<String, Object> buildMapValues(final BaseEntity object,
			final List<String> fields); static String buildURLParameters(final BaseEntity object); @SuppressWarnings("rawtypes") static String buildJpaQueryString(final BaseEntity example,
			final boolean exactMatch); @SuppressWarnings("rawtypes") static Object retrieveObjectValue(final Object obj,
			final String property); static Object retrieveNullableObjectValue(final Object obj,
			final String property); static Class<?> retrieveObjectType(final Object obj,
			final String property); static Boolean evaluateExpression(final Object obj,
			final String expression); @SuppressWarnings("unchecked") static String replaceSQLParameters(String sql, final Object obj); @SuppressWarnings({ "rawtypes" }) static List<Field> getAllFields(final Class clazz); @SuppressWarnings({ "rawtypes" }) static List<Field> getAllFields(final Class clazz,
			final boolean includeParent); @SuppressWarnings({ "rawtypes" }) static List<Method> getAllMethods(final Class clazz); @SuppressWarnings({ "rawtypes" }) static List<Method> getAllMethods(final Class clazz,
			final boolean includeParent); static List<MessageResponse> convertErrorMessage(
			final BindingResult bindingResult, final Locale locale,
			final MessageSource messageSource); static List<MessageResponse> buildSuccessMessage(
			final BaseEntity object, final String code, final Locale locale,
			final MessageSource messageSource); static boolean isCollection(final Object ob); static BaseEntity clone(final BaseEntity source);  }