19e6d035a5bd1ad4470e76783967a7bedfca4a61
[appc.git] / appc-dg / appc-dg-shared / appc-dg-netconf / src / test / java / org / openecomp / appc / dg / netconf / impl / MockOperationalStateValidatorImpl.java
1 /*-
2  * ============LICENSE_START=======================================================
3  * ONAP : APPC
4  * ================================================================================
5  * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
6  * ================================================================================
7  * Copyright (C) 2017 Amdocs
8  * =============================================================================
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  * 
13  *      http://www.apache.org/licenses/LICENSE-2.0
14  * 
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  * 
21  * ECOMP is a trademark and service mark of AT&T Intellectual Property.
22  * ============LICENSE_END=========================================================
23  */
24
25 package org.openecomp.appc.dg.netconf.impl;
26
27 import org.openecomp.appc.adapter.netconf.OperationalStateValidator;
28 import org.openecomp.appc.adapter.netconf.VnfType;
29 import org.openecomp.appc.exceptions.APPCException;
30
31
32 public class MockOperationalStateValidatorImpl implements OperationalStateValidator {
33
34     private boolean validated;
35     private String configurationFileName;
36
37     public boolean isValidated() {
38         return validated;
39     }
40
41     @Override
42     public VnfType getVnfType() {
43         return null;
44     }
45
46     @Override
47     public String getConfigurationFileName() {
48         return configurationFileName;
49     }
50
51     @Override
52     public void validateResponse(String response) throws APPCException {
53         if (response.equals("wrong")) {
54             throw new APPCException();
55         } else {
56             this.validated = true;
57         }
58
59     }
60
61     public void setConfigurationFileName(String configurationFileName) {
62         this.configurationFileName = configurationFileName;
63     }
64 }