Skip to content

Commit e2ee6a9

Browse files
author
Mark
committed
fixed GraphEntity for ArangoDatabase.getGraphs() (field name is null)
1 parent 1603365 commit e2ee6a9

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

ChangeLog

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
v4.1.2 (2016-11-xx)
2+
---------------------------
3+
* fixed GraphEntity for ArangoDatabase.getGraphs() (field name is null)
4+
15
v4.1.1 (2016-11-09)
26
---------------------------
37
* changed json parsing of VelocyPack types not known in json

src/main/java/com/arangodb/entity/GraphEntity.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,18 @@
3030
public class GraphEntity {
3131

3232
private String name;
33+
/**
34+
* Special case where <code>_key</code> is used instead of <code>name</code>.
35+
*/
36+
private String _key;
3337
private Collection<EdgeDefinition> edgeDefinitions;
3438
private Collection<String> orphanCollections;
3539
private Boolean isSmart;
3640
private Integer numberOfShards;
3741
private String smartGraphAttribute;
3842

3943
public String getName() {
40-
return name;
44+
return name != null ? name : _key;
4145
}
4246

4347
public Collection<EdgeDefinition> getEdgeDefinitions() {

src/test/java/com/arangodb/ArangoDatabaseTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -691,6 +691,7 @@ public void getGraphs() {
691691
final Collection<GraphEntity> graphs = db.getGraphs();
692692
assertThat(graphs, is(notNullValue()));
693693
assertThat(graphs.size(), is(1));
694+
assertThat(graphs.iterator().next().getName(), is(GRAPH_NAME));
694695
} finally {
695696
db.graph(GRAPH_NAME).drop();
696697
}

src/test/java/com/arangodb/ArangoGraphTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ public void getGraphs() {
9595
final Collection<GraphEntity> graphs = db.getGraphs();
9696
assertThat(graphs, is(notNullValue()));
9797
assertThat(graphs.size(), is(1));
98+
assertThat(graphs.iterator().next().getName(), is(GRAPH_NAME));
9899
}
99100

100101
@Test

0 commit comments

Comments
 (0)