Skip to content

Commit

Permalink
weaviategh-175: update tests for client schema to cover class exists …
Browse files Browse the repository at this point in the history
…method
  • Loading branch information
HeliosX7 committed Apr 10, 2023
1 parent 03060fe commit 1ea2774
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import static org.assertj.core.api.InstanceOfAssertFactories.MAP;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertTrue;
Expand Down Expand Up @@ -760,15 +761,14 @@ public void testSchemaGetShards() {
.build();
// when
Result<Boolean> createStatus = client.schema().classCreator().withClass(clazz).run();
Result<WeaviateClass> bandClass = client.schema().classGetter().withClassName(clazz.getClassName()).run();

Result<Boolean> bandClassStatus = client.schema().exists().withClassName(clazz.getClassName()).run();
Result<Boolean> nonExistentClassStatus = client.schema().exists().withClassName("nonExistentClass").run();
// then
assertNotNull(createStatus);
assertTrue(createStatus.getResult());
assertNotNull(bandClass);
assertNotNull(bandClass.getResult());
assertNull(bandClass.getError());

assertResultTrue(createStatus);
assertResultTrue(bandClassStatus);
assertNotNull(nonExistentClassStatus);
assertFalse(nonExistentClassStatus.getResult());
assertNull(nonExistentClassStatus.getError());
Result<Shard[]> shards = client.schema().shardsGetter()
.withClassName(clazz.getClassName()).run();
assertNotNull(shards);
Expand Down

0 comments on commit 1ea2774

Please sign in to comment.