Search in sources :

Example 1 with ExtensionContext

use of org.datatransferproject.api.launcher.ExtensionContext in project data-transfer-project by google.

the class JobPollingServiceTest method setUp.

@Before
public void setUp() {
    store = new LocalJobStore();
    PublicKeySerializer serializer = new PublicKeySerializer() {

        @Override
        public boolean canHandle(String scheme) {
            return true;
        }

        @Override
        public String serialize(byte[] encodedPublicKey) throws SecurityException {
            return "key";
        }
    };
    Scheduler scheduler = Scheduler.newFixedDelaySchedule(0, 20, TimeUnit.SECONDS);
    Monitor monitor = new Monitor() {
    };
    ExtensionContext extensionContext = mock(ExtensionContext.class);
    when(extensionContext.getSetting("credTimeoutSeconds", 300)).thenReturn(300);
    jobPollingService = new JobPollingService(store, asymmetricKeyGenerator, serializer, scheduler, monitor, extensionContext);
}
Also used : LocalJobStore(org.datatransferproject.cloud.local.LocalJobStore) Monitor(org.datatransferproject.api.launcher.Monitor) PublicKeySerializer(org.datatransferproject.spi.transfer.security.PublicKeySerializer) Scheduler(com.google.common.util.concurrent.AbstractScheduledService.Scheduler) ExtensionContext(org.datatransferproject.api.launcher.ExtensionContext) Before(org.junit.Before)

Aggregations

Scheduler (com.google.common.util.concurrent.AbstractScheduledService.Scheduler)1 ExtensionContext (org.datatransferproject.api.launcher.ExtensionContext)1 Monitor (org.datatransferproject.api.launcher.Monitor)1 LocalJobStore (org.datatransferproject.cloud.local.LocalJobStore)1 PublicKeySerializer (org.datatransferproject.spi.transfer.security.PublicKeySerializer)1 Before (org.junit.Before)1