Buggy code:
public class USSDHomeControllerTest extends USSDAbstractUnitTest { private static final Logger log = LoggerFactory . getLogger ( USSDHomeControllerTest . class ) ; private static final String phoneForTests = "27810001111" ; private static final String baseForOthers = "2781000111" ; private static final String testUserName = "Test<seq2seq4repair_space>User" ; private static final String testGroupName = "Test<seq2seq4repair_space>Group" ; private static final String openingMenu = "//ussd//start" ; private static final String phoneParameter = "msisdn" ; private User testUser = new User ( USSDHomeControllerTest . phoneForTests , USSDHomeControllerTest . testUserName ) ; private User testUserZu = new User ( ( ( USSDHomeControllerTest . baseForOthers ) + "2" ) ) ; private User testUserTs = new User ( ( ( USSDHomeControllerTest . baseForOthers ) + "3" ) ) ; private User testUserNso = new User ( ( ( USSDHomeControllerTest . baseForOthers ) + "4" ) ) ; private User testUserSt = new User ( ( ( USSDHomeControllerTest . baseForOthers ) + "5" ) ) ; private List < User > languageUsers ; @ InjectMocks private USSDHomeController ussdHomeController ; @ Before public void setUp ( ) { } @ Test public void testQuestion ( ) throws Exception { } @ Test @ Rollback public void welcomeMenuShouldWork ( ) throws Exception { } @ Test public void welcomeMenuAfterChoosingLanguageShouldWork ( ) throws Exception { } @ Test public void welcomeMenuLocaleShouldWorkWithNoName ( ) throws Exception { } @ Test public void forcedStartMenuShouldWork ( ) throws Exception { } @ Test public void groupJoinTokenShouldWorkInAllLanguages ( ) throws Exception { } @ Test public void voteRequestScreenShouldWorkInAllLanguages ( ) throws Exception { } @ Test public void meetingRsvpShouldWorkInAllLanguages ( ) throws Exception { } @ Test public void groupRenameShouldWork ( ) throws Exception { resetTestUser ( ) ; testUser . setHasInitiatedSession ( true ) ; Group testGroup = new Group ( "" , testUser ) ; testGroup . setId ( 0L ) ; testGroup . setCreatedDateTime ( Timestamp . valueOf ( LocalDateTime . now ( ) ) ) ; when ( userManagementServiceMock . loadOrSaveUser ( USSDHomeControllerTest . phoneForTests ) ) . thenReturn ( testUser ) ; when ( userManagementServiceMock . findByInputNumber ( USSDHomeControllerTest . phoneForTests ) ) . thenReturn ( testUser ) ; when ( userManagementServiceMock . fetchGroupUserMustRename ( testUser ) ) . thenReturn ( testGroup ) ; mockMvc . perform ( get ( USSDHomeControllerTest . openingMenu ) . param ( USSDHomeControllerTest . phoneParameter , testUser . getPhoneNumber ( ) ) ) . andExpect ( status ( ) . isOk ( ) ) ; <START_BUG> mockMvc . perform ( get ( "//ussd//testGroup-start" ) . param ( USSDHomeControllerTest . phoneParameter , USSDHomeControllerTest . phoneForTests ) . param ( "groupUid" , ( "" + ( testGroup . getUid ( ) ) ) ) . param ( "request" , USSDHomeControllerTest . testGroupName ) ) . andExpect ( status ( ) . isOk ( ) ) ; <END_BUG> verify ( userManagementServiceMock , times ( 1 ) ) . loadOrSaveUser ( USSDHomeControllerTest . phoneForTests ) ; verify ( userManagementServiceMock , times ( 1 ) ) . findByInputNumber ( USSDHomeControllerTest . phoneForTests ) ; verify ( groupBrokerMock , times ( 1 ) ) . updateName ( testUser . getUid ( ) , testGroup . getUid ( ) , USSDHomeControllerTest . testGroupName ) ; verify ( userManagementServiceMock , times ( 3 ) ) . fetchGroupUserMustRename ( testUser ) ; } @ Test public void userRenamePromptShouldWork ( ) throws Exception { } @ Test public void groupSecondPageShouldWork ( ) throws Exception { } @ Test public void errorPagesShouldBeWellFormed ( ) throws Exception { } private void resetTestUser ( ) { } }

Fix:
mockMvc . perform ( get ( "//ussd//group-start" ) . param ( USSDHomeControllerTest . phoneParameter , USSDHomeControllerTest . phoneForTests ) . param ( "groupUid" , ( "" + ( testGroup . getUid ( ) ) ) ) . param ( "request" , USSDHomeControllerTest . testGroupName ) ) . andExpect ( status ( ) . isOk ( ) ) ;