diff options
author | Chuyi Guo <guochuyi@chinamobile.com> | 2020-05-22 07:42:31 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2020-05-22 07:42:31 +0000 |
commit | f48f8f4f46c0f3fa2c85e92069a7dd7304fb4f89 (patch) | |
tree | 1df3acdb7a7125f4d4da5cb9975ad7922d28f713 | |
parent | 7759c093cb99a369a32091bd84383a4c70c8e4c6 (diff) | |
parent | 049c01fb9ba87af13477cae5aa264c72cfe2e3d1 (diff) |
Merge "Added junit test cases"
3 files changed, 34 insertions, 9 deletions
diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/so/bean/OperationProgressInformationTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/so/bean/OperationProgressInformationTest.java index 587d13e3..0fedc2dc 100644 --- a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/so/bean/OperationProgressInformationTest.java +++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/so/bean/OperationProgressInformationTest.java @@ -1,6 +1,9 @@ /** * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. * + * ================================================================================ + * Modifications Copyright (C) 2020 IBM. + * ================================================================================ * 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 @@ -40,6 +43,8 @@ import org.hibernate.Transaction; import mockit.Mock; import mockit.MockUp; +import static org.junit.Assert.assertEquals; + public class OperationProgressInformationTest { @Before @@ -51,9 +56,16 @@ public class OperationProgressInformationTest { } @Test - public void testOperationProgressInformation() throws Exception { + public void testGet() throws Exception { OperationProgressInformation opi = new OperationProgressInformation(); - opi.setOperationStatus(null); - opi.getOperationStatus(); + OperationProgress op = new OperationProgress("123","test","test","test","test","test","test","test",123,"test","test"); + opi.setOperationStatus(op); + assertEquals(op,opi.getOperationStatus()); + } + @Test + public void testConstructor() throws Exception { + OperationProgress op = new OperationProgress("123","test","test","test","test","test","test","test",123,"test","test"); + OperationProgressInformation opi = new OperationProgressInformation(op); + assertEquals(op,opi.getOperationStatus()); } } diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/so/bean/OperationTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/so/bean/OperationTest.java index 2fdd2041..d8e9895e 100644 --- a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/so/bean/OperationTest.java +++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/so/bean/OperationTest.java @@ -1,6 +1,9 @@ /** * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. * + * ================================================================================ + * Modifications Copyright (C) 2020 IBM. + * ================================================================================ * 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 @@ -40,6 +43,8 @@ import org.hibernate.Transaction; import mockit.Mock; import mockit.MockUp; +import static org.junit.Assert.assertEquals; + public class OperationTest { @Before @@ -53,9 +58,9 @@ public class OperationTest { @Test public void testOperation() throws Exception { Operation o = new Operation(); - o.setServiceId(""); - o.setOperationId(""); - o.getServiceId(); - o.getOperationId(); + o.setServiceId("123"); + o.setOperationId("123"); + assertEquals("123",o.getServiceId()); + assertEquals("123",o.getOperationId()); } } diff --git a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/so/bean/ServiceOperationTest.java b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/so/bean/ServiceOperationTest.java index 56fd4bb8..268bb85c 100644 --- a/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/so/bean/ServiceOperationTest.java +++ b/server/src/test/java/org/onap/usecaseui/server/service/lcm/domain/so/bean/ServiceOperationTest.java @@ -1,6 +1,9 @@ /** * Copyright (C) 2017 CMCC, Inc. and others. All rights reserved. * + * ================================================================================ + * Modifications Copyright (C) 2020 IBM. + * ================================================================================ * 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 @@ -40,6 +43,8 @@ import org.hibernate.Transaction; import mockit.Mock; import mockit.MockUp; +import static org.junit.Assert.assertEquals; + public class ServiceOperationTest { @Before @@ -53,7 +58,10 @@ public class ServiceOperationTest { @Test public void testServiceOperation() throws Exception { ServiceOperation so = new ServiceOperation(); - so.setService(null); - so.getService(); + Operation o = new Operation(); + o.setServiceId("123"); + o.setOperationId("123"); + so.setService(o); + assertEquals(o,so.getService()); } } |