Buggy code:
@ RunWith ( SpringJUnit4ClassRunner . class ) @ SpringApplicationConfiguration ( classes = Application . class ) @ WebAppConfiguration @ IntegrationTest public class RegistryIntegrationTest { private MockMvc mockMvc ; @ Inject private RegistryResource registryRessource ; @ Inject private RegistryRepository registryRepository ; @ Inject private RegistryTypeRepository registryTypeRepository ; private Registry registry1 ; private Registry registry2 ; private Registry invalidRegistry ; private RegistryType registryType ; @ Inject private RegistryTypePopulator registryTypePopulator ; @ Inject private RegistryPopulator registryPopulator ; @ Before public void setup ( ) { } @ Test public void getRegistryTest200 ( ) throws Exception { } @ Test public void getRegistryTest404 ( ) throws Exception { } @ Test public void getRegistriesTest200 ( ) throws Exception { } @ Test public void createRegistryTestPOST201 ( ) throws Exception { } @ Test public void createRegistryTestPOST400 ( ) throws Exception { } @ Test public void createRegistryTestPUT200 ( ) throws Exception { } @ Test public void createRegistryTestPUT400 ( ) throws Exception { } @ Test public void updateRegistryTest200 ( ) throws Exception { final String id = registry1 . getId ( ) ; assertThat ( registryRepository . findAll ( ) ) . hasSize ( 2 ) ; Registry updatedRegistry = new Registry ( ) ; updatedRegistry . setName ( "new<seq2seq4repair_space>name" ) ; updatedRegistry . setHost ( "new<seq2seq4repair_space>host" ) ; updatedRegistry . setPort ( 1111 ) ; updatedRegistry . setProtocol ( "http" ) ; <START_BUG> updatedRegistry . setApiVersion ( "V1" ) ; <END_BUG> updatedRegistry . setRegistryType ( registryType ) ; this . mockMvc . perform ( put ( ( "//api//registries//" + id ) ) . contentType ( APPLICATION_JSON_UTF8 ) . content ( TestUtil . convertObjectToJsonString ( updatedRegistry ) ) ) . andExpect ( status ( ) . isOk ( ) ) . andExpect ( content ( ) . contentType ( APPLICATION_JSON ) ) . andExpect ( jsonPath ( "$.id" ) . value ( id ) ) . andExpect ( jsonPath ( "$.name" ) . value ( updatedRegistry . getName ( ) ) ) . andExpect ( jsonPath ( "$.host" ) . value ( updatedRegistry . getHost ( ) ) ) . andExpect ( jsonPath ( "$.port" ) . value ( updatedRegistry . getPort ( ) ) ) . andExpect ( jsonPath ( "$.protocol" ) . value ( updatedRegistry . getProtocol ( ) ) ) . andExpect ( jsonPath ( "$.apiVersion" ) . value ( registry1 . getApiVersion ( ) ) ) . andExpect ( jsonPath ( "$.registryType.id" ) . value ( registryType . getId ( ) ) ) . andExpect ( jsonPath ( "$.registryType.name" ) . value ( registryType . getName ( ) ) ) . andExpect ( jsonPath ( "$.registryType.logo" ) . value ( registryType . getLogo ( ) ) ) . andExpect ( jsonPath ( "$.registryType.defaultHost" ) . value ( registryType . getDefaultHost ( ) ) ) . andExpect ( jsonPath ( "$.registryType.defaultPort" ) . value ( registryType . getDefaultPort ( ) ) ) . andExpect ( jsonPath ( "$.registryType.apiVersions[0]" ) . value ( registryType . getApiVersions ( ) . get ( 0 ) ) ) . andExpect ( jsonPath ( "$.registryType.public" ) . value ( registryType . isPublic ( ) ) ) ; List < Registry > registries = registryRepository . findAll ( ) ; assertThat ( registries ) . hasSize ( 2 ) ; Registry createdRegistry = registries . iterator ( ) . next ( ) ; assertThat ( createdRegistry . getName ( ) ) . isEqualTo ( updatedRegistry . getName ( ) ) ; } @ Test public void updateRegistryTest400 ( ) throws Exception { } @ Test public void deleteRegistryTest204 ( ) throws Exception { } No newline ; at end ; of file ; }

Fix:
updatedRegistry . setApiVersion ( "v1" ) ;