Skip to content

Commit

Permalink
Fixed Tests. Added getNamedWriteableRegistry() API for extensions ope…
Browse files Browse the repository at this point in the history
…nsearch-project#291

Signed-off-by: Aisara Imangaliyeva <imangaliyeva.aisara@gmail.com>
  • Loading branch information
Aisara Imangaliyeva committed Mar 25, 2023
1 parent cbfdbd8 commit 4f290b1
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public void writeTo(StreamOutput out) throws IOException {}
private static class Example implements NamedWriteable {
public static final String NAME = "Example";
public static final NamedWriteableRegistry.Entry WRITEABLE_REGISTRY = new NamedWriteableRegistry.Entry(
NamedWriteable.class,
NAME,
DummyNamedWriteable::new
NamedWriteable.class,
NAME,
DummyNamedWriteable::new
);

private final String name;
Expand Down Expand Up @@ -95,7 +95,7 @@ public void testDefaultNamedWriteableRegistry() throws IOException {
NamedWriteableRegistry registry = runner.sdkNamedWriteableRegistry.getRegistry();

IllegalArgumentException ex = assertThrows(
IllegalArgumentException.class,
IllegalArgumentException.class,
() -> registry.getReader(TestSDKNamedWriteableRegistry.Example.class, TestSDKNamedWriteableRegistry.Example.NAME)
);
assertEquals("Unknown NamedWriteable category [" + TestSDKNamedWriteableRegistry.Example.class.getName() + "]", ex.getMessage());
Expand Down

0 comments on commit 4f290b1

Please sign in to comment.