@Test
public void testSaveWithCodeAutoGenerate() {

    Mockito.when(appRepository.findByClientId(Mockito.anyString())).thenReturn(null);
    Mockito.when(appRepository.findByClientId("0q9w8e7r6t")).thenReturn(app1);
    Mockito.when(appRepository.save(Mockito.any(App.class))).thenReturn(app);
    Mockito.when(devRepository.findOne(Mockito.anyLong())).thenReturn(developer);
    App saved = this.appService.save(appPersist);
    assertEquals(app.getId(), saved.getId());
}