Search in sources :

Example 1 with S3Helper

use of org.sagebionetworks.bridge.s3.S3Helper in project BridgeServer2 by Sage-Bionetworks.

the class UploadCertificateServiceTest method getPublicKeyAsPemThrowsException.

@Test(expectedExceptions = BridgeServiceException.class)
public void getPublicKeyAsPemThrowsException() throws Exception {
    S3Helper mockS3CmsHelper = mock(S3Helper.class);
    svc.setS3CmsHelper(mockS3CmsHelper);
    when(mockS3CmsHelper.readS3FileAsString(any(), any())).thenThrow(new IOException());
    svc.getPublicKeyAsPem(TEST_APP_ID);
}
Also used : S3Helper(org.sagebionetworks.bridge.s3.S3Helper) IOException(java.io.IOException) Test(org.testng.annotations.Test)

Example 2 with S3Helper

use of org.sagebionetworks.bridge.s3.S3Helper in project BridgeServer2 by Sage-Bionetworks.

the class UploadCertificateServiceTest method getPublicKeyAsPem.

@Test
public void getPublicKeyAsPem() throws Exception {
    S3Helper mockS3CmsHelper = mock(S3Helper.class);
    svc.setS3CmsHelper(mockS3CmsHelper);
    svc.getPublicKeyAsPem(TEST_APP_ID);
    verify(mockS3CmsHelper).readS3FileAsString(BridgeConfigFactory.getConfig().getProperty("upload.cms.cert.bucket"), TEST_APP_ID + ".pem");
}
Also used : S3Helper(org.sagebionetworks.bridge.s3.S3Helper) Test(org.testng.annotations.Test)

Example 3 with S3Helper

use of org.sagebionetworks.bridge.s3.S3Helper in project synapse by otto-de.

the class InMemCompactionAcceptanceTest method setup.

@Before
public void setup() throws IOException {
    deleteSnapshotFilesFromTemp();
    s3Helper = new S3Helper(s3Client);
    s3Helper.createBucket(INTEGRATION_TEST_BUCKET);
    s3Helper.deleteAllObjectsInBucket(INTEGRATION_TEST_BUCKET);
}
Also used : S3Helper(de.otto.synapse.helper.s3.S3Helper) Before(org.junit.Before)

Example 4 with S3Helper

use of org.sagebionetworks.bridge.s3.S3Helper in project synapse by otto-de.

the class KinesisCompactionAcceptanceTest method setup.

@Before
public void setup() throws IOException {
    deleteSnapshotFilesFromTemp();
    s3Helper = new S3Helper(s3Client);
    s3Helper.createBucket(INTEGRATION_TEST_BUCKET);
    s3Helper.deleteAllObjectsInBucket(INTEGRATION_TEST_BUCKET);
}
Also used : S3Helper(de.otto.synapse.helper.s3.S3Helper) Before(org.junit.Before)

Example 5 with S3Helper

use of org.sagebionetworks.bridge.s3.S3Helper in project BridgeServer2 by Sage-Bionetworks.

the class SpringConfig method s3Helper.

@Bean(name = "s3Helper")
@Resource(name = "s3Client")
public S3Helper s3Helper(AmazonS3Client s3Client) {
    S3Helper s3Helper = new S3Helper();
    s3Helper.setS3Client(s3Client);
    return s3Helper;
}
Also used : S3Helper(org.sagebionetworks.bridge.s3.S3Helper) Resource(javax.annotation.Resource) HibernateAssessmentResource(org.sagebionetworks.bridge.models.assessments.HibernateAssessmentResource) FilterRegistrationBean(org.springframework.boot.web.servlet.FilterRegistrationBean) Bean(org.springframework.context.annotation.Bean)

Aggregations

S3Helper (org.sagebionetworks.bridge.s3.S3Helper)5 S3Helper (de.otto.synapse.helper.s3.S3Helper)4 Before (org.junit.Before)4 Test (org.testng.annotations.Test)3 File (java.io.File)2 ImmutableMap (com.google.common.collect.ImmutableMap)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Resource (javax.annotation.Resource)1 DigestUtils (org.apache.commons.codec.digest.DigestUtils)1 DynamoUpload2 (org.sagebionetworks.bridge.dynamodb.DynamoUpload2)1 InMemoryFileHelper (org.sagebionetworks.bridge.file.InMemoryFileHelper)1 GuidCreatedOnVersionHolderImpl (org.sagebionetworks.bridge.models.GuidCreatedOnVersionHolderImpl)1 Account (org.sagebionetworks.bridge.models.accounts.Account)1 HibernateAssessmentResource (org.sagebionetworks.bridge.models.assessments.HibernateAssessmentResource)1 Enrollment (org.sagebionetworks.bridge.models.studies.Enrollment)1 AccountService (org.sagebionetworks.bridge.services.AccountService)1 AppService (org.sagebionetworks.bridge.services.AppService)1