Search in sources :

Example 1 with CoordinatorServerView

use of io.druid.client.CoordinatorServerView in project druid by druid-io.

the class ServersResourceTest method setUp.

@Before
public void setUp() {
    DruidServer dummyServer = new DruidServer("dummy", "host", 1234L, "type", "tier", 0);
    DataSegment segment = DataSegment.builder().dataSource("dataSource").interval(new Interval("2016-03-22T14Z/2016-03-22T15Z")).version("v0").size(1L).build();
    dummyServer.addDataSegment(segment.getIdentifier(), segment);
    CoordinatorServerView inventoryView = EasyMock.createMock(CoordinatorServerView.class);
    EasyMock.expect(inventoryView.getInventory()).andReturn(ImmutableList.of(dummyServer)).anyTimes();
    EasyMock.expect(inventoryView.getInventoryValue(dummyServer.getName())).andReturn(dummyServer).anyTimes();
    EasyMock.replay(inventoryView);
    server = dummyServer;
    serversResource = new ServersResource(inventoryView);
}
Also used : DruidServer(io.druid.client.DruidServer) DataSegment(io.druid.timeline.DataSegment) CoordinatorServerView(io.druid.client.CoordinatorServerView) Interval(org.joda.time.Interval) Before(org.junit.Before)

Aggregations

CoordinatorServerView (io.druid.client.CoordinatorServerView)1 DruidServer (io.druid.client.DruidServer)1 DataSegment (io.druid.timeline.DataSegment)1 Interval (org.joda.time.Interval)1 Before (org.junit.Before)1