@Override
    @NonNull
    public IndexEntry getIndexEntry(String name) {
        readLock.lock();
        try {
            var indexDescriptor = findIndexByName(name);
            if (indexDescriptor == null) {
                throw new IllegalArgumentException(
                    "No index found for fieldPath [" + name + "], "
                        + "make sure you have created an index for this field.");
            }
            if (!indexDescriptor.isReady()) {
                throw new IllegalStateException(
                    "Index [" + name + "] is not ready, "
                        + "Please wait for more time or check the index status.");
            }
            return indexEntries.get(indexDescriptor);
        } finally {
            readLock.unlock();
        }
    }
@Test
    void getIndexEntryTest() {
        var spec = getNameIndexSpec();
        var descriptor = new IndexDescriptor(spec);
        descriptor.setReady(true);
        var indexContainer = new IndexEntryContainer();
        indexContainer.add(new IndexEntryImpl(descriptor));

        var defaultIndexer = new DefaultIndexer(List.of(descriptor), indexContainer);
        assertThatThrownBy(() -> defaultIndexer.getIndexEntry("not-exist"))
            .isInstanceOf(IllegalArgumentException.class)
            .hasMessage("No index found for fieldPath [not-exist], "
                + "make sure you have created an index for this field.");

        assertThat(defaultIndexer.getIndexEntry("metadata.name")).isNotNull();
    }