Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate getAllTables api #127

Merged
merged 2 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,8 @@ public ResponseEntity<GetTableResponseBody> getTable(
public ResponseEntity<GetAllTablesResponseBody> getAllTables(
@Parameter(description = "Database ID", required = true) @PathVariable String databaseId) {

com.linkedin.openhouse.common.api.spec.ApiResponse<GetAllTablesResponseBody> apiResponse =
tablesApiHandler.getAllTables(databaseId);

return new ResponseEntity<>(
apiResponse.getResponseBody(), apiResponse.getHttpHeaders(), apiResponse.getHttpStatus());
throw new UnsupportedOperationException(
"The getAllTables API is deprecated and please use searchTables API.");
jiang95-dev marked this conversation as resolved.
Show resolved Hide resolved
}

@Operation(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ public class TablesControllerTest {

@Autowired private AuditHandler<TableAuditEvent> tableAuditHandler;

@Test
jiang95-dev marked this conversation as resolved.
Show resolved Hide resolved
public void testCrudTables() throws Exception {

// Create tables
Expand Down Expand Up @@ -240,9 +239,9 @@ public void testDeleteNotFoundTable() throws Exception {
@Test
public void testEmptyDatabase() throws Exception {
mvc.perform(
MockMvcRequestBuilders.get(
MockMvcRequestBuilders.post(
ValidationUtilities.CURRENT_MAJOR_VERSION_PREFIX
+ "/databases/not_found/tables/")
+ "/databases/not_found/tables/search")
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().isOk())
.andExpect(content().contentType(MediaType.APPLICATION_JSON))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ public void testGetTableFailedPath() throws Exception {
.matches(actualEvent));
}

@Test
jiang95-dev marked this conversation as resolved.
Show resolved Hide resolved
public void testGetAllTablesSuccessfulPath() throws Exception {
mvc.perform(
MockMvcRequestBuilders.get(CURRENT_MAJOR_VERSION_PREFIX + "/databases/d200/tables")
Expand All @@ -70,7 +69,6 @@ public void testGetAllTablesSuccessfulPath() throws Exception {
.matches(actualEvent));
}

@Test
public void testGetAllTablesFailedPath() throws Exception {
mvc.perform(
MockMvcRequestBuilders.get(CURRENT_MAJOR_VERSION_PREFIX + "/databases/d404/tables")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ public void findTableById403() throws Exception {
.andExpect(status().isForbidden());
}

@Test
public void findAllTables2xx() throws Exception {
mvc.perform(
MockMvcRequestBuilders.get(CURRENT_MAJOR_VERSION_PREFIX + "/databases/d200/tables")
Expand All @@ -156,7 +155,6 @@ public void findAllTables2xx() throws Exception {
.andExpect(content().json(RequestConstants.TEST_GET_ALL_TABLES_RESPONSE_BODY.toJson()));
}

@Test
public void findAllTables4xx() throws Exception {
mvc.perform(
MockMvcRequestBuilders.get(CURRENT_MAJOR_VERSION_PREFIX + "/databases/d404/tables")
Expand Down
Loading