Skip to content

RemoteSchemaTest.getOrCreateVertexTypeWithPageSizeThrowsUnsupported tests buildVertexType(), not getOrCreateVertexType() #7659

Closed

Description

@robfrank

Summary

RemoteSchemaTest.getOrCreateVertexTypeWithPageSizeThrowsUnsupported never calls getOrCreateVertexType. It exercises buildVertexType(), which throws on the first call in the chain, so every builder call after it is dead code and the method the test is named for is never reached.

// network/src/test/java/com/arcadedb/remote/RemoteSchemaTest.java:149
@Test
void getOrCreateVertexTypeWithPageSizeThrowsUnsupported() {
  assertThatThrownBy(() ->
      schema.buildVertexType().withName("Type").withTotalBuckets(1).withIgnoreIfExists(true).withPageSize(100).create())
      .isInstanceOf(UnsupportedOperationException.class);
}

buildVertexType() throws immediately (RemoteSchema.java:431), so .withName(...), .withTotalBuckets(1), .withIgnoreIfExists(true), .withPageSize(100) and .create() never execute.

Consequence: a real coverage hole

The 3-argument overload the test is named for has no test:

// network/src/main/java/com/arcadedb/remote/RemoteSchema.java:494
@Deprecated
@Override
public VertexType getOrCreateVertexType(String typeName, int buckets, int pageSize) {
  throw new UnsupportedOperationException();
}
$ grep -n "getOrCreateVertexType" network/src/test/java/com/arcadedb/remote/RemoteSchemaTest.java
150:  void getOrCreateVertexTypeWithPageSizeThrowsUnsupported() {   <- does not call it
576:  void getOrCreateVertexTypeReturnsExistingTypeWhenServerAnswersNoRows() {
582:    final VertexType type = schema.getOrCreateVertexType("Person");
602:  void getOrCreateVertexTypeStillThrowsWhenTypeIsMissingAfterTheCommand() {
610:    assertThatThrownBy(() -> schema.getOrCreateVertexType("Person")).isInstanceOf(SchemaException.class);
614:  void getOrCreateVertexTypeReportsTheKindMismatchInsteadOfCastingBlindly() {
622:    assertThatThrownBy(() -> schema.getOrCreateVertexType("Person"))

Lines 576-622 all cover the 1-argument getOrCreateVertexType(String), which is a different, implemented overload. Nothing covers the 3-argument one.

The document-type counterpart is written correctly and shows the intended shape:

// RemoteSchemaTest.java:117
@Test
void getOrCreateDocumentTypeWithPageSizeThrowsUnsupported() {
  assertThatThrownBy(() -> schema.getOrCreateDocumentType("Type", 1, 100))
      .isInstanceOf(UnsupportedOperationException.class);
}

Fix

Point the test at the method it is named for:

assertThatThrownBy(() -> schema.getOrCreateVertexType("Type", 1, 100))
    .isInstanceOf(UnsupportedOperationException.class);

The test passes both before and after, so this is a coverage correction rather than a bug fix. It is worth doing because the current test's green is not evidence about getOrCreateVertexType at all.

Context

Found during review of #7656 (which closes #7335). Not fixed there because that PR's workflow forbids modifying existing tests, and the mislabeling is unrelated to #7335's scope. #7656 does not change this test's outcome: buildVertexType() still throws UnsupportedOperationException, only now with a message.

Related: #7654 (the remaining bare UnsupportedOperationException throws in the remote client package, whose verification section has the same "assert the message, not just the type" theme).

Activity

  1. added
    network
    on Sep 16, 2026
  2. added this to the 26.10.1 milestone on Sep 16, 2026
  3. added
    in progress
    on Sep 17, 2026
  4. self-assigned this
    on Sep 17, 2026
  5. added 2 commits that reference this issue on Sep 18, 2026
  6. lvca commented on Sep 18, 2026

    @lvca
    Member

    Fixed in #7850 (26.10.1).

    A test-only correction: the test named for the 3-argument getOrCreateVertexType never called it, so that method had no coverage. It does now. No behaviour change.


    ❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.

  7. removed
    in progress
    on Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugnetwork

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions