From a3eb863c8ea431bfc899f421abbb4a66c91a310a Mon Sep 17 00:00:00 2001 From: Harsh Jain Date: Wed, 10 Feb 2016 22:19:12 +0530 Subject: [PATCH] Fix for issue 2021 --- .../druid/server/http/DatasourcesResource.java | 17 +---------------- .../server/http/DatasourcesResourceTest.java | 18 ------------------ 2 files changed, 1 insertion(+), 34 deletions(-) diff --git a/server/src/main/java/io/druid/server/http/DatasourcesResource.java b/server/src/main/java/io/druid/server/http/DatasourcesResource.java index c80996fd3aa..2f6dec84c6e 100644 --- a/server/src/main/java/io/druid/server/http/DatasourcesResource.java +++ b/server/src/main/java/io/druid/server/http/DatasourcesResource.java @@ -168,6 +168,7 @@ public class DatasourcesResource } @DELETE + @Deprecated @Path("/{dataSourceName}") @Produces(MediaType.APPLICATION_JSON) public Response deleteDataSource( @@ -201,22 +202,6 @@ public class DatasourcesResource return Response.ok().build(); } - /* - Uncomment this method once the method deleteSourceName (just above this) is deleted. - @DELETE - @Path("/{dataSourceName}") - @Produces(MediaType.APPLICATION_JSON) - public Response deleteDataSource( - @PathParam("dataSourceName") final String dataSourceName - ) - { - if (!databaseSegmentManager.removeDatasource(dataSourceName)) { - return Response.noContent().build(); - } - return Response.ok().build(); - } - */ - @DELETE @Path("/{dataSourceName}/intervals/{interval}") @Produces(MediaType.APPLICATION_JSON) diff --git a/server/src/test/java/io/druid/server/http/DatasourcesResourceTest.java b/server/src/test/java/io/druid/server/http/DatasourcesResourceTest.java index 87056021534..55c124a806b 100644 --- a/server/src/test/java/io/druid/server/http/DatasourcesResourceTest.java +++ b/server/src/test/java/io/druid/server/http/DatasourcesResourceTest.java @@ -424,22 +424,4 @@ public class DatasourcesResourceTest EasyMock.verify(indexingServiceClient, server); } - /* - Uncomment this unit test once the method testDeleteDataSource(string dataSourceName) is uncommented in class DatasourcesResource - @Test - public void testDeleteDataSource() throws Exception - { - MetadataSegmentManager databaseSegmentManager = EasyMock.createStrictMock(MetadataSegmentManager.class); - EasyMock.expect(databaseSegmentManager.removeDatasource("datasource1")).andReturn(true).atLeastOnce(); - EasyMock.replay(server, databaseSegmentManager); - - DatasourcesResource datasourcesResource = new DatasourcesResource(null, databaseSegmentManager, null); - Response response = datasourcesResource.deleteDataSource("datasource1"); - - Assert.assertEquals(200, response.getStatus()); - Assert.assertEquals(null,response.getEntity()); - EasyMock.verify(databaseSegmentManager, server); - } - */ - }