Search in sources :

Example 21 with AuthConfig

use of io.druid.server.security.AuthConfig in project druid by druid-io.

the class IntervalsResourceTest method testGetSpecificIntervals.

@Test
public void testGetSpecificIntervals() {
    EasyMock.expect(inventoryView.getInventory()).andReturn(ImmutableList.of(server)).atLeastOnce();
    EasyMock.replay(inventoryView);
    IntervalsResource intervalsResource = new IntervalsResource(inventoryView, new AuthConfig());
    Response response = intervalsResource.getSpecificIntervals("2010-01-01T00:00:00.000Z/P1D", null, null, request);
    Map<String, Object> actualIntervals = (Map) response.getEntity();
    Assert.assertEquals(2, actualIntervals.size());
    Assert.assertEquals(25L, actualIntervals.get("size"));
    Assert.assertEquals(2, actualIntervals.get("count"));
}
Also used : Response(javax.ws.rs.core.Response) AuthConfig(io.druid.server.security.AuthConfig) TreeMap(java.util.TreeMap) Map(java.util.Map) Test(org.junit.Test)

Aggregations

AuthConfig (io.druid.server.security.AuthConfig)21 Test (org.junit.Test)19 Response (javax.ws.rs.core.Response)18 Map (java.util.Map)10 TreeMap (java.util.TreeMap)9 ArrayList (java.util.ArrayList)8 Interval (org.joda.time.Interval)7 HashMap (java.util.HashMap)6 ImmutableList (com.google.common.collect.ImmutableList)5 Access (io.druid.server.security.Access)5 Action (io.druid.server.security.Action)5 AuthorizationInfo (io.druid.server.security.AuthorizationInfo)5 Resource (io.druid.server.security.Resource)5 List (java.util.List)5 DruidDataSource (io.druid.client.DruidDataSource)4 DruidServer (io.druid.client.DruidServer)3 NoopRequestLogger (io.druid.server.log.NoopRequestLogger)3 NoopServiceEmitter (io.druid.server.metrics.NoopServiceEmitter)3 ByteArrayInputStream (java.io.ByteArrayInputStream)3 TreeSet (java.util.TreeSet)3