Skip to content
Snippets Groups Projects
Verified Commit 4d546682 authored by Martin Weise's avatar Martin Weise
Browse files

Updated problematic code piece

parent e8a62be8
No related branches found
No related tags found
4 merge requests!250Master,!246Dev,!244Dev,!243Dev
...@@ -261,8 +261,8 @@ public class StoreEndpointUnitTest extends BaseUnitTest { ...@@ -261,8 +261,8 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
@Test @Test
@WithMockUser(username = USER_1_USERNAME, authorities = "persist-query") @WithMockUser(username = USER_1_USERNAME, authorities = "persist-query")
public void persist_ownWriteAll_succeeds() throws UserNotFoundException, QueryStoreException, public void persist_ownWriteAll_succeeds() throws UserNotFoundException, QueryStoreException,
NotAllowedException, DatabaseConnectionException, QueryNotFoundException, DatabaseNotFoundException, NotAllowedException, QueryNotFoundException, DatabaseNotFoundException, ImageNotSupportedException,
ImageNotSupportedException, AccessDeniedException, IdentifierAlreadyPublishedException { AccessDeniedException, IdentifierAlreadyPublishedException {
/* mock */ /* mock */
when(userRepository.findByUsername(USER_1_USERNAME)) when(userRepository.findByUsername(USER_1_USERNAME))
...@@ -296,8 +296,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest { ...@@ -296,8 +296,7 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
protected QueryDto persist_generic(Long databaseId, Database database, Long queryId, Query query, protected QueryDto persist_generic(Long databaseId, Database database, Long queryId, Query query,
UUID userId, Principal principal, DatabaseAccess access) UUID userId, Principal principal, DatabaseAccess access)
throws DatabaseNotFoundException, UserNotFoundException, QueryStoreException, QueryNotFoundException, throws DatabaseNotFoundException, UserNotFoundException, QueryStoreException, QueryNotFoundException,
ImageNotSupportedException, NotAllowedException, DatabaseConnectionException, ImageNotSupportedException, NotAllowedException, AccessDeniedException, IdentifierAlreadyPublishedException {
AccessDeniedException, IdentifierAlreadyPublishedException {
final QueryPersistDto request = QueryPersistDto.builder() final QueryPersistDto request = QueryPersistDto.builder()
.persist(true) .persist(true)
.build(); .build();
...@@ -307,8 +306,9 @@ public class StoreEndpointUnitTest extends BaseUnitTest { ...@@ -307,8 +306,9 @@ public class StoreEndpointUnitTest extends BaseUnitTest {
.thenReturn(database); .thenReturn(database);
when(storeService.findOne(databaseId, queryId, principal)) when(storeService.findOne(databaseId, queryId, principal))
.thenReturn(query); .thenReturn(query);
when(storeService.persist(databaseId, queryId, request)) doReturn(query)
.thenReturn(query); .when(storeService)
.persist(databaseId, queryId, request);
if (access != null) { if (access != null) {
log.trace("mock access for database with id {} and user id {}", databaseId, userId); log.trace("mock access for database with id {} and user id {}", databaseId, userId);
when(accessService.find(databaseId, userId)) when(accessService.find(databaseId, userId))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment