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.config;
23 import org.junit.Test;
24 import org.openecomp.sdc.be.config.BeEcompErrorManager.ErrorSeverity;
25 import org.openecomp.sdc.common.config.IEcompConfigurationManager;
28 public class BeEcompErrorManagerTest {
30 private BeEcompErrorManager createTestSubject() {
31 return BeEcompErrorManager.getInstance();
36 public void testGetInstance() throws Exception {
37 BeEcompErrorManager result;
40 result = BeEcompErrorManager.getInstance();
47 public void testGetConfigurationManager() throws Exception {
48 BeEcompErrorManager testSubject;
49 IEcompConfigurationManager result;
52 testSubject = createTestSubject();
53 result = testSubject.getConfigurationManager();
58 public void testLogBeUebAuthenticationError() throws Exception {
59 BeEcompErrorManager testSubject;
64 testSubject = createTestSubject();
65 testSubject.logBeUebAuthenticationError(context, reason);
70 public void testLogBeHealthCheckRecovery() throws Exception {
71 BeEcompErrorManager testSubject;
75 testSubject = createTestSubject();
76 testSubject.logBeHealthCheckRecovery(context);
81 public void testLogBeHealthCheckJanusGraphRecovery() throws Exception {
82 BeEcompErrorManager testSubject;
86 testSubject = createTestSubject();
87 testSubject.logBeHealthCheckJanusGraphRecovery(context);
92 public void testLogBeHealthCheckElasticSearchRecovery() throws Exception {
93 BeEcompErrorManager testSubject;
97 testSubject = createTestSubject();
98 testSubject.logBeHealthCheckElasticSearchRecovery(context);
103 public void testLogBeHealthCheckUebClusterRecovery() throws Exception {
104 BeEcompErrorManager testSubject;
108 testSubject = createTestSubject();
109 testSubject.logBeHealthCheckUebClusterRecovery(context);
114 public void testLogFeHealthCheckRecovery() throws Exception {
115 BeEcompErrorManager testSubject;
119 testSubject = createTestSubject();
120 testSubject.logFeHealthCheckRecovery(context);
125 public void testLogBeHealthCheckError() throws Exception {
126 BeEcompErrorManager testSubject;
130 testSubject = createTestSubject();
131 testSubject.logBeHealthCheckError(context);
136 public void testLogBeHealthCheckJanusGraphError() throws Exception {
137 BeEcompErrorManager testSubject;
141 testSubject = createTestSubject();
142 testSubject.logBeHealthCheckJanusGraphError(context);
147 public void testLogBeHealthCheckElasticSearchError() throws Exception {
148 BeEcompErrorManager testSubject;
152 testSubject = createTestSubject();
153 testSubject.logBeHealthCheckElasticSearchError(context);
158 public void testLogBeHealthCheckUebClusterError() throws Exception {
159 BeEcompErrorManager testSubject;
163 testSubject = createTestSubject();
164 testSubject.logBeHealthCheckUebClusterError(context);
169 public void testLogFeHealthCheckError() throws Exception {
170 BeEcompErrorManager testSubject;
174 testSubject = createTestSubject();
175 testSubject.logFeHealthCheckError(context);
180 public void testLogBeUebConnectionError() throws Exception {
181 BeEcompErrorManager testSubject;
186 testSubject = createTestSubject();
187 testSubject.logBeUebConnectionError(context, reason);
192 public void testLogBeUebUnkownHostError() throws Exception {
193 BeEcompErrorManager testSubject;
198 testSubject = createTestSubject();
199 testSubject.logBeUebUnkownHostError(context, host);
204 public void testLogBeComponentMissingError() throws Exception {
205 BeEcompErrorManager testSubject;
207 String componentType = "";
211 testSubject = createTestSubject();
212 testSubject.logBeComponentMissingError(context, componentType, name);
217 public void testLogBeIncorrectComponentError() throws Exception {
218 BeEcompErrorManager testSubject;
220 String componentType = "";
224 testSubject = createTestSubject();
225 testSubject.logBeIncorrectComponentError(context, componentType, name);
230 public void testLogBeInvalidConfigurationError() throws Exception {
231 BeEcompErrorManager testSubject;
233 String parameterName = "";
234 String parameterValue = "";
237 testSubject = createTestSubject();
238 testSubject.logBeInvalidConfigurationError(context, parameterName, parameterValue);
243 public void testLogBeUebObjectNotFoundError() throws Exception {
244 BeEcompErrorManager testSubject;
246 String notFoundObjectName = "";
249 testSubject = createTestSubject();
250 testSubject.logBeUebObjectNotFoundError(context, notFoundObjectName);
255 public void testLogBeDistributionEngineInvalidArtifactType() throws Exception {
256 BeEcompErrorManager testSubject;
258 String artifactType = "";
259 String validArtifactTypes = "";
262 testSubject = createTestSubject();
263 testSubject.logBeDistributionEngineInvalidArtifactType(context, artifactType, validArtifactTypes);
268 public void testLogBeMissingConfigurationError() throws Exception {
269 BeEcompErrorManager testSubject;
271 String parameterName = "";
274 testSubject = createTestSubject();
275 testSubject.logBeMissingConfigurationError(context, parameterName);
280 public void testLogBeConfigurationInvalidListSizeError() throws Exception {
281 BeEcompErrorManager testSubject;
283 String parameterName = "";
284 int listMinimumSize = 0;
287 testSubject = createTestSubject();
288 testSubject.logBeConfigurationInvalidListSizeError(context, parameterName, listMinimumSize);
293 public void testLogErrorConfigFileFormat() throws Exception {
294 BeEcompErrorManager testSubject;
296 String description = "";
299 testSubject = createTestSubject();
300 testSubject.logErrorConfigFileFormat(context, description);
305 public void testLogBeMissingArtifactInformationError() throws Exception {
306 BeEcompErrorManager testSubject;
308 String missingInfo = "";
311 testSubject = createTestSubject();
312 testSubject.logBeMissingArtifactInformationError(context, missingInfo);
317 public void testLogBeArtifactMissingError() throws Exception {
318 BeEcompErrorManager testSubject;
320 String artifactName = "";
323 testSubject = createTestSubject();
324 testSubject.logBeArtifactMissingError(context, artifactName);
329 public void testLogBeUserMissingError() throws Exception {
330 BeEcompErrorManager testSubject;
335 testSubject = createTestSubject();
336 testSubject.logBeUserMissingError(context, userId);
341 public void testLogBeInvalidTypeError() throws Exception {
342 BeEcompErrorManager testSubject;
348 testSubject = createTestSubject();
349 testSubject.logBeInvalidTypeError(context, type, name);
354 public void testLogBeInvalidValueError() throws Exception {
355 BeEcompErrorManager testSubject;
362 testSubject = createTestSubject();
363 testSubject.logBeInvalidValueError(context, value, name, type);
368 public void testLogBeArtifactPayloadInvalid() throws Exception {
369 BeEcompErrorManager testSubject;
373 testSubject = createTestSubject();
374 testSubject.logBeArtifactPayloadInvalid(context);
379 public void testLogBeArtifactInformationInvalidError() throws Exception {
380 BeEcompErrorManager testSubject;
384 testSubject = createTestSubject();
385 testSubject.logBeArtifactInformationInvalidError(context);
390 public void testLogBeDistributionMissingError() throws Exception {
391 BeEcompErrorManager testSubject;
393 String distributionName = "";
396 testSubject = createTestSubject();
397 testSubject.logBeDistributionMissingError(context, distributionName);
402 public void testLogBeGraphObjectMissingError() throws Exception {
403 BeEcompErrorManager testSubject;
405 String objectType = "";
406 String objectName = "";
409 testSubject = createTestSubject();
410 testSubject.logBeGraphObjectMissingError(context, objectType, objectName);
415 public void testLogBeInvalidJsonInput() throws Exception {
416 BeEcompErrorManager testSubject;
420 testSubject = createTestSubject();
421 testSubject.logBeInvalidJsonInput(context);
426 public void testLogBeInitializationError() throws Exception {
427 BeEcompErrorManager testSubject;
431 testSubject = createTestSubject();
432 testSubject.logBeInitializationError(context);
437 public void testLogBeFailedAddingResourceInstanceError() throws Exception {
438 BeEcompErrorManager testSubject;
440 String resourceName = "";
441 String serviceId = "";
444 testSubject = createTestSubject();
445 testSubject.logBeFailedAddingResourceInstanceError(context, resourceName, serviceId);
450 public void testLogBeUebSystemError() throws Exception {
451 BeEcompErrorManager testSubject;
453 String operation = "";
456 testSubject = createTestSubject();
457 testSubject.logBeUebSystemError(context, operation);
462 public void testLogBeDistributionEngineSystemError() throws Exception {
463 BeEcompErrorManager testSubject;
465 String operation = "";
468 testSubject = createTestSubject();
469 testSubject.logBeDistributionEngineSystemError(context, operation);
474 public void testLogBeFailedAddingNodeTypeError() throws Exception {
475 BeEcompErrorManager testSubject;
477 String nodeType = "";
480 testSubject = createTestSubject();
481 testSubject.logBeFailedAddingNodeTypeError(context, nodeType);
486 public void testLogBeDaoSystemError() throws Exception {
487 BeEcompErrorManager testSubject;
491 testSubject = createTestSubject();
492 testSubject.logBeDaoSystemError(context);
497 public void testLogBeSystemError() throws Exception {
498 BeEcompErrorManager testSubject;
502 testSubject = createTestSubject();
503 testSubject.logBeSystemError(context);
508 public void testLogBeExecuteRollbackError() throws Exception {
509 BeEcompErrorManager testSubject;
513 testSubject = createTestSubject();
514 testSubject.logBeExecuteRollbackError(context);
519 public void testLogBeFailedLockObjectError() throws Exception {
520 BeEcompErrorManager testSubject;
526 testSubject = createTestSubject();
527 testSubject.logBeFailedLockObjectError(context, type, id);
532 public void testLogBeFailedCreateNodeError() throws Exception {
533 BeEcompErrorManager testSubject;
535 String nodeName = "";
539 testSubject = createTestSubject();
540 testSubject.logBeFailedCreateNodeError(context, nodeName, status);
545 public void testLogBeFailedUpdateNodeError() throws Exception {
546 BeEcompErrorManager testSubject;
548 String nodeName = "";
552 testSubject = createTestSubject();
553 testSubject.logBeFailedUpdateNodeError(context, nodeName, status);
558 public void testLogBeFailedDeleteNodeError() throws Exception {
559 BeEcompErrorManager testSubject;
561 String nodeName = "";
565 testSubject = createTestSubject();
566 testSubject.logBeFailedDeleteNodeError(context, nodeName, status);
571 public void testLogBeFailedRetrieveNodeError() throws Exception {
572 BeEcompErrorManager testSubject;
574 String nodeName = "";
578 testSubject = createTestSubject();
579 testSubject.logBeFailedRetrieveNodeError(context, nodeName, status);
584 public void testLogBeFailedFindParentError() throws Exception {
585 BeEcompErrorManager testSubject;
591 testSubject = createTestSubject();
592 testSubject.logBeFailedFindParentError(context, node, status);
597 public void testLogBeFailedFindAllNodesError() throws Exception {
598 BeEcompErrorManager testSubject;
600 String nodeType = "";
601 String parentNode = "";
605 testSubject = createTestSubject();
606 testSubject.logBeFailedFindAllNodesError(context, nodeType, parentNode, status);
611 public void testLogBeFailedFindAssociationError() throws Exception {
612 BeEcompErrorManager testSubject;
614 String nodeType = "";
615 String fromNode = "";
619 testSubject = createTestSubject();
620 testSubject.logBeFailedFindAssociationError(context, nodeType, fromNode, status);
625 public void testLogBeComponentCleanerSystemError() throws Exception {
626 BeEcompErrorManager testSubject;
628 String operation = "";
631 testSubject = createTestSubject();
632 testSubject.logBeComponentCleanerSystemError(context, operation);
637 public void testLogBeRestApiGeneralError() throws Exception {
638 BeEcompErrorManager testSubject;
642 testSubject = createTestSubject();
643 testSubject.logBeRestApiGeneralError(context);
648 public void testLogFqdnResolveError() throws Exception {
649 BeEcompErrorManager testSubject;
651 String description = "";
654 testSubject = createTestSubject();
655 testSubject.logFqdnResolveError(context, description);
660 public void testLogSiteSwitchoverInfo() throws Exception {
661 BeEcompErrorManager testSubject;
663 String description = "";
666 testSubject = createTestSubject();
667 testSubject.logSiteSwitchoverInfo(context, description);
672 public void testLogInternalAuthenticationError() throws Exception {
673 BeEcompErrorManager testSubject;
675 String description = "";
676 ErrorSeverity severity = null;
679 testSubject = createTestSubject();
681 testSubject.logInternalAuthenticationError(context, description, severity);
686 public void testLogInternalConnectionError() throws Exception {
687 BeEcompErrorManager testSubject;
689 String description = "";
690 ErrorSeverity severity = null;
693 testSubject = createTestSubject();
695 testSubject.logInternalConnectionError(context, description, severity);
700 public void testLogInternalDataError() throws Exception {
701 BeEcompErrorManager testSubject;
703 String description = "";
704 ErrorSeverity severity = null;
707 testSubject = createTestSubject();
709 testSubject.logInternalDataError(context, description, severity);
714 public void testLogInvalidInputError() throws Exception {
715 BeEcompErrorManager testSubject;
717 String description = "";
718 ErrorSeverity severity = null;
721 testSubject = createTestSubject();
723 testSubject.logInvalidInputError(context, description, severity);
728 public void testLogInternalFlowError() throws Exception {
729 BeEcompErrorManager testSubject;
731 String description = "";
732 ErrorSeverity severity = null;
735 testSubject = createTestSubject();
737 testSubject.logInternalFlowError(context, description, severity);
742 public void testLogInternalUnexpectedError() throws Exception {
743 BeEcompErrorManager testSubject;
745 String description = "";
746 ErrorSeverity severity = null;
749 testSubject = createTestSubject();
751 testSubject.logInternalUnexpectedError(context, description, severity);