use of uk.gov.gchq.gaffer.proxystore.ProxyProperties in project Gaffer by gchq.
the class RoadTrafficRestApiITs method prepareProxy.
@BeforeEach
@Override
public void prepareProxy() throws IOException {
// Create a proxy store that will proxy all queries to the REST API that has been spun up
ProxyProperties props = new ProxyProperties(System.getProperties());
props.setStoreClass(ProxyStore.class);
props.setStorePropertiesClass(props.getClass());
final URL restURL = new URL(CLIENT.getRoot());
props.setGafferHost(restURL.getHost());
props.setGafferPort(restURL.getPort());
props.setGafferContextRoot(CLIENT.getPath());
this.graph = new Graph.Builder().config(StreamUtil.graphConfig(this.getClass())).storeProperties(props).build();
this.user = new User();
}
use of uk.gov.gchq.gaffer.proxystore.ProxyProperties in project Gaffer by gchq.
the class RoadTrafficRestApiSTs method prepareProxy.
@Override
@BeforeEach
public void prepareProxy() {
ProxyProperties props = new ProxyProperties(System.getProperties());
props.setStoreClass(ProxyStore.class);
props.setStorePropertiesClass(props.getClass());
this.graph = new Graph.Builder().config(StreamUtil.graphConfig(this.getClass())).storeProperties(props).build();
this.user = new User();
}
use of uk.gov.gchq.gaffer.proxystore.ProxyProperties in project Gaffer by gchq.
the class FederatedStoreRecursionIT method createProxyToRestServiceFederatedGraph.
protected void createProxyToRestServiceFederatedGraph() {
final Graph proxyToRestServiceFederatedGraph;
ProxyProperties singleUseFedProperties = new ProxyProperties();
singleUseFedProperties.setStoreClass(SingleUseFederatedStore.class);
singleUseFedProperties.setReadTimeout(120000);
singleUseFedProperties.setConnectTimeout(120000);
proxyToRestServiceFederatedGraph = new Graph.Builder().storeProperties(singleUseFedProperties).addSchema(new Schema()).config(new GraphConfig(PROXY_TO_REST_SERVICE_FEDERATED_GRAPH)).build();
this.proxyToRestServiceFederatedGraph = proxyToRestServiceFederatedGraph;
}
use of uk.gov.gchq.gaffer.proxystore.ProxyProperties in project Gaffer by gchq.
the class GetProxyPropertiesHandlerTest method shouldGetURl.
@Test
public void shouldGetURl() throws Exception {
// given
Store store = Mockito.mock(Store.class);
ProxyProperties properties = new ProxyProperties();
properties.set(GAFFER_PORT, PORT);
properties.set(GAFFER_HOST, HOST);
properties.set(GAFFER_CONTEXT_ROOT, DEFAULT_GAFFER_CONTEXT_ROOT);
properties.setConnectTimeout(999);
properties.set(EXTRA_KEY, "value");
Mockito.when(store.getProperties()).thenReturn(properties);
HashMap expected = getExpected(properties);
// when
Map<String, Object> actual = new GetProxyPropertiesHandler().doOperation(new GetProxyProperties(), new Context(), store);
// then
assertFalse(actual.containsKey(EXTRA_KEY));
assertTrue(actual.containsKey(URL_INFERRED));
assertEquals(expected, actual);
}
use of uk.gov.gchq.gaffer.proxystore.ProxyProperties in project Gaffer by gchq.
the class ProxyStoreIT method createProxy.
private Graph createProxy() {
ProxyProperties proxyProperties = new ProxyProperties();
proxyProperties.setGafferHost("localhost");
proxyProperties.setGafferPort(getPort());
proxyProperties.setGafferContextRoot(getContextPath());
// When
return new Graph.Builder().config(new GraphConfig("proxy")).addSchema(new Schema()).storeProperties(proxyProperties).build();
}
Aggregations