aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-model/src/test
diff options
context:
space:
mode:
authorChrisC <christophe.closset@intl.att.com>2020-06-19 10:26:12 +0200
committerOfir Sonsino <ofir.sonsino@intl.att.com>2020-06-19 11:12:20 +0000
commit9ca59353f28ed9dcd6dbd7ece6063e7ff7d64cc8 (patch)
treeeb1fe7261d9e82851144c34b6f6ec5fddba9770d /catalog-model/src/test
parent4503c8bb6c271fdb045620d3cf05423b556f2fca (diff)
Fix Sonar issues
Assert params updated to be in correct order Issue-ID: SDC-3116 Signed-off-by: ChrisC <christophe.closset@intl.att.com> Change-Id: I8be2dec4a1d5ec9ab59ea8fddab540958fe25511
Diffstat (limited to 'catalog-model/src/test')
-rw-r--r--catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/DaoStatusConverterTest.java95
1 files changed, 46 insertions, 49 deletions
diff --git a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/DaoStatusConverterTest.java b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/DaoStatusConverterTest.java
index 4a71c9106a..7a0884ae21 100644
--- a/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/DaoStatusConverterTest.java
+++ b/catalog-model/src/test/java/org/openecomp/sdc/be/model/operations/impl/DaoStatusConverterTest.java
@@ -3,6 +3,7 @@
* SDC
* ================================================================================
* Copyright (C) 2019 Nokia. All rights reserved.
+ * Modifications (C) 2020 AT&T.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,58 +32,54 @@ public class DaoStatusConverterTest {
@Test
public void shouldConvertJanusGraphStatusToStorageStatus() {
- assertEquals(DaoStatusConverter.convertJanusGraphStatusToStorageStatus(null),
- StorageOperationStatus.GENERAL_ERROR);
- assertEquals(DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.OK),
- StorageOperationStatus.OK);
- assertEquals(DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.NOT_CONNECTED),
- StorageOperationStatus.CONNECTION_FAILURE);
- assertEquals(DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.NOT_FOUND),
- StorageOperationStatus.NOT_FOUND);
- assertEquals(DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.NOT_CREATED),
- StorageOperationStatus.SCHEMA_ERROR);
- assertEquals(DaoStatusConverter
- .convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.INDEX_CANNOT_BE_CHANGED),
- StorageOperationStatus.SCHEMA_ERROR);
- assertEquals(
- DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.MISSING_UNIQUE_ID),
- StorageOperationStatus.BAD_REQUEST);
- assertEquals(
- DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.ALREADY_LOCKED),
- StorageOperationStatus.FAILED_TO_LOCK_ELEMENT);
- assertEquals(DaoStatusConverter.convertJanusGraphStatusToStorageStatus(
- JanusGraphOperationStatus.JANUSGRAPH_SCHEMA_VIOLATION), StorageOperationStatus.SCHEMA_VIOLATION);
- assertEquals(DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.INVALID_ID),
- StorageOperationStatus.INVALID_ID);
- assertEquals(
- DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.MATCH_NOT_FOUND),
- StorageOperationStatus.MATCH_NOT_FOUND);
- assertEquals(
- DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.ILLEGAL_ARGUMENT),
- StorageOperationStatus.BAD_REQUEST);
- assertEquals(DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.ALREADY_EXIST),
- StorageOperationStatus.ENTITY_ALREADY_EXISTS);
- assertEquals(DaoStatusConverter.convertJanusGraphStatusToStorageStatus(
- JanusGraphOperationStatus.PROPERTY_NAME_ALREADY_EXISTS),
- StorageOperationStatus.PROPERTY_NAME_ALREADY_EXISTS);
- assertEquals(
- DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.INVALID_PROPERTY),
- StorageOperationStatus.INVALID_PROPERTY);
+ assertEquals(StorageOperationStatus.GENERAL_ERROR,
+ DaoStatusConverter.convertJanusGraphStatusToStorageStatus(null));
+ assertEquals(StorageOperationStatus.OK,
+ DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.OK));
+ assertEquals(StorageOperationStatus.CONNECTION_FAILURE,
+ DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.NOT_CONNECTED));
+ assertEquals(StorageOperationStatus.NOT_FOUND,
+ DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.NOT_FOUND));
+ assertEquals(StorageOperationStatus.SCHEMA_ERROR,
+ DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.NOT_CREATED));
+ assertEquals(StorageOperationStatus.SCHEMA_ERROR,
+ DaoStatusConverter
+ .convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.INDEX_CANNOT_BE_CHANGED));
+ assertEquals(StorageOperationStatus.BAD_REQUEST,
+ DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.MISSING_UNIQUE_ID));
+ assertEquals(StorageOperationStatus.FAILED_TO_LOCK_ELEMENT,
+ DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.ALREADY_LOCKED));
+ assertEquals(StorageOperationStatus.SCHEMA_VIOLATION,
+ DaoStatusConverter.
+ convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.JANUSGRAPH_SCHEMA_VIOLATION));
+ assertEquals(StorageOperationStatus.INVALID_ID,
+ DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.INVALID_ID));
+ assertEquals(StorageOperationStatus.MATCH_NOT_FOUND,
+ DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.MATCH_NOT_FOUND));
+ assertEquals(StorageOperationStatus.BAD_REQUEST,
+ DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.ILLEGAL_ARGUMENT));
+ assertEquals(StorageOperationStatus.ENTITY_ALREADY_EXISTS,
+ DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.ALREADY_EXIST));
+ assertEquals(StorageOperationStatus.PROPERTY_NAME_ALREADY_EXISTS,
+ DaoStatusConverter.convertJanusGraphStatusToStorageStatus(
+ JanusGraphOperationStatus.PROPERTY_NAME_ALREADY_EXISTS));
+ assertEquals(StorageOperationStatus.INVALID_PROPERTY,
+ DaoStatusConverter.convertJanusGraphStatusToStorageStatus(JanusGraphOperationStatus.INVALID_PROPERTY));
}
@Test
public void shouldConvertCassandraStatusToStorageStatus() {
- assertEquals(DaoStatusConverter.convertCassandraStatusToStorageStatus(null),
- StorageOperationStatus.GENERAL_ERROR);
- assertEquals(DaoStatusConverter.convertCassandraStatusToStorageStatus(CassandraOperationStatus.OK),
- StorageOperationStatus.OK);
- assertEquals(DaoStatusConverter
- .convertCassandraStatusToStorageStatus(CassandraOperationStatus.CLUSTER_NOT_CONNECTED),
- StorageOperationStatus.CONNECTION_FAILURE);
- assertEquals(DaoStatusConverter
- .convertCassandraStatusToStorageStatus(CassandraOperationStatus.KEYSPACE_NOT_CONNECTED),
- StorageOperationStatus.STORAGE_NOT_AVAILABLE);
- assertEquals(DaoStatusConverter.convertCassandraStatusToStorageStatus(CassandraOperationStatus.NOT_FOUND),
- StorageOperationStatus.NOT_FOUND);
+ assertEquals(StorageOperationStatus.GENERAL_ERROR,
+ DaoStatusConverter.convertCassandraStatusToStorageStatus(null));
+ assertEquals(StorageOperationStatus.OK,
+ DaoStatusConverter.convertCassandraStatusToStorageStatus(CassandraOperationStatus.OK));
+ assertEquals(StorageOperationStatus.CONNECTION_FAILURE,
+ DaoStatusConverter
+ .convertCassandraStatusToStorageStatus(CassandraOperationStatus.CLUSTER_NOT_CONNECTED));
+ assertEquals(StorageOperationStatus.STORAGE_NOT_AVAILABLE,
+ DaoStatusConverter
+ .convertCassandraStatusToStorageStatus(CassandraOperationStatus.KEYSPACE_NOT_CONNECTED));
+ assertEquals(StorageOperationStatus.NOT_FOUND,
+ DaoStatusConverter.convertCassandraStatusToStorageStatus(CassandraOperationStatus.NOT_FOUND));
}
} \ No newline at end of file