|
1 | 1 | /*
|
2 |
| - * Copyright 2012-2019 the original author or authors. |
| 2 | + * Copyright 2012-2020 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
@@ -61,17 +61,21 @@ void before() {
|
61 | 61 | void neo4jUp() {
|
62 | 62 | Result result = mock(Result.class);
|
63 | 63 | given(this.session.query(Neo4jHealthIndicator.CYPHER, Collections.emptyMap())).willReturn(result);
|
64 |
| - int nodeCount = 500; |
65 | 64 | Map<String, Object> expectedCypherDetails = new HashMap<>();
|
66 |
| - expectedCypherDetails.put("nodes", nodeCount); |
| 65 | + String edition = "community"; |
| 66 | + String version = "4.0.0"; |
| 67 | + expectedCypherDetails.put("edition", edition); |
| 68 | + expectedCypherDetails.put("version", version); |
67 | 69 | List<Map<String, Object>> queryResults = new ArrayList<>();
|
68 | 70 | queryResults.add(expectedCypherDetails);
|
69 | 71 | given(result.queryResults()).willReturn(queryResults);
|
70 | 72 | Health health = this.neo4jHealthIndicator.health();
|
71 | 73 | assertThat(health.getStatus()).isEqualTo(Status.UP);
|
72 | 74 | Map<String, Object> details = health.getDetails();
|
73 |
| - int nodeCountFromDetails = (int) details.get("nodes"); |
74 |
| - assertThat(nodeCountFromDetails).isEqualTo(nodeCount); |
| 75 | + String editionFromDetails = details.get("edition").toString(); |
| 76 | + String versionFromDetails = details.get("version").toString(); |
| 77 | + assertThat(editionFromDetails).isEqualTo(edition); |
| 78 | + assertThat(versionFromDetails).isEqualTo(version); |
75 | 79 | }
|
76 | 80 |
|
77 | 81 | @Test
|
|
0 commit comments