From ccf75118bac3808065eba14081c096b49177219f Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Wed, 10 Jul 2019 10:27:26 -0400 Subject: [PATCH] Drop unused POJO model classes. The model classes supported early pendulum demos. Correct imports in AcXappControllerTest class. Change-Id: Id2bb5efc023cfe3ad233aca1ff89b0032373d24b Signed-off-by: Lott, Christopher (cl778h) --- .../ric/portal/dashboard/model/DashboardUser.java | 26 --------- .../ric/portal/dashboard/model/DelayTransport.java | 55 ------------------ .../portal/dashboard/model/E2SetupRequestType.java | 25 --------- .../ric/portal/dashboard/model/LoadTransport.java | 45 --------------- .../portal/dashboard/model/MetricsTransport.java | 65 ---------------------- .../ric/portal/dashboard/model/PathTransport.java | 55 ------------------ .../dashboard/model/RanDetailsTransport.java | 34 ----------- .../test/controller/AcXappControllerTest.java | 10 ++-- 8 files changed, 5 insertions(+), 310 deletions(-) delete mode 100644 webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/DelayTransport.java delete mode 100644 webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/E2SetupRequestType.java delete mode 100644 webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/LoadTransport.java delete mode 100644 webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/MetricsTransport.java delete mode 100644 webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PathTransport.java diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/DashboardUser.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/DashboardUser.java index 37186aeb..90c2edd5 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/DashboardUser.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/DashboardUser.java @@ -23,8 +23,6 @@ */ package org.oransc.ric.portal.dashboard.model; -import java.util.Objects; - public class DashboardUser { private long id; @@ -74,28 +72,4 @@ public class DashboardUser { this.status = status; } - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((firstName == null) ? 0 : firstName.hashCode()); - result = prime * result + (int) (id ^ (id >>> 32)); - result = prime * result + ((lastName == null) ? 0 : lastName.hashCode()); - result = prime * result + ((status == null) ? 0 : status.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - DashboardUser other = (DashboardUser) obj; - return Objects.equals(id, other.id) && Objects.equals(firstName, other.firstName) - && Objects.equals(lastName, other.lastName) && Objects.equals(status, other.status); - } - } diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/DelayTransport.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/DelayTransport.java deleted file mode 100644 index 1e0db713..00000000 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/DelayTransport.java +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property and Nokia - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================LICENSE_END=================================== - */ - -package org.oransc.ric.portal.dashboard.model; - -/** - * Trivial model to transport a number, to be serialized as JSON. - */ -public class DelayTransport implements IDashboardResponse { - - private Integer delay; - - /** - * Builds an empty object. - */ - public DelayTransport() { - // no-arg constructor - } - - /** - * Builds an object with the specified value. - * - * @param i - * value to transport. - */ - public DelayTransport(Integer i) { - this.delay = i; - } - - public Integer getDelay() { - return delay; - } - - public void setDelay(Integer i) { - this.delay = i; - } - -} diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/E2SetupRequestType.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/E2SetupRequestType.java deleted file mode 100644 index a8d822f7..00000000 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/E2SetupRequestType.java +++ /dev/null @@ -1,25 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property and Nokia - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================LICENSE_END=================================== - */ - -package org.oransc.ric.portal.dashboard.model; - -public enum E2SetupRequestType { - ENDC, X2; -} diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/LoadTransport.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/LoadTransport.java deleted file mode 100644 index 13f20574..00000000 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/LoadTransport.java +++ /dev/null @@ -1,45 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property and Nokia - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================LICENSE_END=================================== - */ - -package org.oransc.ric.portal.dashboard.model; - -/** - * Trivial model to transport a number, to be serialized as JSON. - */ -public class LoadTransport implements IDashboardResponse { - - public LoadTransport() { - } - - public LoadTransport(Integer load) { - this.load = load; - } - - private Integer load; - - public Integer getLoad() { - return load; - } - - public void setLoad(Integer i) { - this.load = i; - } - -} diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/MetricsTransport.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/MetricsTransport.java deleted file mode 100644 index ba0db05b..00000000 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/MetricsTransport.java +++ /dev/null @@ -1,65 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property and Nokia - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================LICENSE_END=================================== - */ - -package org.oransc.ric.portal.dashboard.model; - -/** - * Trivial model to transport a batch of numbers, to be serialized as JSON. - */ -public class MetricsTransport implements IDashboardResponse { - - private Integer latency; - private Integer load; - private Integer time; - - public MetricsTransport() { - } - - public MetricsTransport(Integer latency, Integer load, Integer time) { - this.latency = latency; - this.load = load; - this.time = time; - } - - public Integer getLatency() { - return latency; - } - - public void setLatency(Integer latency) { - this.latency = latency; - } - - public Integer getLoad() { - return load; - } - - public void setLoad(Integer load) { - this.load = load; - } - - public Integer getTime() { - return time; - } - - public void setTime(Integer time) { - this.time = time; - } - -} diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PathTransport.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PathTransport.java deleted file mode 100644 index 003260fc..00000000 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/PathTransport.java +++ /dev/null @@ -1,55 +0,0 @@ -/*- - * ========================LICENSE_START================================= - * O-RAN-SC - * %% - * Copyright (C) 2019 AT&T Intellectual Property and Nokia - * %% - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * ========================LICENSE_END=================================== - */ - -package org.oransc.ric.portal.dashboard.model; - -/** - * Trivial model to transport a path, to be serialized as JSON. - */ -public class PathTransport implements IDashboardResponse { - - private String path; - - /** - * Builds an empty object. - */ - public PathTransport() { - // no-arg constructor - } - - /** - * Builds an object with the specified value. - * - * @param s - * value to transport. - */ - public PathTransport(String s) { - this.path = s; - } - - public String getPath() { - return path; - } - - public void setPath(String s) { - this.path = s; - } - -} diff --git a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/RanDetailsTransport.java b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/RanDetailsTransport.java index 1053cfca..1005ae25 100644 --- a/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/RanDetailsTransport.java +++ b/webapp-backend/src/main/java/org/oransc/ric/portal/dashboard/model/RanDetailsTransport.java @@ -17,7 +17,6 @@ * limitations under the License. * ========================LICENSE_END=================================== */ - package org.oransc.ric.portal.dashboard.model; import org.oransc.ric.e2mgr.client.model.GetNodebResponse; @@ -62,37 +61,4 @@ public class RanDetailsTransport { return this; } - @Override - public int hashCode() { - final int prime = 31; - int result = 1; - result = prime * result + ((nodebIdentity == null) ? 0 : nodebIdentity.hashCode()); - result = prime * result + ((nodebStatus == null) ? 0 : nodebStatus.hashCode()); - return result; - } - - @Override - public boolean equals(Object obj) { - if (this == obj) - return true; - if (obj == null) - return false; - if (getClass() != obj.getClass()) - return false; - RanDetailsTransport other = (RanDetailsTransport) obj; - if (nodebIdentity == null) { - if (other.nodebIdentity != null) - return false; - } else if (!nodebIdentity.equals(other.nodebIdentity)) { - return false; - } - if (nodebStatus == null) { - if (other.nodebStatus != null) - return false; - } else if (!nodebStatus.equals(other.nodebStatus)) { - return false; - } - return true; - } - } diff --git a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/test/controller/AcXappControllerTest.java b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/test/controller/AcXappControllerTest.java index faad53ba..f0ba8b58 100644 --- a/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/test/controller/AcXappControllerTest.java +++ b/webapp-backend/src/test/java/org/oransc/ric/portal/dashboard/test/controller/AcXappControllerTest.java @@ -22,9 +22,9 @@ package org.oransc.ric.portal.dashboard.test.controller; import java.io.IOException; import java.lang.invoke.MethodHandles; import java.net.URI; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; -import org.junit.Assert; -import org.junit.Test; import org.oransc.ric.portal.dashboard.controller.AcXappController; import org.oransc.ric.portal.dashboard.model.SuccessTransport; import org.slf4j.Logger; @@ -45,7 +45,7 @@ public class AcXappControllerTest extends AbstractControllerTest { URI uri = buildUri(null, AcXappController.CONTROLLER_PATH, AcXappController.VERSION_METHOD); logger.info("Invoking {}", uri); SuccessTransport st = restTemplate.getForObject(uri, SuccessTransport.class); - Assert.assertFalse(st.getData().toString().isEmpty()); + Assertions.assertFalse(st.getData().toString().isEmpty()); } @Test @@ -54,7 +54,7 @@ public class AcXappControllerTest extends AbstractControllerTest { URI uri = buildUri(null, AcXappController.CONTROLLER_PATH, AcXappController.ADMCTRL_METHOD); logger.info("Invoking {}", uri); ResponseEntity response = restTemplate.exchange(uri, HttpMethod.GET, null, String.class); - Assert.assertTrue(response.getStatusCode().is5xxServerError()); + Assertions.assertTrue(response.getStatusCode().is5xxServerError()); } @Test @@ -65,7 +65,7 @@ public class AcXappControllerTest extends AbstractControllerTest { HttpEntity entity = new HttpEntity<>(body); logger.info("Invoking {}", uri); ResponseEntity voidResponse = restTemplate.exchange(uri, HttpMethod.PUT, entity, Void.class); - Assert.assertTrue(voidResponse.getStatusCode().is2xxSuccessful()); + Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful()); } } -- 2.16.6