Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ internal class ITInfluxDBClientKotlin : AbstractITInfluxDBClientKotlin() {

val health = influxDBClient.health()

val healthMessages = arrayOf("ready for queries and writes","healthy")
Assertions.assertThat(health).isNotNull
Assertions.assertThat(health.status).isEqualTo(HealthCheck.StatusEnum.PASS)
Assertions.assertThat(health.message).isEqualTo("ready for queries and writes")
Assertions.assertThat(healthMessages).contains(health.message)
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ void writeClient() {
void health() {

Publisher<HealthCheck> check = influxDBClient.health();
String[] healthMessages = new String[]{"ready for queries and writes","healthy"};

Single.fromPublisher(check)
.test()
Expand All @@ -58,7 +59,7 @@ void health() {

Assertions.assertThat(it).isNotNull();
Assertions.assertThat(it.getStatus()).isEqualTo(HealthCheck.StatusEnum.PASS);
Assertions.assertThat(it.getMessage()).isEqualTo("ready for queries and writes");
Assertions.assertThat(healthMessages).contains(it.getMessage());

return true;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,10 @@ class ITInfluxDBClientScala extends AbstractITQueryScalaApi with Matchers {

val health = influxDBClient.health

val healthReplies = Array("ready for queries and writes", "healthy")
health should not be null
health.getStatus should be(HealthCheck.StatusEnum.PASS)
health.getMessage should be("ready for queries and writes")
healthReplies should contain(health.getMessage)
}

test("health not running") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,12 @@ void health() {

HealthCheck check = influxDBClient.health();

String[] healthResponses = new String[]{"ready for queries and writes", "healthy"};

Assertions.assertThat(check).isNotNull();
Assertions.assertThat(check.getName()).isEqualTo("influxdb");
Assertions.assertThat(check.getStatus()).isEqualTo(HealthCheck.StatusEnum.PASS);
Assertions.assertThat(check.getMessage()).isEqualTo("ready for queries and writes");
Assertions.assertThat(healthResponses).contains(check.getMessage());
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,18 +105,19 @@ void findScrapers() {
@Test
void findScrapersByOrganization() {


Organization org = influxDBClient.getOrganizationsApi().createOrganization(generateName("org"));
Bucket buck = influxDBClient.getBucketsApi().createBucket("scaper-bucket", org.getId());

List<ScraperTargetResponse> scraperTargets = scraperTargetsApi.findScraperTargetsByOrg(org);
Assertions.assertThat(scraperTargets).hasSize(0);

scraperTargetsApi.createScraperTarget(generateName("InfluxDB scraper"),
"http://localhost:9999", bucket.getId(), org.getId());
"http://localhost:9999", buck.getId(), org.getId());

scraperTargets = scraperTargetsApi.findScraperTargetsByOrg(org);
Assertions.assertThat(scraperTargets).hasSize(1);

influxDBClient.getBucketsApi().deleteBucket(buck.getId());
influxDBClient.getOrganizationsApi().deleteOrganization(org);
scraperTargetsApi.deleteScraperTarget(scraperTargets.get(0));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ void queryDataFromNewOrganization() {

PermissionResource orgResource = new PermissionResource();
orgResource.setId(organization.getId());
orgResource.setOrgID(organization.getId());
// N.B. organization permission requests can no longer (v2.10+) handle orgID
// orgResource.setOrgID(organization.getId());
orgResource.setType(PermissionResource.TYPE_ORGS);

Permission readOrganization = new Permission();
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@
<junit-jupiter.version>6.1.1</junit-jupiter.version>
<kotlin-coroutines.version>1.11.0</kotlin-coroutines.version>
<mockito.version>5.0.0</mockito.version>
<karaf.version>4.4.11</karaf.version>
</properties>

<dependencies>
Expand Down
Loading