Search in sources :

Example 1 with DynamoUploadSchema

use of org.sagebionetworks.bridge.dynamodb.DynamoUploadSchema in project BridgeServer2 by Sage-Bionetworks.

the class UploadSchemaTest method getKeyFromEmptyApp.

@Test
public void getKeyFromEmptyApp() {
    DynamoUploadSchema ddbUploadSchema = new DynamoUploadSchema();
    ddbUploadSchema.setAppId("");
    ddbUploadSchema.setSchemaId("test");
    assertNull(ddbUploadSchema.getKey());
}
Also used : DynamoUploadSchema(org.sagebionetworks.bridge.dynamodb.DynamoUploadSchema) Test(org.testng.annotations.Test)

Example 2 with DynamoUploadSchema

use of org.sagebionetworks.bridge.dynamodb.DynamoUploadSchema in project BridgeServer2 by Sage-Bionetworks.

the class UploadSchemaTest method getKeyFromBlankApp.

@Test
public void getKeyFromBlankApp() {
    DynamoUploadSchema ddbUploadSchema = new DynamoUploadSchema();
    ddbUploadSchema.setAppId("   ");
    ddbUploadSchema.setSchemaId("test");
    assertNull(ddbUploadSchema.getKey());
}
Also used : DynamoUploadSchema(org.sagebionetworks.bridge.dynamodb.DynamoUploadSchema) Test(org.testng.annotations.Test)

Example 3 with DynamoUploadSchema

use of org.sagebionetworks.bridge.dynamodb.DynamoUploadSchema in project BridgeServer2 by Sage-Bionetworks.

the class UploadSchemaTest method keyWithEmptyApp.

@Test(expectedExceptions = IllegalArgumentException.class)
public void keyWithEmptyApp() {
    DynamoUploadSchema ddbUploadSchema = new DynamoUploadSchema();
    ddbUploadSchema.setKey(":test");
}
Also used : DynamoUploadSchema(org.sagebionetworks.bridge.dynamodb.DynamoUploadSchema) Test(org.testng.annotations.Test)

Example 4 with DynamoUploadSchema

use of org.sagebionetworks.bridge.dynamodb.DynamoUploadSchema in project BridgeServer2 by Sage-Bionetworks.

the class UploadSchemaTest method getAppAndSchemaFromKey.

@Test
public void getAppAndSchemaFromKey() {
    DynamoUploadSchema ddbUploadSchema = new DynamoUploadSchema();
    ddbUploadSchema.setKey(TEST_APP_ID + ":test");
    assertEquals(ddbUploadSchema.getAppId(), TEST_APP_ID);
    assertEquals(ddbUploadSchema.getStudyId(), TEST_APP_ID);
    assertEquals(ddbUploadSchema.getSchemaId(), "test");
}
Also used : DynamoUploadSchema(org.sagebionetworks.bridge.dynamodb.DynamoUploadSchema) Test(org.testng.annotations.Test)

Example 5 with DynamoUploadSchema

use of org.sagebionetworks.bridge.dynamodb.DynamoUploadSchema in project BridgeServer2 by Sage-Bionetworks.

the class UploadSchemaTest method schemaKeyObject.

@Test
public void schemaKeyObject() {
    DynamoUploadSchema schema = new DynamoUploadSchema();
    schema.setAppId(TEST_APP_ID);
    schema.setSchemaId("test-schema");
    schema.setRevision(7);
    assertEquals(schema.getSchemaKey().toString(), TEST_APP_ID + "-test-schema-v7");
}
Also used : DynamoUploadSchema(org.sagebionetworks.bridge.dynamodb.DynamoUploadSchema) Test(org.testng.annotations.Test)

Aggregations

DynamoUploadSchema (org.sagebionetworks.bridge.dynamodb.DynamoUploadSchema)17 Test (org.testng.annotations.Test)16 JsonNode (com.fasterxml.jackson.databind.JsonNode)1 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)1