refs #2222: Move infrastructure tests outside of components junit tests
https://support.d4science.org/issues/2222 git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/private/luca.frosini/infrastructure-tests@124072 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
4f15d5b3b0
commit
d0487f0ae0
|
@ -8,6 +8,7 @@ import java.net.URL;
|
|||
import org.gcube.accounting.datamodel.basetypes.TestUsageRecord;
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.documentstore.records.Record;
|
||||
import org.gcube.utils.TestUtility;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
|
@ -37,7 +38,7 @@ public class PersistenceCouchBaseTest {
|
|||
|
||||
@Test
|
||||
public void testJsonNodeUsageRecordConversions() throws Exception {
|
||||
Record record = TestUsageRecord.createTestServiceUsageRecordAutomaticScope();
|
||||
Record record = TestUsageRecord.createTestServiceUsageRecord();
|
||||
logger.debug("UsageRecord : {}", record.toString());
|
||||
JsonNode node = PersistenceCouchBase.usageRecordToJsonNode(record);
|
||||
logger.debug("Node : {}", node.toString());
|
||||
|
@ -48,7 +49,7 @@ public class PersistenceCouchBaseTest {
|
|||
|
||||
@Test
|
||||
public void testJsonNodeUsageRecordConversionsWithNestedMap() throws Exception {
|
||||
Record record = TestUsageRecord.createTestTaskUsageRecordAutomaticScope();
|
||||
Record record = TestUsageRecord.createTestTaskUsageRecord();
|
||||
logger.debug("UsageRecord : {}", record.toString());
|
||||
JsonNode node = PersistenceCouchBase.usageRecordToJsonNode(record);
|
||||
logger.debug("Node : {}", node.toString());
|
||||
|
@ -70,7 +71,7 @@ public class PersistenceCouchBaseTest {
|
|||
PersistenceCouchBase couchBase = new PersistenceCouchBase();
|
||||
couchBase.prepareConnection(persitenceConfiguration);
|
||||
|
||||
Record record = TestUsageRecord.createTestServiceUsageRecordAutomaticScope();
|
||||
Record record = TestUsageRecord.createTestServiceUsageRecord();
|
||||
couchBase.reallyAccount(record);
|
||||
}
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class PersistenceCouchDBTest {
|
|||
|
||||
@Test
|
||||
public void testJsonNodeUsageRecordConversions() throws Exception {
|
||||
Record record = TestUsageRecord.createTestServiceUsageRecordAutomaticScope();
|
||||
Record record = TestUsageRecord.createTestServiceUsageRecord();
|
||||
logger.debug("UsageRecord : {}", record.toString());
|
||||
JsonNode node = PersistenceCouchDB.usageRecordToJsonNode(record);
|
||||
logger.debug("Node : {}", node.toString());
|
||||
|
@ -48,7 +48,7 @@ public class PersistenceCouchDBTest {
|
|||
|
||||
@Test
|
||||
public void testJsonNodeUsageRecordConversionsWithNestedMap() throws Exception {
|
||||
Record record = TestUsageRecord.createTestTaskUsageRecordAutomaticScope();
|
||||
Record record = TestUsageRecord.createTestTaskUsageRecord();
|
||||
logger.debug("UsageRecord : {}", record.toString());
|
||||
JsonNode node = PersistenceCouchDB.usageRecordToJsonNode(record);
|
||||
logger.debug("Node : {}", node.toString());
|
||||
|
@ -77,7 +77,7 @@ public class PersistenceCouchDBTest {
|
|||
PersistenceCouchDB couch = new PersistenceCouchDB();
|
||||
couch.prepareConnection(persitenceConfiguration);
|
||||
|
||||
Record record = TestUsageRecord.createTestServiceUsageRecordAutomaticScope();
|
||||
Record record = TestUsageRecord.createTestServiceUsageRecord();
|
||||
couch.reallyAccount(record);
|
||||
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ import org.gcube.accounting.datamodel.basetypes.AbstractStorageUsageRecord.Opera
|
|||
import org.gcube.accounting.datamodel.basetypes.TestUsageRecord;
|
||||
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
|
||||
import org.gcube.documentstore.records.Record;
|
||||
import org.gcube.utils.TestUtility;
|
||||
import org.junit.After;
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
||||
|
@ -38,7 +39,7 @@ public class PersistenceMongoDBTest {
|
|||
|
||||
@Test
|
||||
public void testJsonNodeUsageRecordConversions() throws Exception {
|
||||
Record record = TestUsageRecord.createTestServiceUsageRecordAutomaticScope();
|
||||
Record record = TestUsageRecord.createTestServiceUsageRecord();
|
||||
logger.debug("UsageRecord : {}", record.toString());
|
||||
Document document = PersistenceMongoDB.usageRecordToDocument(record);
|
||||
logger.debug("Document : {}", document.toString());
|
||||
|
@ -49,7 +50,7 @@ public class PersistenceMongoDBTest {
|
|||
|
||||
@Test
|
||||
public void testJsonNodeUsageRecordConversionsWithNestedMap() throws Exception {
|
||||
Record record = TestUsageRecord.createTestTaskUsageRecordAutomaticScope();
|
||||
Record record = TestUsageRecord.createTestTaskUsageRecord();
|
||||
logger.debug("UsageRecord : {}", record.toString());
|
||||
Document document = PersistenceMongoDB.usageRecordToDocument(record);
|
||||
logger.debug("Document : {}", document.toString());
|
||||
|
@ -76,15 +77,15 @@ public class PersistenceMongoDBTest {
|
|||
mongo.prepareConnection(persitenceConfiguration);
|
||||
|
||||
|
||||
Record record = TestUsageRecord.createTestServiceUsageRecordAutomaticScope();
|
||||
Record record = TestUsageRecord.createTestServiceUsageRecord();
|
||||
record.setResourceProperty("Test", AUX.TESTER);
|
||||
mongo.reallyAccount(record);
|
||||
|
||||
record = TestUsageRecord.createTestStorageUsageRecordAutomaticScope();
|
||||
record = TestUsageRecord.createTestStorageUsageRecord();
|
||||
record.setResourceProperty("Test", AUX.TESTER);
|
||||
mongo.reallyAccount(record);
|
||||
|
||||
record = TestUsageRecord.createTestJobUsageRecordAutomaticScope();
|
||||
record = TestUsageRecord.createTestJobUsageRecord();
|
||||
mongo.reallyAccount(record);
|
||||
|
||||
}
|
||||
|
|
|
@ -23,6 +23,7 @@ import org.slf4j.LoggerFactory;
|
|||
public class TestUtility {
|
||||
|
||||
public static final String TOKEN = "";
|
||||
public static final String PARENT_TOKEN = "";
|
||||
|
||||
/**
|
||||
* Logger
|
||||
|
|
Loading…
Reference in New Issue