@Test
public void testCreateOriginWithDefaultFields() throws Exception {

  CreateOriginRequest request = new CreateOriginRequest()
          .setName("name");
  when(originManager.saveOrigin(notNull())).thenReturn(new OriginEntity());
  delegate.handle(request);
  verify(securityContext).checkPermission(TiFunctionConstants.addThreatIntelOrigin);
  verify(originResponseConverter).apply(notNull());
  verify(originManager).saveOrigin(argThat(entity -> {
    assertNotNull(entity.getId());
    assertNotNull(entity.getNamespaceID());
    assertNull(entity.getOrganizationID());
    assertNull(entity.getDescription());
    assertEquals(request.getName(), entity.getName());
    assertEquals(0.8f, entity.getTrust(), 0.0);
    assertEquals(OriginEntity.Type.Group, entity.getType());
    return true;
  }));
}