Skip to content

Commit

Permalink
Add util test
Browse files Browse the repository at this point in the history
  • Loading branch information
Jotschi committed Feb 2, 2023
1 parent 03f9b51 commit 6f90531
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.metaloom.qdrant.client.grpc;
package io.metaloom.qdrant.client.util;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
import org.junit.Test;

import io.metaloom.qdrant.client.AbstractContainerTest;
import io.metaloom.qdrant.client.grpc.ModelHelper;
import io.metaloom.qdrant.client.grpc.QDrantGRPCClient;
import io.metaloom.qdrant.client.grpc.proto.Collections.Distance;
import io.metaloom.qdrant.client.grpc.proto.Collections.VectorParams;
import io.metaloom.qdrant.client.grpc.proto.JsonWithInt.Value;
import io.metaloom.qdrant.client.grpc.proto.Points.PointStruct;
import io.metaloom.qdrant.client.grpc.proto.Points.ScoredPoint;
import io.metaloom.qdrant.client.util.ModelHelper;

public class BasicUsageExampleTest extends AbstractContainerTest {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package io.metaloom.qdrant.client.grpc.method;

import static io.metaloom.qdrant.client.grpc.ModelHelper.point;
import static io.metaloom.qdrant.client.grpc.ModelHelper.pointId;
import static io.metaloom.qdrant.client.grpc.ModelHelper.pointIds;
import static io.metaloom.qdrant.client.grpc.ModelHelper.value;
import static io.metaloom.qdrant.client.grpc.ModelHelper.withPayload;
import static io.metaloom.qdrant.client.grpc.ModelHelper.withVector;
import static io.metaloom.qdrant.client.util.ModelHelper.point;
import static io.metaloom.qdrant.client.util.ModelHelper.pointId;
import static io.metaloom.qdrant.client.util.ModelHelper.pointIds;
import static io.metaloom.qdrant.client.util.ModelHelper.value;
import static io.metaloom.qdrant.client.util.ModelHelper.withPayload;
import static io.metaloom.qdrant.client.util.ModelHelper.withVector;
import static io.metaloom.qdrant.client.util.VectorUtil.toList;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
Expand All @@ -25,7 +25,6 @@
import org.testcontainers.shaded.com.google.common.collect.Sets;

import io.metaloom.qdrant.client.grpc.AbstractGRPCClientTest;
import io.metaloom.qdrant.client.grpc.ModelHelper;
import io.metaloom.qdrant.client.grpc.proto.JsonWithInt.Value;
import io.metaloom.qdrant.client.grpc.proto.Points.GetResponse;
import io.metaloom.qdrant.client.grpc.proto.Points.PointStruct;
Expand All @@ -43,6 +42,7 @@
import io.metaloom.qdrant.client.grpc.proto.Points.Vector;
import io.metaloom.qdrant.client.grpc.proto.Points.Vectors;
import io.metaloom.qdrant.client.testcases.PointClientTestcases;
import io.metaloom.qdrant.client.util.ModelHelper;

public class PointGRPCClientTest extends AbstractGRPCClientTest implements PointClientTestcases {

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package io.metaloom.qdrant.client.util;

import static org.junit.Assert.assertEquals;

import java.util.UUID;

import org.junit.Test;

public class ModelHelperTest {

@Test
public void testToPointId() {
UUID uuid = UUID.randomUUID();
assertEquals(uuid.toString(), ModelHelper.pointId(uuid).getUuid());
assertEquals(uuid.toString(), ModelHelper.pointId(uuid.toString()).getUuid());
}
}

0 comments on commit 6f90531

Please sign in to comment.