use of com.formkiq.stacks.dynamodb.DynamoDbHelper in project formkiq-core by formkiq.
the class DynamoDbExtension method beforeAll.
@Override
public void beforeAll(final ExtensionContext context) throws Exception {
this.dynamoDbLocal = DynamoDbTestServices.getDynamoDbLocal();
this.dynamoDbLocal.start();
this.dbConnection = DynamoDbTestServices.getDynamoDbConnection(this.dynamoDbLocal);
this.dbhelper = new DynamoDbHelper(DynamoDbTestServices.getDynamoDbConnection(this.dynamoDbLocal));
DynamoDbHelper dbHelper = new DynamoDbHelper(this.dbConnection);
if (!dbHelper.isDocumentsTableExists()) {
dbHelper.createDocumentsTable();
}
if (!dbHelper.isCacheTableExists()) {
dbHelper.createCacheTable();
}
}
use of com.formkiq.stacks.dynamodb.DynamoDbHelper in project formkiq-core by formkiq.
the class DocumentsRestrictionsMaxContentLengthTest method before.
/**
* Before Tests.
* @throws URISyntaxException URISyntaxException
* @throws IOException IOException
*/
@BeforeEach
public void before() throws URISyntaxException, IOException {
DynamoDbConnectionBuilder adb = DynamoDbTestServices.getDynamoDbConnection(null);
DynamoDbHelper dbhelper = new DynamoDbHelper(adb);
this.awsservice = new AwsServiceCache().dbConnection(adb, dbhelper.getDocumentTable(), "").appEnvironment("unittest");
}
use of com.formkiq.stacks.dynamodb.DynamoDbHelper in project formkiq-core by formkiq.
the class DocumentsS3UpdateTest method beforeClass.
/**
* Before Class.
*
* @throws URISyntaxException URISyntaxException
* @throws InterruptedException InterruptedException
* @throws IOException IOException
*/
@BeforeAll
public static void beforeClass() throws URISyntaxException, InterruptedException, IOException {
Region region = Region.US_EAST_1;
AwsCredentialsProvider cred = StaticCredentialsProvider.create(AwsSessionCredentials.create("ACCESSKEY", "SECRETKEY", "TOKENKEY"));
localstack.start();
snsBuilder = new SnsConnectionBuilder().setEndpointOverride(localstack.getEndpointOverride(Service.SNS).toString()).setRegion(region).setCredentials(cred);
sqsBuilder = new SqsConnectionBuilder().setEndpointOverride(localstack.getEndpointOverride(Service.SQS).toString()).setRegion(region).setCredentials(cred);
sqsService = new SqsService(sqsBuilder);
s3Builder = new S3ConnectionBuilder().setEndpointOverride(localstack.getEndpointOverride(Service.S3).toString()).setRegion(region).setCredentials(cred);
dbBuilder = DynamoDbTestServices.getDynamoDbConnection(null);
service = new DocumentServiceImpl(dbBuilder, "Documents");
if (!sqsService.exists(ERROR_SQS_QUEUE)) {
sqsService.createQueue(ERROR_SQS_QUEUE);
}
if (!sqsService.exists(SNS_SQS_CREATE_QUEUE)) {
sqsDocumentEventUrl = sqsService.createQueue(SNS_SQS_CREATE_QUEUE).queueUrl();
}
s3service = new S3Service(s3Builder);
try (S3Client s3 = s3service.buildClient()) {
s3service.createBucket(s3, "example-bucket");
}
snsService = new SnsService(snsBuilder);
snsDocumentEvent = snsService.createTopic("createDocument1").topicArn();
snsService.subscribe(snsDocumentEvent, "sqs", sqsDocumentEventUrl);
dbHelper = new DynamoDbHelper(dbBuilder);
if (!dbHelper.isDocumentsTableExists()) {
dbHelper.createDocumentsTable();
dbHelper.createCacheTable();
}
}
use of com.formkiq.stacks.dynamodb.DynamoDbHelper in project formkiq-core by formkiq.
the class DynamoDbExtension method beforeAll.
@Override
public void beforeAll(final ExtensionContext context) throws Exception {
this.dynamoDbLocal = DynamoDbTestServices.getDynamoDbLocal();
this.dynamoDbLocal.start();
this.dbConnection = DynamoDbTestServices.getDynamoDbConnection(this.dynamoDbLocal);
this.dbhelper = new DynamoDbHelper(DynamoDbTestServices.getDynamoDbConnection(this.dynamoDbLocal));
DynamoDbHelper dbHelper = new DynamoDbHelper(this.dbConnection);
if (!dbHelper.isDocumentsTableExists()) {
dbHelper.createDocumentsTable();
}
if (!dbHelper.isCacheTableExists()) {
dbHelper.createCacheTable();
}
}
Aggregations