Search in sources :

Example 11 with BridgeConfig

use of org.sagebionetworks.bridge.config.BridgeConfig in project BridgeServer2 by Sage-Bionetworks.

the class ParticipantVersionServiceTest method before.

@BeforeMethod
public void before() {
    MockitoAnnotations.initMocks(this);
    // Mock config. This is done separately because we need to set mock config params.
    BridgeConfig mockConfig = mock(BridgeConfig.class);
    when(mockConfig.getProperty(BridgeConstants.CONFIG_KEY_WORKER_SQS_URL)).thenReturn(WORKER_QUEUE_URL);
    participantVersionService.setConfig(mockConfig);
    // Mock app service.
    app = TestUtils.getValidApp(ParticipantVersionServiceTest.class);
    app.setExporter3Enabled(true);
    when(mockAppService.getApp(TestConstants.TEST_APP_ID)).thenReturn(app);
}
Also used : BridgeConfig(org.sagebionetworks.bridge.config.BridgeConfig) BeforeMethod(org.testng.annotations.BeforeMethod)

Example 12 with BridgeConfig

use of org.sagebionetworks.bridge.config.BridgeConfig in project BridgeServer2 by Sage-Bionetworks.

the class UploadServiceUploadCompleteTest method setup.

@BeforeMethod
public void setup() {
    MockitoAnnotations.initMocks(this);
    // Mock config. This is done separately because we need to set mock config params.
    BridgeConfig mockConfig = mock(BridgeConfig.class);
    when(mockConfig.getProperty(UploadService.CONFIG_KEY_UPLOAD_BUCKET)).thenReturn(TEST_BUCKET);
    svc.setConfig(mockConfig);
    // Mock app service. Exporter 3 is disabled for most of the tests.
    app = TestUtils.getValidApp(Exporter3ServiceTest.class);
    app.setExporter3Enabled(false);
    when(mockAppService.getApp(TestConstants.TEST_APP_ID)).thenReturn(app);
}
Also used : BridgeConfig(org.sagebionetworks.bridge.config.BridgeConfig) BeforeMethod(org.testng.annotations.BeforeMethod)

Aggregations

BridgeConfig (org.sagebionetworks.bridge.config.BridgeConfig)12 BeforeMethod (org.testng.annotations.BeforeMethod)8 Test (org.testng.annotations.Test)3 AmazonSQSClient (com.amazonaws.services.sqs.AmazonSQSClient)2 SendMessageResult (com.amazonaws.services.sqs.model.SendMessageResult)2 JsonNode (com.fasterxml.jackson.databind.JsonNode)2 AWSSessionCredentials (com.amazonaws.auth.AWSSessionCredentials)1 AmazonS3 (com.amazonaws.services.s3.AmazonS3)1 GeneratePresignedUrlRequest (com.amazonaws.services.s3.model.GeneratePresignedUrlRequest)1 AmazonSimpleEmailServiceClient (com.amazonaws.services.simpleemail.AmazonSimpleEmailServiceClient)1 SetIdentityNotificationTopicRequest (com.amazonaws.services.simpleemail.model.SetIdentityNotificationTopicRequest)1 SetIdentityNotificationTopicResult (com.amazonaws.services.simpleemail.model.SetIdentityNotificationTopicResult)1 VerifyEmailIdentityResult (com.amazonaws.services.simpleemail.model.VerifyEmailIdentityResult)1 URL (java.net.URL)1 UploadDao (org.sagebionetworks.bridge.dao.UploadDao)1 UploadDedupeDao (org.sagebionetworks.bridge.dao.UploadDedupeDao)1 DateRange (org.sagebionetworks.bridge.models.DateRange)1 ConfigResolver (org.sagebionetworks.bridge.models.appconfig.ConfigResolver)1 UploadRequest (org.sagebionetworks.bridge.models.upload.UploadRequest)1 StudyConsentValidator (org.sagebionetworks.bridge.validators.StudyConsentValidator)1