diff options
Diffstat (limited to 'model/context-model/src/test')
3 files changed, 15 insertions, 11 deletions
diff --git a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextAlbumsTest.java b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextAlbumsTest.java index 8293feb5b..44161b329 100644 --- a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextAlbumsTest.java +++ b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextAlbumsTest.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2019-2021 Nordix Foundation. + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,11 +22,11 @@ package org.onap.policy.apex.model.contextmodel.concepts; +import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; @@ -138,8 +139,8 @@ public class ContextAlbumsTest { album.setItemSchema(albumSchemaKey); final AxContextAlbum clonedAlbum = new AxContextAlbum(album); - assertEquals("AxContextAlbum:(key=AxArtifactKey:(name=NewAlbumName,version=0.0.1)," - + "scope=NewAlbumScope,isWritable=true,itemSchema=" + assertEquals("AxContextAlbum(key=AxArtifactKey:(name=NewAlbumName,version=0.0.1), " + + "scope=NewAlbumScope, isWritable=true, itemSchema=" + "AxArtifactKey:(name=AlbumSchemaName,version=0.0.1))", clonedAlbum.toString()); assertNotEquals(0, album.hashCode()); @@ -220,8 +221,8 @@ public class ContextAlbumsTest { albums.clean(); final AxContextAlbums clonedAlbums = new AxContextAlbums(albums); - assertTrue(clonedAlbums.toString().startsWith( - "AxContextAlbums:(AxContextAlbums:(key=AxArtifactKey:(name=AlbumsKey,version=0.0.1)")); + assertThat(clonedAlbums.toString()).startsWith( + "AxContextAlbums(key=AxArtifactKey:(name=AlbumsKey,version=0.0.1)"); assertNotEquals(0, albums.hashCode()); diff --git a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextModelTest.java b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextModelTest.java index eab561e25..b148ef6be 100644 --- a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextModelTest.java +++ b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextModelTest.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2019-2020 Nordix Foundation. + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,6 +22,7 @@ package org.onap.policy.apex.model.contextmodel.concepts; +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; @@ -54,7 +56,7 @@ public class ContextModelTest { model.clean(); assertNotNull(model); - assertEquals("AxContextModel:(AxContextModel:(key=AxArtifactKey:", model.toString().substring(0, 50)); + assertThat(model.toString()).startsWith("AxContextModel(super=AxContextModel:(key=AxArtifactKey:"); final AxContextModel clonedModel = new AxContextModel(model); diff --git a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextSchemasTest.java b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextSchemasTest.java index fbca04d7e..52cca14bf 100644 --- a/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextSchemasTest.java +++ b/model/context-model/src/test/java/org/onap/policy/apex/model/contextmodel/concepts/ContextSchemasTest.java @@ -2,6 +2,7 @@ * ============LICENSE_START======================================================= * Copyright (C) 2016-2018 Ericsson. All rights reserved. * Modifications Copyright (C) 2020-2021 Nordix Foundation. + * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,11 +22,11 @@ package org.onap.policy.apex.model.contextmodel.concepts; +import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotEquals; import static org.junit.Assert.assertNotNull; -import static org.junit.Assert.assertTrue; import org.junit.Test; import org.onap.policy.apex.model.basicmodel.concepts.AxArtifactKey; @@ -121,8 +122,8 @@ public class ContextSchemasTest { schema.clean(); final AxContextSchema clonedSchema = new AxContextSchema(schema); - assertEquals("AxContextSchema:(key=AxArtifactKey:(name=NewSchemaName,version=0.0.1)," - + "schemaFlavour=NewSchemaFlavour,schemaDefinition=NewSchemaDefinition)", + assertEquals("AxContextSchema(key=AxArtifactKey:(name=NewSchemaName,version=0.0.1), " + + "schemaFlavour=NewSchemaFlavour, schemaDefinition=NewSchemaDefinition)", clonedSchema.toString()); assertNotEquals(0, schema.hashCode()); @@ -201,8 +202,8 @@ public class ContextSchemasTest { schemas.clean(); final AxContextSchemas clonedSchemas = new AxContextSchemas(schemas); - assertTrue(clonedSchemas.toString() - .startsWith("AxContextSchemas:(key=AxArtifactKey:(name=SchemasKey,version=0.0.1),")); + assertThat(clonedSchemas.toString()) + .startsWith("AxContextSchemas(key=AxArtifactKey:(name=SchemasKey,version=0.0.1),"); assertNotEquals(0, schemas.hashCode()); |