Search in sources :

Example 1 with ResourceLocatorAdaptor

use of org.activityinfo.ui.client.dispatch.ResourceLocatorAdaptor in project activityinfo by bedatadriven.

the class GcsBlobFieldStorageServiceTest method uploadBlob.

@Before
public final void uploadBlob() throws IOException {
    localServiceTestHelper.setUp();
    ofy = ObjectifyService.begin();
    blobService = injector.getInstance(GcsBlobFieldStorageService.class);
    blobService.setTestBucketName();
    locator = new ResourceLocatorAdaptor(new ActivityInfoClientAsyncStub(injector.getProvider(EntityManager.class), blobService));
    AuthenticationModuleStub.setUserId(1);
    user = new AuthenticatedUser("x", 1, "user1@user.com");
    noAccessUser = new AuthenticatedUser("x", 3, "stefan@user.com");
    blobId = BlobId.generate();
    blobService.put(user, "attachment;filename=" + FILE_NAME, MimeTypeUtil.mimeTypeFromFileName(FILE_NAME), blobId, resourceId, GcsBlobFieldStorageServiceTest.class.getResourceAsStream("goabout.png"));
}
Also used : EntityManager(javax.persistence.EntityManager) ResourceLocatorAdaptor(org.activityinfo.ui.client.dispatch.ResourceLocatorAdaptor) ActivityInfoClientAsyncStub(org.activityinfo.legacy.shared.adapter.ActivityInfoClientAsyncStub) AuthenticatedUser(org.activityinfo.legacy.shared.AuthenticatedUser) Before(org.junit.Before)

Aggregations

EntityManager (javax.persistence.EntityManager)1 AuthenticatedUser (org.activityinfo.legacy.shared.AuthenticatedUser)1 ActivityInfoClientAsyncStub (org.activityinfo.legacy.shared.adapter.ActivityInfoClientAsyncStub)1 ResourceLocatorAdaptor (org.activityinfo.ui.client.dispatch.ResourceLocatorAdaptor)1 Before (org.junit.Before)1