use of org.apache.samza.coordinator.server.LocalityServlet in project samza by apache.
the class TestLocalityServlet method setup.
@Before
public void setup() throws Exception {
localityManager = mock(LocalityManager.class);
when(localityManager.readLocality()).thenReturn(new LocalityModel(ImmutableMap.of(PROCESSOR_ID1, PROCESSOR_1_LOCALITY, PROCESSOR_ID2, PROCESSOR_2_LOCALITY)));
webApp = new HttpServer("/", 0, "", new ServletHolder(new DefaultServlet()));
webApp.addServlet("/locality", new LocalityServlet(localityManager));
webApp.start();
}
Aggregations