Skip to content

Commit

Permalink
modifty kout request param order (#112)
Browse files Browse the repository at this point in the history
  • Loading branch information
shzcore committed Dec 15, 2020
1 parent d38fd7c commit c0fc36d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
Expand Up @@ -43,7 +43,7 @@ protected String type() {

public List<Object> get(Object sourceId, Direction direction,
String label, int depth, boolean nearest,
long degree, long limit, long capacity) {
long degree, long capacity, long limit) {
String source = GraphAPI.formatVertexId(sourceId, false);

checkPositive(depth, "Depth of k-out");
Expand Down
17 changes: 15 additions & 2 deletions src/test/java/com/baidu/hugegraph/api/traverser/KoutApiTest.java
Expand Up @@ -110,14 +110,27 @@ public void testKoutGetBothAllWithCapacity() {

Assert.assertThrows(ServerException.class, () -> {
koutAPI.get(markoId, Direction.BOTH, null,
2, false, -1L, -1L, 1L);
2, false, -1L, 1L, 2L);
}, e -> {
String expect = "Capacity can't be less than limit, " +
"but got capacity '1' and limit '-1'";
"but got capacity '1' and limit '2'";
Assert.assertContains(expect, e.getMessage());
});
}

@Test
public void testKoutGetBothAllWithCapacityNoLimit() {
Object markoId = getVertexId("person", "name", "marko");

Assert.assertThrows(ServerException.class, () -> {
koutAPI.get(markoId, Direction.BOTH, null,
2, false, -1L, 1L, -1L);
}, e -> {
String expect = "Capacity can't be less than limit, " +
"but got capacity '1' and limit '-1'";
Assert.assertContains(expect, e.getMessage());
});
}

@Test
public void testKoutPost() {
Expand Down

0 comments on commit c0fc36d

Please sign in to comment.