use of ddf.catalog.operation.ResourceRequest in project ddf by codice.
the class DummyPreResourcePlugin method process.
@Override
public ResourceRequest process(ResourceRequest input) throws PluginExecutionException, StopProcessingException {
ResourceRequest newResourceRequest = input;
if (newResourceRequest != null) {
Map<String, Serializable> requestProperties = newResourceRequest.getProperties();
requestProperties.put(ResourceRequest.IS_ENTERPRISE, true);
}
return newResourceRequest;
}
use of ddf.catalog.operation.ResourceRequest in project ddf by codice.
the class TestResourceUsagePlugin method testPreResourceLocalSourceNoLocalMonitoring.
@Test
public void testPreResourceLocalSourceNoLocalMonitoring() throws StopProcessingException, PluginExecutionException, PersistenceException {
plugin.setMonitorLocalSources(false);
ResourceRequest originalRequest = getMockLocalResourceRequest(RESOURCE_SIZE, TEST_USER);
ResourceRequest request = plugin.process(originalRequest);
assertThat(request, is(notNullValue()));
assertThat(request, is(originalRequest));
verify(attributeStore, never()).getDataLimitByUser(anyString());
verify(attributeStore, never()).getCurrentDataUsageByUser(anyString());
}
use of ddf.catalog.operation.ResourceRequest in project ddf by codice.
the class TestResourceUsagePlugin method getMockRemoteResourceRequest.
private ResourceRequest getMockRemoteResourceRequest(String resourceSize, String expectedUsername) {
setSubject(expectedUsername);
ResourceRequest resourceRequest = getMockResourceRequest(resourceSize, expectedUsername);
when(resourceRequest.getPropertyValue(Constants.REMOTE_DESTINATION_KEY)).thenReturn(true);
when(resourceRequest.hasProperties()).thenReturn(true);
return resourceRequest;
}
use of ddf.catalog.operation.ResourceRequest in project ddf by codice.
the class TestResourceUsagePlugin method testPreResourceLocalSourceSizeNotFound.
@Test
public void testPreResourceLocalSourceSizeNotFound() throws PersistenceException, PluginExecutionException, StopProcessingException {
ResourceRequest originalRequest = getMockLocalResourceRequest(null, TEST_USER);
ResourceRequest request = plugin.process(originalRequest);
assertThat(request, is(notNullValue()));
assertThat(request, is(originalRequest));
verify(attributeStore, never()).getDataLimitByUser(anyString());
verify(attributeStore, never()).getCurrentDataUsageByUser(anyString());
}
use of ddf.catalog.operation.ResourceRequest in project ddf by codice.
the class TestResourceUsagePlugin method testPreResourceNoSubject.
@Test
public void testPreResourceNoSubject() throws StopProcessingException, PluginExecutionException, PersistenceException {
ResourceRequest originalRequest = getMockResourceRequestNoSubject(RESOURCE_SIZE);
ResourceRequest request = plugin.process(originalRequest);
assertThat(request, is(notNullValue()));
assertThat(request, is(originalRequest));
verify(attributeStore, never()).getDataLimitByUser(anyString());
verify(attributeStore, never()).getCurrentDataUsageByUser(anyString());
}
Aggregations