Fix for issue 2021

This commit is contained in:
Harsh Jain 2016-02-10 22:19:12 +05:30
parent 41730b96d4
commit a3eb863c8e
2 changed files with 1 additions and 34 deletions

View File

@ -168,6 +168,7 @@ public class DatasourcesResource
} }
@DELETE @DELETE
@Deprecated
@Path("/{dataSourceName}") @Path("/{dataSourceName}")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
public Response deleteDataSource( public Response deleteDataSource(
@ -201,22 +202,6 @@ public class DatasourcesResource
return Response.ok().build(); 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 @DELETE
@Path("/{dataSourceName}/intervals/{interval}") @Path("/{dataSourceName}/intervals/{interval}")
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)

View File

@ -424,22 +424,4 @@ public class DatasourcesResourceTest
EasyMock.verify(indexingServiceClient, server); 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);
}
*/
} }