@Transactional
  @ApolloAuditLog(type = OpType.CREATE, name = "App.create")
  public App createAppAndAddRolePermission(
      App app, Set<String> admins
  ) {
    App createdApp = this.createAppInLocal(app);

    publisher.publishEvent(new AppCreationEvent(createdApp));

    if (!CollectionUtils.isEmpty(admins)) {
      rolePermissionService
          .assignRoleToUsers(RoleUtils.buildAppMasterRoleName(createdApp.getAppId()),
              admins, userInfoHolder.getUser().getUserId());
    }

    return createdApp;
  }
@Test
  void createAppAndAddRolePermissionButOwnerNotExists() {
    Mockito.when(userService.findByUserId(Mockito.any()))
        .thenReturn(null);
    assertThrows(
        BadRequestException.class,
        () -> appService.createAppAndAddRolePermission(new App(), Collections.emptySet())
    );
  }