2 * ============LICENSE_START=======================================================
4 * ================================================================================
5 * Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
6 * ================================================================================
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ============LICENSE_END=========================================================
21 package org.openecomp.sdc.be.servlets;
23 import static org.mockito.Mockito.mock;
25 import javax.servlet.http.HttpServletRequest;
26 import javax.ws.rs.core.Response;
28 import org.junit.Test;
29 import org.openecomp.sdc.be.components.impl.ComponentInstanceBusinessLogic;
30 import org.openecomp.sdc.be.components.impl.GroupBusinessLogic;
31 import org.openecomp.sdc.be.components.lifecycle.LifecycleBusinessLogic;
32 import org.openecomp.sdc.be.impl.ComponentsUtils;
33 import org.openecomp.sdc.be.model.LifeCycleTransitionEnum;
34 import org.openecomp.sdc.be.model.User;
36 import fj.data.Either;
37 import org.openecomp.sdc.be.user.UserBusinessLogic;
39 public class LifecycleServletTest {
41 private LifecycleServlet createTestSubject() {
42 UserBusinessLogic userBusinessLogic = mock(UserBusinessLogic.class);
43 LifecycleBusinessLogic lifecycleBusinessLogic = mock(LifecycleBusinessLogic.class);
44 ComponentsUtils componentsUtils = mock(ComponentsUtils.class);
46 return new LifecycleServlet(userBusinessLogic, componentsUtils, lifecycleBusinessLogic);
51 public void testChangeResourceState() throws Exception {
52 LifecycleServlet testSubject;
53 String jsonChangeInfo = "";
54 String componentCollection = "";
55 String lifecycleTransition = "";
56 String componentId = "";
57 HttpServletRequest request = null;
62 testSubject = createTestSubject();
67 public void testValidateTransitionEnum() throws Exception {
68 LifecycleServlet testSubject;
69 String lifecycleTransition = "";
71 Either<LifeCycleTransitionEnum, Response> result;
74 testSubject = createTestSubject();