public GroupInformation createGroup(DbSession dbSession, String name, @Nullable String description) {
    validateGroupName(name);
    checkNameDoesNotExist(dbSession, name);

    GroupDto group = new GroupDto()
      .setUuid(uuidFactory.create())
      .setName(name)
      .setDescription(description);
    return groupDtoToGroupInformation(dbClient.groupDao().insert(dbSession, group), dbSession);
  }
@Test
  public void createGroup_whenGroupExist_throws() {
    GroupDto group = mockGroupDto();

    when(dbClient.groupDao().selectByName(dbSession, GROUP_NAME)).thenReturn(Optional.of(group));

    assertThatExceptionOfType(BadRequestException.class)
      .isThrownBy(() -> groupService.createGroup(dbSession, GROUP_NAME, "New Description"))
      .withMessage("Group '" + GROUP_NAME + "' already exists");

  }