The model classes supported early pendulum demos.
Correct imports in AcXappControllerTest class.
Change-Id: Id2bb5efc023cfe3ad233aca1ff89b0032373d24b
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
*/
package org.oransc.ric.portal.dashboard.model;
-import java.util.Objects;
-
public class DashboardUser {
private long id;
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);
- }
-
}
+++ /dev/null
-/*-
- * ========================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;
- }
-
-}
+++ /dev/null
-/*-
- * ========================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;
-}
+++ /dev/null
-/*-
- * ========================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;
- }
-
-}
+++ /dev/null
-/*-
- * ========================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;
- }
-
-}
+++ /dev/null
-/*-
- * ========================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;
- }
-
-}
* limitations under the License.
* ========================LICENSE_END===================================
*/
-
package org.oransc.ric.portal.dashboard.model;
import org.oransc.ric.e2mgr.client.model.GetNodebResponse;
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;
- }
-
}
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;
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
URI uri = buildUri(null, AcXappController.CONTROLLER_PATH, AcXappController.ADMCTRL_METHOD);
logger.info("Invoking {}", uri);
ResponseEntity<String> response = restTemplate.exchange(uri, HttpMethod.GET, null, String.class);
- Assert.assertTrue(response.getStatusCode().is5xxServerError());
+ Assertions.assertTrue(response.getStatusCode().is5xxServerError());
}
@Test
HttpEntity<JsonNode> entity = new HttpEntity<>(body);
logger.info("Invoking {}", uri);
ResponseEntity<Void> voidResponse = restTemplate.exchange(uri, HttpMethod.PUT, entity, Void.class);
- Assert.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
+ Assertions.assertTrue(voidResponse.getStatusCode().is2xxSuccessful());
}
}