diff options
Diffstat (limited to 'models-interactions/model-impl/appc/src/test')
4 files changed, 10 insertions, 6 deletions
diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java index 686e6a416..8c00fd5de 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/CommonHeaderTest.java @@ -21,6 +21,7 @@ package org.onap.policy.appc; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; @@ -73,7 +74,7 @@ public class CommonHeaderTest { assertNotEquals(0, commonHeader.hashCode()); - assertEquals("CommonHeader [TimeStamp=", commonHeader.toString().substring(0, 24)); + assertThat(commonHeader.toString()).startsWith("CommonHeader(timeStamp="); CommonHeader copiedCommonHeader = new CommonHeader(); copiedCommonHeader.setApiVer(commonHeader.getApiVer()); diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java index 5bff56b78..52b974c54 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/RequestTest.java @@ -21,6 +21,7 @@ package org.onap.policy.appc; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; @@ -64,7 +65,7 @@ public class RequestTest { assertNotEquals(0, request.hashCode()); - assertEquals("Request [CommonHeader=CommonHeader [TimeStamp=", request.toString().substring(0, 46)); + assertThat(request.toString()).startsWith("Request(commonHeader=CommonHeader(timeStamp="); Request copiedRequest = new Request(); copiedRequest.setCommonHeader(request.getCommonHeader()); diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java index c79062594..cd4e2a697 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseStatusTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * appc * ================================================================================ - * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,6 +21,7 @@ package org.onap.policy.appc; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; @@ -48,7 +49,7 @@ public class ResponseStatusTest { assertEquals(THERE_S_NO_PLACE_LIKE_HOME, status.getValue()); assertNotEquals(0, status.hashCode()); - assertEquals("ResponseStatus [Code=1234, Value=There's no pla", status.toString().substring(0, 47)); + assertThat(status.toString()).startsWith("ResponseStatus(code=1234, value=There's no pla"); ResponseStatus copiedStatus = new ResponseStatus(); copiedStatus.setCode(status.getCode()); diff --git a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java index 9e20331f9..42e5a6d85 100644 --- a/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java +++ b/models-interactions/model-impl/appc/src/test/java/org/onap/policy/appc/ResponseTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * appc * ================================================================================ - * Copyright (C) 2017-2020 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2021 AT&T Intellectual Property. All rights reserved. * Modifications Copyright (C) 2019 Nordix Foundation. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -21,6 +21,7 @@ package org.onap.policy.appc; +import static org.assertj.core.api.Assertions.assertThat; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; @@ -60,7 +61,7 @@ public class ResponseTest { assertNotEquals(0, response.hashCode()); - assertEquals("Response [CommonHeader=CommonHeader [TimeStamp=", response.toString().substring(0, 47)); + assertThat(response.toString()).startsWith("Response(commonHeader=CommonHeader(timeStamp="); Response copiedResponse = new Response(); copiedResponse.setCommonHeader(response.getCommonHeader()); |