diff --git a/dbrepo-data-service/rest-service/src/test/java/at/tuwien/endpoint/SubsetEndpointUnitTest.java b/dbrepo-data-service/rest-service/src/test/java/at/tuwien/endpoint/SubsetEndpointUnitTest.java index 22099eafae1353d6061fc881812078ff212382f4..8a08f8231fe0de7babf1db995dc60786407425f8 100644 --- a/dbrepo-data-service/rest-service/src/test/java/at/tuwien/endpoint/SubsetEndpointUnitTest.java +++ b/dbrepo-data-service/rest-service/src/test/java/at/tuwien/endpoint/SubsetEndpointUnitTest.java @@ -91,21 +91,6 @@ public class SubsetEndpointUnitTest extends AbstractUnitTest { }); } - @Test - @WithMockUser(username = USER_4_USERNAME) - public void list_publicDataPrivateSchemaNoRole_fails() throws QueryNotFoundException, DatabaseNotFoundException, - RemoteUnavailableException, SQLException, MetadataServiceException { - - /* mock */ - when(subsetService.findAll(DATABASE_3_PRIVILEGED_DTO, null)) - .thenReturn(List.of(QUERY_1_DTO, QUERY_2_DTO, QUERY_3_DTO, QUERY_4_DTO, QUERY_5_DTO, QUERY_6_DTO)); - - /* test */ - assertThrows(NotAllowedException.class, () -> { - generic_list(DATABASE_3_ID, DATABASE_3_PRIVILEGED_DTO, USER_4_PRINCIPAL); - }); - } - @Test @WithMockUser(username = USER_3_USERNAME) public void list_publicDataPrivateSchema_succeeds() throws DatabaseUnavailableException, NotAllowedException, @@ -131,21 +116,6 @@ public class SubsetEndpointUnitTest extends AbstractUnitTest { }); } - @Test - @WithMockUser(username = USER_4_USERNAME) - public void list_publicDataAndPrivateSchemaNoRole_fails() throws DatabaseNotFoundException, - RemoteUnavailableException, MetadataServiceException { - - /* mock */ - when(credentialService.getDatabase(DATABASE_3_ID)) - .thenReturn(DATABASE_3_PRIVILEGED_DTO); - - /* test */ - assertThrows(NotAllowedException.class, () -> { - generic_list(DATABASE_3_ID, DATABASE_3_PRIVILEGED_DTO, USER_4_PRINCIPAL); - }); - } - @Test @WithMockUser(username = USER_3_USERNAME) public void list_publicDataAndPrivateSchemaUnavailable_fails() throws SQLException, QueryNotFoundException, @@ -316,21 +286,6 @@ public class SubsetEndpointUnitTest extends AbstractUnitTest { }); } - @Test - @WithMockUser(username = USER_4_USERNAME) - public void findById_publicDataAndPrivateSchemaNoRole_fails() throws DatabaseNotFoundException, - RemoteUnavailableException, MetadataServiceException { - - /* mock */ - when(credentialService.getDatabase(DATABASE_3_ID)) - .thenReturn(DATABASE_3_PRIVILEGED_DTO); - - /* test */ - assertThrows(NotAllowedException.class, () -> { - generic_findById(DATABASE_3_ID, QUERY_5_ID, "application/json", null, USER_4_PRINCIPAL); - }); - } - @Test @WithMockUser(username = USER_3_USERNAME) public void findById_publicDataAndPrivateSchemaUnavailable_fails() throws DatabaseNotFoundException, RemoteUnavailableException,