Skip to content
Snippets Groups Projects
Verified Commit 87d09cd3 authored by Martin Weise's avatar Martin Weise
Browse files
parent 033be706
No related branches found
No related tags found
1 merge request!371Hotfix the wrong user id, ref #480
...@@ -141,7 +141,7 @@ public class SubsetEndpointUnitTest extends AbstractUnitTest { ...@@ -141,7 +141,7 @@ public class SubsetEndpointUnitTest extends AbstractUnitTest {
.thenReturn(DATABASE_3_PRIVILEGED_DTO); .thenReturn(DATABASE_3_PRIVILEGED_DTO);
/* test */ /* test */
assertThrows(DatabaseUnavailableException.class, () -> { assertThrows(NotAllowedException.class, () -> {
generic_list(DATABASE_3_ID, DATABASE_3_PRIVILEGED_DTO, USER_4_PRINCIPAL); generic_list(DATABASE_3_ID, DATABASE_3_PRIVILEGED_DTO, USER_4_PRINCIPAL);
}); });
} }
...@@ -317,19 +317,17 @@ public class SubsetEndpointUnitTest extends AbstractUnitTest { ...@@ -317,19 +317,17 @@ public class SubsetEndpointUnitTest extends AbstractUnitTest {
} }
@Test @Test
@WithMockUser(username = USER_3_USERNAME) @WithMockUser(username = USER_4_USERNAME)
public void findById_publicDataAndPrivateSchemaNoRole_fails() throws DatabaseNotFoundException, SQLException, public void findById_publicDataAndPrivateSchemaNoRole_fails() throws DatabaseNotFoundException,
RemoteUnavailableException, MetadataServiceException, UserNotFoundException, QueryNotFoundException { RemoteUnavailableException, MetadataServiceException {
/* mock */ /* mock */
when(credentialService.getDatabase(DATABASE_3_ID)) when(credentialService.getDatabase(DATABASE_3_ID))
.thenReturn(DATABASE_3_PRIVILEGED_DTO); .thenReturn(DATABASE_3_PRIVILEGED_DTO);
when(subsetService.findById(DATABASE_3_PRIVILEGED_DTO, QUERY_5_ID))
.thenReturn(QUERY_5_DTO);
/* test */ /* test */
assertThrows(NotAllowedException.class, () -> { assertThrows(NotAllowedException.class, () -> {
generic_findById(DATABASE_3_ID, QUERY_5_ID, "application/json", null, USER_3_PRINCIPAL); generic_findById(DATABASE_3_ID, QUERY_5_ID, "application/json", null, USER_4_PRINCIPAL);
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment