S3TaskClientImpl implements S3TaskClient { @Override public GetSignedUrlTaskResult getSignedUrl(String spaceId, String contentId, String resourcePrefix) throws ContentStoreException { int defaultExpire = GetSignedUrlTaskParameters.USE_DEFAULT_MINUTES_TO_EXPIRE; return getSignedUrl(spaceId, contentId, resourcePrefix, defaultExpire, null); } S3TaskClientImpl(ContentStore contentStore); @Override EnableStreamingTaskResult enableStreaming(String spaceId, boolean secure); @Override DisableStreamingTaskResult disableStreaming(String spaceId); @Override DeleteStreamingTaskResult deleteStreaming(String spaceId); @Override GetUrlTaskResult getUrl(String spaceId,
                                   String contentId,
                                   String resourcePrefix); @Override GetSignedUrlTaskResult getSignedUrl(String spaceId,
                                               String contentId,
                                               String resourcePrefix); @Override GetSignedUrlTaskResult getSignedUrl(String spaceId,
                                               String contentId,
                                               String resourcePrefix,
                                               int minutesToExpire,
                                               String ipAddress); @Override EnableStreamingTaskResult enableHlsStreaming(String spaceId, boolean secure); @Override DisableStreamingTaskResult disableHlsStreaming(String spaceId); @Override DeleteStreamingTaskResult deleteHlsStreaming(String spaceId); @Override GetUrlTaskResult getHlsUrl(String spaceId, String contentId); @Override GetSignedCookiesUrlTaskResult getSignedCookiesUrl(String spaceId,
                                                             String ipAddress,
                                                             int minutesToExpire,
                                                             String redirectUrl);  }
@Test public void testGetSignedUrlShort() throws Exception { String taskName = StorageTaskConstants.GET_SIGNED_URL_TASK_NAME; String signedUrl = "signed-url"; GetSignedUrlTaskResult preparedResult = new GetSignedUrlTaskResult(); preparedResult.setSignedUrl(signedUrl); setupMock(taskName, preparedResult.serialize()); replayMocks(); GetSignedUrlTaskResult result = taskClient.getSignedUrl(spaceId, contentId, resourcePrefix); assertThat(signedUrl, equalTo(result.getSignedUrl())); }
@Test public void testGetSignedUrl() throws Exception { String taskName = StorageTaskConstants.GET_SIGNED_URL_TASK_NAME; String signedUrl = "signed-url"; GetSignedUrlTaskResult preparedResult = new GetSignedUrlTaskResult(); preparedResult.setSignedUrl(signedUrl); setupMock(taskName, preparedResult.serialize()); replayMocks(); GetSignedUrlTaskResult result = taskClient.getSignedUrl(spaceId, contentId, resourcePrefix, 42, "ip-address"); assertThat(signedUrl, equalTo(result.getSignedUrl())); }