@Test
public void testApplyFetchUserOriginWithUpdate() {

  Subject userSubject = Subject.builder()
          .setId(userOrigin.getId())
          .setName("updatedName")
          .setOrganization(Organization.builder().setId(UUID.randomUUID()).build().toInfo())
          .build();
  when(originManager.getOrigin(userOrigin.getId())).thenReturn(userOrigin);
  when(subjectResolver.resolveSubject(userOrigin.getId())).thenReturn(userSubject);
  resolver.apply(userOrigin.getId());
  verify(originManager).saveOrigin(argThat(entity -> {
    assertEquals(userSubject.getName(), entity.getName());
    assertEquals(userSubject.getOrganization().getId(), entity.getOrganizationID());
    return true;
  }));
}