Skip to content

Commit bef9d26

Browse files
authored
Merge pull request #79 from dwasinge/status
Updates to Status Subsystems
2 parents 9b651a7 + bc6dce2 commit bef9d26

File tree

3 files changed

+28
-17
lines changed

3 files changed

+28
-17
lines changed

src/main/java/com/redhat/labs/omp/models/Subsystem.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package com.redhat.labs.omp.models;
22

33
import java.util.List;
4+
import java.util.Map;
45

56
import lombok.AllArgsConstructor;
67
import lombok.Builder;
@@ -18,8 +19,7 @@ public class Subsystem {
1819
private String state;
1920
private String info;
2021
private String updated;
21-
private String webConsole;
22-
private String api;
2322
private List<Message> messages;
23+
private List<Map<String, Object>> accessUrls;
2424

2525
}

src/test/java/com/redhat/labs/omp/resource/EngagementResourceTest.java

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,11 @@ void testGetAllEngagementsSuccess() {
2727
+ "\"description\":\"Charleston\",\"end_date\":\"20201225\",\"engagement_lead_email\":\"[email protected]\",\"engagement_lead_name\":\"Doug Gilmour\",\"location\":\"Raleigh, NC\","
2828
+ "\"ocp_cloud_provider_name\":\"GCP\",\"ocp_cloud_provider_region\":\"West\",\"ocp_cluster_size\":\"medium\",\"ocp_persistent_storage_size\":\"50GB\",\"ocp_sub_domain\":\"jello\","
2929
+ "\"ocp_version\":\"v4.2\",\"project_id\":0,\"project_name\":\"project1\",\"start_date\":\"20200202\",\"status\":{\"messages\":[{\"message\":\"This is message 1\",\"severity\":\"INFO\","
30-
+ "\"updated\":\"2020-06-23T21:25:31Z\"},{\"message\":\"This is message 2\",\"severity\":\"CRITICAL\",\"updated\":\"2020-06-22T11:15:11Z\"},{\"message\":\"This is message 3\",\"severity\":\"SUCCESS\","
31-
+ "\"updated\":\"2020-06-22T10:25:31Z\"}],\"overall_status\":\"yellow\",\"subsystems\":[{\"api\":\"https://api.....:6443\",\"info\":\"Deployment In Progress\",\"messages\":[{\"message\":\"This is message 1\","
32-
+ "\"severity\":\"INFO\",\"updated\":\"2020-06-23T21:25:31Z\"}],\"name\":\"openshift\",\"state\":\"provisioning\",\"status\":\"yellow\",\"updated\":\"2020-06-23T09:25:31Z\",\"web_console\":\"https://console......\"},"
33-
+ "{\"messages\":[{\"message\":\"This is message 1\",\"severity\":\"INFO\",\"updated\":\"2020-06-23T21:25:31Z\"}],\"name\":\"atlassian\",\"state\":\"operational\",\"status\":\"green\","
30+
+ "\"updated\":\"2020-06-23T21:25:31Z\"},{\"message\":\"This is message 2\",\"severity\":\"CRITICAL\",\"updated\":\"2020-06-22T11:15:11Z\"},{\"message\":\"This is message 3\","
31+
+ "\"severity\":\"SUCCESS\",\"updated\":\"2020-06-22T10:25:31Z\"}],\"overall_status\":\"yellow\",\"subsystems\":[{\"access_urls\":[{\"Web Console\":\"https://console......\"},"
32+
+ "{\"API\":\"https://api.....:6443\"}],\"info\":\"Deployment In Progress\",\"messages\":[{\"message\":\"This is message 1\",\"severity\":\"INFO\",\"updated\":\"2020-06-23T21:25:31Z\"}],"
33+
+ "\"name\":\"openshift\",\"state\":\"provisioning\",\"status\":\"yellow\",\"updated\":\"2020-06-23T09:25:31Z\"},{\"access_urls\":[{\"atlassian\":\"https://mycompany.atlassian.net\"}],"
34+
+ "\"messages\":[{\"message\":\"This is message 1\",\"severity\":\"INFO\",\"updated\":\"2020-06-23T21:25:31Z\"}],\"name\":\"atlassian\",\"state\":\"operational\",\"status\":\"green\","
3435
+ "\"updated\":\"2020-06-22T20:15:37Z\"}]},\"technical_lead_email\":\"[email protected]\",\"technical_lead_name\":\"Wendel Clark\"}]"));
3536

