@Test
public void should_update_case_form_if_exist() throws Exception {

    CaseForm caseForm = mock(CaseForm.class);
    when(caseForm.getModuleId()).thenReturn("primeromodule-cp");
    Blob formBlob = mock(Blob.class);
    when(caseForm.getForm()).thenReturn(formBlob);
    when(caseFormDao.getCaseForm("primeromodule-cp", PrimeroAppConfiguration.getApiBaseUrl())).thenReturn(caseForm);
    caseFormService.saveOrUpdate(caseForm);
    verify(caseForm, times(1)).setForm(formBlob);
    verify(caseForm, times(1)).update();
}