From f477d1d59382838c1cbeb3b73b325c7a4d535a3e Mon Sep 17 00:00:00 2001 From: kurczews Date: Wed, 20 Mar 2019 09:52:12 +0100 Subject: Add tests for AaiServiceImpl Issue-ID: VID-386 Change-Id: Idbed927b9942c93d6b6ed7dd17fccb27a0853153 Signed-off-by: kurczews --- .../onap/vid/services/WorkflowServiceImplTest.java | 34 ++++++++-------------- 1 file changed, 12 insertions(+), 22 deletions(-) (limited to 'vid-app-common/src/test/java/org/onap/vid/services/WorkflowServiceImplTest.java') diff --git a/vid-app-common/src/test/java/org/onap/vid/services/WorkflowServiceImplTest.java b/vid-app-common/src/test/java/org/onap/vid/services/WorkflowServiceImplTest.java index a8ded2719..fa53a9a80 100644 --- a/vid-app-common/src/test/java/org/onap/vid/services/WorkflowServiceImplTest.java +++ b/vid-app-common/src/test/java/org/onap/vid/services/WorkflowServiceImplTest.java @@ -3,13 +3,14 @@ * VID * ================================================================================ * Copyright (C) 2017 - 2019 AT&T Intellectual Property. All rights reserved. + * Modifications Copyright (C) 2019 - 2020 Nokia. 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. * 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. @@ -20,34 +21,23 @@ package org.onap.vid.services; -import java.util.*; +import static org.assertj.core.api.Assertions.assertThat; +import java.util.Arrays; +import java.util.Collection; import org.junit.Test; public class WorkflowServiceImplTest { - private WorkflowServiceImpl createTestSubject() { - return new WorkflowServiceImpl(); - } - @Test - public void testGetWorkflowsForVNFs() throws Exception { - WorkflowServiceImpl testSubject; - Collection vnfNames = new ArrayList(); - Collection result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getWorkflowsForVNFs(vnfNames); + public void testGetWorkflowsForVNFs() { + Collection result = new WorkflowServiceImpl().getWorkflowsForVNFs(Arrays.asList("VNF1", "VNF2")); + assertThat(result).containsExactly("Upgrade", "Clean", "Reinstall"); } @Test - public void testGetAllWorkflows() throws Exception { - WorkflowServiceImpl testSubject; - Collection result; - - // default test - testSubject = createTestSubject(); - result = testSubject.getAllWorkflows(); + public void testGetAllWorkflows() { + Collection result = new WorkflowServiceImpl().getAllWorkflows(); + assertThat(result).containsExactly("Upgrade", "Clean", "Reinstall", "Dump", "Flush"); } } -- cgit 1.2.3-korg