3637
}
@@ -130,10 +131,10 @@ void testGetStatusSuccess() {
130131
.then()
131132
.statusCode(200)
132133
.body(is("{\"messages\":[{\"message\":\"This is message 1\",\"severity\":\"INFO\",\"updated\":\"2020-06-23T21:25:31Z\"},{\"message\":\"This is message 2\",\"severity\":\"CRITICAL\",\"updated\":\"2020-06-22T11:15:11Z\"},"
133-
+ "{\"message\":\"This is message 3\",\"severity\":\"SUCCESS\",\"updated\":\"2020-06-22T10:25:31Z\"}],\"overall_status\":\"yellow\",\"subsystems\":[{\"api\":\"https://api.....:6443\",\"info\":\"Deployment In Progress\","
134-
+ "\"messages\":[{\"message\":\"This is message 1\",\"severity\":\"INFO\",\"updated\":\"2020-06-23T21:25:31Z\"}],\"name\":\"openshift\",\"state\":\"provisioning\",\"status\":\"yellow\",\"updated\":\"2020-06-23T09:25:31Z\","
135-
+ "\"web_console\":\"https://console......\"},{\"messages\":[{\"message\":\"This is message 1\",\"severity\":\"INFO\",\"updated\":\"2020-06-23T21:25:31Z\"}],\"name\":\"atlassian\",\"state\":\"operational\",\"status\":\"green\","
136-
+ "\"updated\":\"2020-06-22T20:15:37Z\"}]}"));
134+
+ "{\"message\":\"This is message 3\",\"severity\":\"SUCCESS\",\"updated\":\"2020-06-22T10:25:31Z\"}],\"overall_status\":\"yellow\",\"subsystems\":[{\"access_urls\":[{\"Web Console\":\"https://console......\"},"
135+
+ "{\"API\":\"https://api.....:6443\"}],\"info\":\"Deployment In Progress\",\"messages\":[{\"message\":\"This is message 1\",\"severity\":\"INFO\",\"updated\":\"2020-06-23T21:25:31Z\"}],\"name\":\"openshift\","
136+
+ "\"state\":\"provisioning\",\"status\":\"yellow\",\"updated\":\"2020-06-23T09:25:31Z\"},{\"access_urls\":[{\"atlassian\":\"https://mycompany.atlassian.net\"}],\"messages\":[{\"message\":\"This is message 1\","
137+
+ "\"severity\":\"INFO\",\"updated\":\"2020-06-23T21:25:31Z\"}],\"name\":\"atlassian\",\"state\":\"operational\",\"status\":\"green\",\"updated\":\"2020-06-22T20:15:37Z\"}]}"));
137138
}
138139

139140
@Test
@@ -149,10 +150,10 @@ void testGetProjectSuccess() {
149150
+ "\"engagement_lead_email\":\"[email protected]\",\"engagement_lead_name\":\"Doug Gilmour\",\"location\":\"Raleigh, NC\",\"ocp_cloud_provider_name\":\"GCP\",\"ocp_cloud_provider_region\":\"West\",\"ocp_cluster_size\":\"medium\","
150151
+ "\"ocp_persistent_storage_size\":\"50GB\",\"ocp_sub_domain\":\"jello\",\"ocp_version\":\"v4.2\",\"project_id\":0,\"project_name\":\"project1\",\"start_date\":\"20200202\",\"status\":{\"messages\":[{\"message\":\"This is message 1\","
151152
+ "\"severity\":\"INFO\",\"updated\":\"2020-06-23T21:25:31Z\"},{\"message\":\"This is message 2\",\"severity\":\"CRITICAL\",\"updated\":\"2020-06-22T11:15:11Z\"},{\"message\":\"This is message 3\",\"severity\":\"SUCCESS\","
152-
+ "\"updated\":\"2020-06-22T10:25:31Z\"}],\"overall_status\":\"yellow\",\"subsystems\":[{\"api\":\"https://api.....:6443\",\"info\":\"Deployment In Progress\",\"messages\":[{\"message\":\"This is message 1\",\"severity\":\"INFO\","
153-
+ "\"updated\":\"2020-06-23T21:25:31Z\"}],\"name\":\"openshift\",\"state\":\"provisioning\",\"status\":\"yellow\",\"updated\":\"2020-06-23T09:25:31Z\",\"web_console\":\"https://console......\"},"
154-
+ "{\"messages\":[{\"message\":\"This is message 1\",\"severity\":\"INFO\",\"updated\":\"2020-06-23T21:25:31Z\"}],\"name\":\"atlassian\",\"state\":\"operational\",\"status\":\"green\",\"updated\":\"2020-06-22T20:15:37Z\"}]},"
155-
+ "\"technical_lead_email\":\"[email protected]\",\"technical_lead_name\":\"Wendel Clark\"}"));
153+
+ "\"updated\":\"2020-06-22T10:25:31Z\"}],\"overall_status\":\"yellow\",\"subsystems\":[{\"access_urls\":[{\"Web Console\":\"https://console......\"},{\"API\":\"https://api.....:6443\"}],\"info\":\"Deployment In Progress\","
154+
+ "\"messages\":[{\"message\":\"This is message 1\",\"severity\":\"INFO\",\"updated\":\"2020-06-23T21:25:31Z\"}],\"name\":\"openshift\",\"state\":\"provisioning\",\"status\":\"yellow\",\"updated\":\"2020-06-23T09:25:31Z\"},"
155+
+ "{\"access_urls\":[{\"atlassian\":\"https://mycompany.atlassian.net\"}],\"messages\":[{\"message\":\"This is message 1\",\"severity\":\"INFO\",\"updated\":\"2020-06-23T21:25:31Z\"}],\"name\":\"atlassian\",\"state\":\"operational\","
156+
+ "\"status\":\"green\",\"updated\":\"2020-06-22T20:15:37Z\"}]},\"technical_lead_email\":\"[email protected]\",\"technical_lead_name\":\"Wendel Clark\"}"));
156157
}
157158

158159
@Test

src/test/resources/status.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,14 @@
2424
"state": "provisioning",
2525
"info": "Deployment In Progress",
2626
"updated": "2020-06-23T09:25:31Z",
27-
"web_console": "https://console......",
28-
"api": "https://api.....:6443",
27+
"access_urls": [
28+
{
29+
"Web Console": "https://console......"
30+
},
31+
{
32+
"API": "https://api.....:6443"
33+
}
34+
],
2935
"messages": [
3036
{
3137
"severity": "INFO",
@@ -40,7 +46,11 @@
4046
"state": "operational",
4147
"info": null,
4248
"updated": "2020-06-22T20:15:37Z",
43-
"url": "https://mycompany.atlassian.net",
49+
"access_urls": [
50+
{
51+
"atlassian": "https://mycompany.atlassian.net"
52+
}
53+
],
4454
"messages": [
4555
{
4656
"severity": "INFO",

0 commit comments

Comments
 (0)