summaryrefslogtreecommitdiffstats
path: root/catalog-model/src/test
diff options
context:
space:
mode:
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