Buggy code:
public class ConfigurableSettingsTabTest extends AbstractVireoFunctionalTest { public static SecurityContext context = Spring . getBeanOfType ( SecurityContext . class ) ; public static PersonRepository personRepo = Spring . getBeanOfType ( PersonRepository . class ) ; public static SettingsRepository settingRepo = Spring . getBeanOfType ( SettingsRepository . class ) ; @ Before public void setup ( ) { } @ After public void cleanup ( ) { } @ Test public void testDisplayOfConfigurableSettingsTab ( ) { } @ Test public void testBulkAdd ( ) { } @ Test public void testAddingEditingDeletingEmbargoTypes ( ) { LOGIN ( ) ; final String EDIT_URL = Router . reverse ( "settings.ConfigurableSettingsTab.editEmbargoTypeJSON" ) . url ; final String REMOVE_URL = Router . reverse ( "settings.ConfigurableSettingsTab.removeEmbargoTypeJSON" ) . url ; Map < String , String > params = new HashMap < String , String > ( ) ; params . put ( "name" , "New<seq2seq4repair_space>Embargo<seq2seq4repair_space>Type" ) ; params . put ( "description" , "New<seq2seq4repair_space>Description" ) ; params . put ( "months" , "4" ) ; params . put ( "active" , "true" ) ; params . put ( "guarantor" , "DEFAULT" ) ; Response response = POST ( EDIT_URL , params ) ; assertContentMatch ( "\"success\":<seq2seq4repair_space>\"true\"" , response ) ; Pattern ID_PATTERN = Pattern . compile ( "\"id\":<seq2seq4repair_space>([0-9]+),<seq2seq4repair_space>" ) ; Matcher tokenMatcher = ID_PATTERN . matcher ( getContent ( response ) ) ; assertTrue ( tokenMatcher . find ( ) ) ; String idString = tokenMatcher . group ( 1 ) ; assertNotNull ( idString ) ; Long id = Long . valueOf ( idString ) ; JPA . em ( ) . getTransaction ( ) . commit ( ) ; JPA . em ( ) . clear ( ) ; JPA . em ( ) . getTransaction ( ) . begin ( ) ; assertNotNull ( ConfigurableSettingsTabTest . settingRepo . findEmbargoType ( id ) ) ; assertEquals ( "New<seq2seq4repair_space>Embargo<seq2seq4repair_space>Type" , ConfigurableSettingsTabTest . settingRepo . findEmbargoType ( id ) . getName ( ) ) ; assertEquals ( "New<seq2seq4repair_space>Description" , ConfigurableSettingsTabTest . settingRepo . findEmbargoType ( id ) . getDescription ( ) ) ; assertEquals ( new Integer ( 4 ) , ConfigurableSettingsTabTest . settingRepo . findEmbargoType ( id ) . getDuration ( ) ) ; assertEquals ( true , ConfigurableSettingsTabTest . settingRepo . findEmbargoType ( id ) . isActive ( ) ) ; params . clear ( ) ; params . put ( "embargoTypeId" , String . valueOf ( id ) ) ; params . put ( "name" , "Changed<seq2seq4repair_space>Name" ) ; params . put ( "description" , "Changed<seq2seq4repair_space>Description" ) ; params . put ( "guarantor" , "DEFAULT" ) ; response = POST ( EDIT_URL , params ) ; assertContentMatch ( "\"success\":<seq2seq4repair_space>\"true\"" , response ) ; JPA . em ( ) . getTransaction ( ) . commit ( ) ; JPA . em ( ) . clear ( ) ; JPA . em ( ) . getTransaction ( ) . begin ( ) ; assertEquals ( "Changed<seq2seq4repair_space>Name" , ConfigurableSettingsTabTest . settingRepo . findEmbargoType ( id ) . getName ( ) ) ; assertEquals ( "Changed<seq2seq4repair_space>Description" , ConfigurableSettingsTabTest . settingRepo . findEmbargoType ( id ) . getDescription ( ) ) ; assertEquals ( null , ConfigurableSettingsTabTest . settingRepo . findEmbargoType ( id ) . getDuration ( ) ) ; assertEquals ( false , ConfigurableSettingsTabTest . settingRepo . findEmbargoType ( id ) . isActive ( ) ) ; params . clear ( ) ; <START_BUG> params . put ( "embargoTypeId" , ( "embargoType_" + id ) ) ; <END_BUG> response = POST ( REMOVE_URL , params ) ; assertContentMatch ( "\"success\":<seq2seq4repair_space>\"true\"" , response ) ; JPA . em ( ) . getTransaction ( ) . commit ( ) ; JPA . em ( ) . clear ( ) ; JPA . em ( ) . getTransaction ( ) . begin ( ) ; assertNull ( ConfigurableSettingsTabTest . settingRepo . findEmbargoType ( id ) ) ; } @ Test public void testReorderingEmbargoTypes ( ) { } @ Test public void testAlphabetizingEmbargoTypes ( ) { } @ Test public void testAddingEditingRemovingPrograms ( ) { } @ Test public void testReorderingProgram ( ) { } @ Test public void testAlphabetizingPrograms ( ) { } @ Test public void testAddingEditingRemovingColleges ( ) { } @ Test public void testReorderingColleges ( ) { } @ Test public void testAlphabetizingColleges ( ) { } @ Test public void testAddingEditingRemovingDepartments ( ) { } @ Test public void testReorderingDepartments ( ) { } @ Test public void testAlphabetizingDepartments ( ) { } @ Test public void testAddingEditingRemovingMajors ( ) { } @ Test public void testReorderingMajors ( ) { } @ Test public void testAlphabetizingMajors ( ) { } @ Test public void testAddingEditingRemovingDegrees ( ) { } @ Test public void testReorderingDegrees ( ) { } @ Test public void testAlphabetizingDegrees ( ) { } @ Test public void testAddingEditingRemovingDocumentTypes ( ) { } @ Test public void testReorderingDocumentTypes ( ) { } @ Test public void testAlphabetizingDocumentTypes ( ) { } @ Test public void testAddingEditingRemovingCommitteeMemberRoleTypes ( ) { } @ Test public void testReorderingCommitteeMemberRoleTypes ( ) { } @ Test public void testAlphabetizingCommitteeMemberRoleTypes ( ) { } @ Test public void testAddingEditingRemovingGraduationMonths ( ) { } @ Test public void testReorderingGraduationMonths ( ) { } @ Test public void testAlphabetizingGraduationMonths ( ) { } @ Test public void testAddingEditingRemovingLanguage ( ) { } @ Test public void testReorderingLanguage ( ) { } @ Test public void testAlphabetizingLanguages ( ) { } }

Fix:
params . put ( "embargoTypeId" , String . valueOf ( id ) ) ;