use of com.github.ambry.rest.RestRequestService in project ambry by linkedin.
the class FrontendRestRequestServiceFactoryTest method getFrontendRestRequestServiceTest.
/**
* Tests the instantiation of an {@link FrontendRestRequestService} instance through the
* {@link FrontendRestRequestServiceFactory}.
* @throws Exception
*/
@Test
public void getFrontendRestRequestServiceTest() throws Exception {
// dud properties. server should pick up defaults
JSONObject jsonObject = new JSONObject().put("POST", "http://uploadUrl:15158").put("GET", "http://downloadUrl:15158");
Properties properties = new Properties();
CommonTestUtils.populateRequiredRouterProps(properties);
properties.setProperty(FrontendConfig.URL_SIGNER_ENDPOINTS, jsonObject.toString());
properties.setProperty("clustermap.cluster.name", "Cluster-Name");
properties.setProperty("clustermap.datacenter.name", "Datacenter-Name");
properties.setProperty("clustermap.host.name", "localhost");
VerifiableProperties verifiableProperties = new VerifiableProperties(properties);
FrontendRestRequestServiceFactory frontendRestRequestServiceFactory = new FrontendRestRequestServiceFactory(verifiableProperties, new MockClusterMap(), new InMemoryRouter(verifiableProperties, new MockClusterMap()), new InMemAccountService(false, true));
RestRequestService ambryRestRequestService = frontendRestRequestServiceFactory.getRestRequestService();
assertNotNull("No RestRequestService returned", ambryRestRequestService);
assertEquals("Did not receive an FrontendRestRequestService instance", FrontendRestRequestService.class.getCanonicalName(), ambryRestRequestService.getClass().getCanonicalName());
}
Aggregations