@Override
  public Optional<HouseTable> findById(HouseTablePrimaryKey houseTablePrimaryKey) {

    return getHtsRetryTemplate(
            Arrays.asList(
                HouseTableRepositoryStateUnkownException.class, IllegalStateException.class))
        .execute(
            context ->
                apiInstance
                    .getUserTable(
                        houseTablePrimaryKey.getDatabaseId(), houseTablePrimaryKey.getTableId())
                    .map(EntityResponseBodyUserTable::getEntity)
                    .map(houseTableMapper::toHouseTable)
                    .switchIfEmpty(Mono.empty())
                    .onErrorResume(this::handleHtsHttpError)
                    .blockOptional(Duration.ofSeconds(REQUEST_TIMEOUT_SECONDS)));
  }
@Test
  public void testRepoFindById() {
    EntityResponseBodyUserTable response = new EntityResponseBodyUserTable();
    response.entity(houseTableMapper.toUserTable(HOUSE_TABLE));
    mockHtsServer.enqueue(
        new MockResponse()
            .setResponseCode(200)
            .setBody((new Gson()).toJson(response))
            .addHeader("Content-Type", "application/json"));

    HouseTable result =
        htsRepo
            .findById(
                HouseTablePrimaryKey.builder()
                    .tableId(HOUSE_TABLE.getTableId())
                    .databaseId(HOUSE_TABLE.getDatabaseId())
                    .build())
            .get();

    Assertions.assertEquals(result.getTableId(), HOUSE_TABLE.getTableId());
    Assertions.assertEquals(result.getDatabaseId(), HOUSE_TABLE.getDatabaseId());
    Assertions.assertEquals(result.getTableLocation(), HOUSE_TABLE.getTableLocation());
    Assertions.assertEquals(result.getTableVersion(), HOUSE_TABLE.getTableVersion());
  }