diff --git a/src/main/java/org/openepics/names/rest/api/v1/INames.java b/src/main/java/org/openepics/names/rest/api/v1/INames.java index e9370c464a9c1ef5909e493456b2c28aebf6abe3..7626cb87baf74056d3dfdb6975bb07bc16dc092f 100644 --- a/src/main/java/org/openepics/names/rest/api/v1/INames.java +++ b/src/main/java/org/openepics/names/rest/api/v1/INames.java @@ -30,8 +30,10 @@ import org.openepics.names.rest.beans.response.Response; import org.openepics.names.rest.beans.response.ResponseBoolean; import org.openepics.names.rest.beans.response.ResponseBooleanList; import org.openepics.names.rest.beans.response.ResponsePageNameElements; +import org.openepics.names.service.security.dto.UserDetails; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -188,6 +190,7 @@ public interface INames { consumes = {"application/json"}) @PreAuthorize(SecurityConfiguration.IS_ADMINISTRATOR_OR_USER) public ResponseEntity<List<NameElement>> createNames( + @AuthenticationPrincipal UserDetails user, @Parameter( in = ParameterIn.DEFAULT, description = "array of name elements", @@ -720,6 +723,7 @@ public interface INames { consumes = {"application/json"}) @PreAuthorize(SecurityConfiguration.IS_ADMINISTRATOR_OR_USER) public List<NameElement> updateNames( + @AuthenticationPrincipal UserDetails user, @Parameter( in = ParameterIn.DEFAULT, description = "array of name elements", @@ -784,6 +788,7 @@ public interface INames { consumes = {"application/json"}) @PreAuthorize(SecurityConfiguration.IS_ADMINISTRATOR_OR_USER) public ResponseEntity<Response> deleteNames( + @AuthenticationPrincipal UserDetails user, @Parameter( in = ParameterIn.DEFAULT, description = "array of name elements", diff --git a/src/main/java/org/openepics/names/rest/api/v1/IStructures.java b/src/main/java/org/openepics/names/rest/api/v1/IStructures.java index 1f78f4dc162cbfa21a5adc90826fd22ac2557f44..fa9b542e42123288228d99b379cb5bcfd87adf4c 100644 --- a/src/main/java/org/openepics/names/rest/api/v1/IStructures.java +++ b/src/main/java/org/openepics/names/rest/api/v1/IStructures.java @@ -31,8 +31,10 @@ import org.openepics.names.rest.beans.response.Response; import org.openepics.names.rest.beans.response.ResponseBoolean; import org.openepics.names.rest.beans.response.ResponseBooleanList; import org.openepics.names.rest.beans.response.ResponsePageStructureElements; +import org.openepics.names.service.security.dto.UserDetails; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.security.core.annotation.AuthenticationPrincipal; import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PathVariable; @@ -192,6 +194,7 @@ public interface IStructures { consumes = {"application/json"}) @PreAuthorize(SecurityConfiguration.IS_ADMINISTRATOR) public ResponseEntity<List<StructureElement>> createStructures( + @AuthenticationPrincipal UserDetails user, @Parameter( in = ParameterIn.DEFAULT, description = "array of structure elements", @@ -782,6 +785,7 @@ public interface IStructures { consumes = {"application/json"}) @PreAuthorize(SecurityConfiguration.IS_ADMINISTRATOR) public List<StructureElement> updateStructures( + @AuthenticationPrincipal UserDetails user, @Parameter( in = ParameterIn.DEFAULT, description = "array of structure elements", @@ -847,6 +851,7 @@ public interface IStructures { consumes = {"application/json"}) @PreAuthorize(SecurityConfiguration.IS_ADMINISTRATOR) public ResponseEntity<Response> deleteStructures( + @AuthenticationPrincipal UserDetails user, @Parameter( in = ParameterIn.DEFAULT, description = "array of structure elements", diff --git a/src/main/java/org/openepics/names/rest/controller/NamesController.java b/src/main/java/org/openepics/names/rest/controller/NamesController.java index 33569e4aaff56c9168b5c045a0c5c15a5ae68ce8..2e0eb347b8293ba1a343ac95aab49662e30f3822 100644 --- a/src/main/java/org/openepics/names/rest/controller/NamesController.java +++ b/src/main/java/org/openepics/names/rest/controller/NamesController.java @@ -36,6 +36,8 @@ import org.openepics.names.rest.beans.response.ResponseBooleanList; import org.openepics.names.rest.beans.response.ResponsePageNameElements; import org.openepics.names.service.LogService; import org.openepics.names.service.NamesService; +import org.openepics.names.service.security.dto.UserDetails; +import org.openepics.names.service.security.util.SecurityUtil; import org.openepics.names.util.NameElementUtil; import org.openepics.names.util.TextUtil; import org.openepics.names.util.ValidateNameElementUtil; @@ -76,7 +78,8 @@ public class NamesController implements INames { } @Override - public ResponseEntity<List<NameElement>> createNames(List<NameElementCommandCreate> nameElementCommands) { + public ResponseEntity<List<NameElement>> createNames(UserDetails user, + List<NameElementCommandCreate> nameElementCommands) { // validate authority - user & admin // convert // validate @@ -85,7 +88,7 @@ public class NamesController implements INames { try { List<NameElementCommand> commands = NameElementUtil.convertCommandCreate2Command(nameElementCommands); namesService.validateNamesCreate(commands); - return new ResponseEntity<>(namesService.createNames(commands, TextUtil.TEST_WHO), Response.getHeaderJson(), HttpStatus.CREATED); + return new ResponseEntity<>(namesService.createNames(commands, SecurityUtil.getUsername(user)), Response.getHeaderJson(), HttpStatus.CREATED); } catch (ServiceException e) { logService.logServiceException(LOGGER, Level.WARNING, e); throw e; @@ -346,7 +349,8 @@ public class NamesController implements INames { // ---------------------------------------------------------------------------------------------------- @Override - public List<NameElement> updateNames(List<NameElementCommandUpdate> nameElementCommands) { + public List<NameElement> updateNames(UserDetails user, + List<NameElementCommandUpdate> nameElementCommands) { // validate authority - user & admin // convert // validate @@ -355,7 +359,7 @@ public class NamesController implements INames { try { List<NameElementCommand> commands = NameElementUtil.convertCommandUpdate2Command(nameElementCommands); namesService.validateNamesUpdate(commands); - return namesService.updateNames(commands, TextUtil.TEST_WHO); + return namesService.updateNames(commands, SecurityUtil.getUsername(user)); } catch (ServiceException e) { logService.logServiceException(LOGGER, Level.WARNING, e); throw e; @@ -368,7 +372,8 @@ public class NamesController implements INames { // ---------------------------------------------------------------------------------------------------- @Override - public ResponseEntity<Response> deleteNames(List<NameElementCommandConfirm> nameElementCommands) { + public ResponseEntity<Response> deleteNames(UserDetails user, + List<NameElementCommandConfirm> nameElementCommands) { // validate authority - user & admin // convert // validate @@ -377,7 +382,7 @@ public class NamesController implements INames { try { List<NameElementCommand> commands = NameElementUtil.convertCommandConfirm2Command(nameElementCommands); namesService.validateNamesDelete(commands); - namesService.deleteNames(commands, TextUtil.TEST_WHO); + namesService.deleteNames(commands, SecurityUtil.getUsername(user)); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } catch (ServiceException e) { logService.logServiceException(LOGGER, Level.WARNING, e); diff --git a/src/main/java/org/openepics/names/rest/controller/StructuresController.java b/src/main/java/org/openepics/names/rest/controller/StructuresController.java index 5b7fe1697829c76dcecf9318b905b2c630d0aac7..32c51cfc47ac9a1d677217d56a8ab9a3443da82b 100644 --- a/src/main/java/org/openepics/names/rest/controller/StructuresController.java +++ b/src/main/java/org/openepics/names/rest/controller/StructuresController.java @@ -37,6 +37,8 @@ import org.openepics.names.rest.beans.response.ResponseBooleanList; import org.openepics.names.rest.beans.response.ResponsePageStructureElements; import org.openepics.names.service.LogService; import org.openepics.names.service.StructuresService; +import org.openepics.names.service.security.dto.UserDetails; +import org.openepics.names.service.security.util.SecurityUtil; import org.openepics.names.util.StructureElementUtil; import org.openepics.names.util.TextUtil; import org.openepics.names.util.ValidateStructureElementUtil; @@ -77,7 +79,8 @@ public class StructuresController implements IStructures { } @Override - public ResponseEntity<List<StructureElement>> createStructures(List<StructureElementCommandCreate> structureElementCommands) { + public ResponseEntity<List<StructureElement>> createStructures(UserDetails user, + List<StructureElementCommandCreate> structureElementCommands) { // validate authority - user & admin // convert // validate @@ -86,7 +89,7 @@ public class StructuresController implements IStructures { try { List<StructureElementCommand> commands = StructureElementUtil.convertCommandCreate2Command(structureElementCommands); structuresService.validateStructuresCreate(commands); - return new ResponseEntity<>(structuresService.createStructures(commands, TextUtil.TEST_WHO), Response.getHeaderJson(), HttpStatus.CREATED); + return new ResponseEntity<>(structuresService.createStructures(commands, SecurityUtil.getUsername(user)), Response.getHeaderJson(), HttpStatus.CREATED); } catch (ServiceException e) { logService.logServiceException(LOGGER, Level.WARNING, e); throw e; @@ -347,7 +350,8 @@ public class StructuresController implements IStructures { // ---------------------------------------------------------------------------------------------------- @Override - public List<StructureElement> updateStructures(List<StructureElementCommandUpdate> structureElementCommands) { + public List<StructureElement> updateStructures(UserDetails user, + List<StructureElementCommandUpdate> structureElementCommands) { // validate authority - user & admin // convert // validate @@ -356,7 +360,7 @@ public class StructuresController implements IStructures { try { List<StructureElementCommand> commands = StructureElementUtil.convertCommandUpdate2Command(structureElementCommands); structuresService.validateStructuresUpdate(commands); - return structuresService.updateStructures(commands, TextUtil.TEST_WHO); + return structuresService.updateStructures(commands, SecurityUtil.getUsername(user)); } catch (ServiceException e) { logService.logServiceException(LOGGER, Level.WARNING, e); throw e; @@ -369,7 +373,8 @@ public class StructuresController implements IStructures { // ---------------------------------------------------------------------------------------------------- @Override - public ResponseEntity<Response> deleteStructures(List<StructureElementCommandConfirm> structureElementCommands) { + public ResponseEntity<Response> deleteStructures(UserDetails user, + List<StructureElementCommandConfirm> structureElementCommands) { // validate authority - user & admin // convert // validate @@ -378,7 +383,7 @@ public class StructuresController implements IStructures { try { List<StructureElementCommand> commands = StructureElementUtil.convertCommandConfirm2Command(structureElementCommands); structuresService.validateStructuresDelete(commands); - structuresService.deleteStructures(commands, TextUtil.TEST_WHO); + structuresService.deleteStructures(commands, SecurityUtil.getUsername(user)); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } catch (ServiceException e) { logService.logServiceException(LOGGER, Level.WARNING, e); diff --git a/src/main/java/org/openepics/names/service/security/UserService.java b/src/main/java/org/openepics/names/service/security/UserService.java index 4a679f984291e1cb831667ab092a20aaaf061ee9..140f2f113fc2c5d242d0570da1b135279c105906 100644 --- a/src/main/java/org/openepics/names/service/security/UserService.java +++ b/src/main/java/org/openepics/names/service/security/UserService.java @@ -31,7 +31,7 @@ import org.openepics.names.service.LogService; import org.openepics.names.service.security.dto.LoginTokenDto; import org.openepics.names.service.security.dto.UserDetails; import org.openepics.names.service.security.rbac.RBACToken; -import org.openepics.names.service.security.util.ConversionUtil; +import org.openepics.names.service.security.util.SecurityUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @@ -90,7 +90,7 @@ public class UserService { * @return The user-information stored in RBAC */ public UserDetails getUserInfoFromToken(String token) { - return ConversionUtil.convertToUserDetails(rbacService.userInfoFromToken(token)); + return SecurityUtil.convertToUserDetails(rbacService.userInfoFromToken(token)); } /** diff --git a/src/main/java/org/openepics/names/service/security/util/ConversionUtil.java b/src/main/java/org/openepics/names/service/security/util/SecurityUtil.java similarity index 65% rename from src/main/java/org/openepics/names/service/security/util/ConversionUtil.java rename to src/main/java/org/openepics/names/service/security/util/SecurityUtil.java index 6a6a532869680a8b11513f3fe529316036500276..cfca9311278b4a50ded3afcd496a4b4b4f4a955b 100644 --- a/src/main/java/org/openepics/names/service/security/util/ConversionUtil.java +++ b/src/main/java/org/openepics/names/service/security/util/SecurityUtil.java @@ -5,10 +5,15 @@ import org.openepics.names.service.security.rbac.RBACToken; /** * @author <a href="mailto:zoltan.runyo@ess.eu">Zoltan Runyo</a> + * @author Lars Johansson */ -public class ConversionUtil { +public class SecurityUtil { - private ConversionUtil() { + /** + * This class is not to be instantiated. + */ + private SecurityUtil() { + throw new IllegalStateException("Utility class"); } /** @@ -32,4 +37,14 @@ public class ConversionUtil { return result; } + /** + * Return username for a user. + * + * @param userDetails user details + * @return username + */ + public static String getUsername(UserDetails userDetails) { + return userDetails != null ? userDetails.getUserName() : null; + } + } diff --git a/src/main/java/org/openepics/names/util/TextUtil.java b/src/main/java/org/openepics/names/util/TextUtil.java index b47222d11f7dd6417713a40006f8e10a71761601..b5a972c7b0efa04d98bff8b9c010f279e5102e4c 100644 --- a/src/main/java/org/openepics/names/util/TextUtil.java +++ b/src/main/java/org/openepics/names/util/TextUtil.java @@ -132,9 +132,6 @@ public class TextUtil { public static final String ATTACHMENT_FILENAME_NAME_ELEMENT_XLSX = "attachment; filename=NameElement.xlsx"; public static final String ATTACHMENT_FILENAME_STRUCTURE_ELEMENT_XLSX = "attachment; filename=StructureElement.xlsx"; - // test - public static final String TEST_WHO = "test who"; - // log public static final String DESCRIPTION_NUMBER_ELEMENTS = "{0}, # elements: {1}"; public static final String DESCRIPTION_NUMBER_ELEMENTS_IN_OUT = "{0}, # elements (in): {1}, # elements (out): {2}"; diff --git a/src/test/java/org/openepics/names/docker/NamesIT.java b/src/test/java/org/openepics/names/docker/NamesIT.java index 049ad1f2ab9c30260bf2145305601e1fdcb0905a..b2b142d1d97f5bf96624bd4bfb0e057201bf3a76 100644 --- a/src/test/java/org/openepics/names/docker/NamesIT.java +++ b/src/test/java/org/openepics/names/docker/NamesIT.java @@ -678,16 +678,8 @@ class NamesIT { ITUtilNames.assertRead("?description=updated description%", 1, -1); ITUtilNames.assertRead("?description=updated description again", 1); - ITUtilNames.assertRead("?who=test who", 13, -1); + ITUtilNames.assertRead("?who=", 13, -1); ITUtilNames.assertRead("?who=test", 0); - ITUtilNames.assertRead("?who=who", 0); - ITUtilNames.assertRead("?who=test%", 13, -1); - ITUtilNames.assertRead("?who=%who", 13, -1); - ITUtilNames.assertRead("?who=%est%", 13, -1); - ITUtilNames.assertRead("?who=%wh%", 13, -1); - ITUtilNames.assertRead("?who=wh%", 0); - ITUtilNames.assertRead("?who=asdf", 0); - ITUtilNames.assertRead("?who=%asdf%", 0); ITUtilNames.assertRead("?deviceStructure=EMR-FS&index=003", 1); diff --git a/src/test/java/org/openepics/names/docker/StructuresDeviceGroupIT.java b/src/test/java/org/openepics/names/docker/StructuresDeviceGroupIT.java index 6286303a3e49ba77f5e52e34dbc9162caa0d50f4..64f88b73e26deb95fe0bf93a8055f40bb7d10250 100644 --- a/src/test/java/org/openepics/names/docker/StructuresDeviceGroupIT.java +++ b/src/test/java/org/openepics/names/docker/StructuresDeviceGroupIT.java @@ -864,16 +864,8 @@ class StructuresDeviceGroupIT { ITUtilStructures.assertRead("?type=DEVICEGROUP&description=%sc%", 30, -1); ITUtilStructures.assertRead("?type=DEVICEGROUP&description=description", 10, -1); - ITUtilStructures.assertRead("?type=DEVICEGROUP&who=test who", 30, -1); + ITUtilStructures.assertRead("?type=DEVICEGROUP&who=", 30, -1); ITUtilStructures.assertRead("?type=DEVICEGROUP&who=test", 0); - ITUtilStructures.assertRead("?type=DEVICEGROUP&who=who", 0); - ITUtilStructures.assertRead("?type=DEVICEGROUP&who=test%", 30, -1); - ITUtilStructures.assertRead("?type=DEVICEGROUP&who=%who", 30, -1); - ITUtilStructures.assertRead("?type=DEVICEGROUP&who=%est%", 30, -1); - ITUtilStructures.assertRead("?type=DEVICEGROUP&who=%wh%", 30, -1); - ITUtilStructures.assertRead("?type=DEVICEGROUP&who=wh%", 0); - ITUtilStructures.assertRead("?type=DEVICEGROUP&who=asdf", 0); - ITUtilStructures.assertRead("?type=DEVICEGROUP&who=%asdf%", 0); // order by // avoid diff --git a/src/test/java/org/openepics/names/docker/StructuresDeviceTypeIT.java b/src/test/java/org/openepics/names/docker/StructuresDeviceTypeIT.java index a512138db27f4d3de7ce105ddb6c466158ff7baf..279460882ed465361d3dcedcbe94a48a6cc36e06 100644 --- a/src/test/java/org/openepics/names/docker/StructuresDeviceTypeIT.java +++ b/src/test/java/org/openepics/names/docker/StructuresDeviceTypeIT.java @@ -872,16 +872,8 @@ class StructuresDeviceTypeIT { ITUtilStructures.assertRead("?type=DEVICETYPE&description=%sc%", 30, -1); ITUtilStructures.assertRead("?type=DEVICETYPE&description=description", 10, -1); - ITUtilStructures.assertRead("?type=DEVICETYPE&who=test who", 30, -1); + ITUtilStructures.assertRead("?type=DEVICETYPE&who=", 30, -1); ITUtilStructures.assertRead("?type=DEVICETYPE&who=test", 0); - ITUtilStructures.assertRead("?type=DEVICETYPE&who=who", 0); - ITUtilStructures.assertRead("?type=DEVICETYPE&who=test%", 30, -1); - ITUtilStructures.assertRead("?type=DEVICETYPE&who=%who", 30, -1); - ITUtilStructures.assertRead("?type=DEVICETYPE&who=%est%", 30, -1); - ITUtilStructures.assertRead("?type=DEVICETYPE&who=%wh%", 30, -1); - ITUtilStructures.assertRead("?type=DEVICETYPE&who=wh%", 0); - ITUtilStructures.assertRead("?type=DEVICETYPE&who=asdf", 0); - ITUtilStructures.assertRead("?type=DEVICETYPE&who=%asdf%", 0); // order by // avoid diff --git a/src/test/java/org/openepics/names/docker/StructuresDisciplineIT.java b/src/test/java/org/openepics/names/docker/StructuresDisciplineIT.java index 510df00a0860f20b058cbddff05a6f5dd7eed62c..1d36c322a47563464710779dc930fd0789cffb77 100644 --- a/src/test/java/org/openepics/names/docker/StructuresDisciplineIT.java +++ b/src/test/java/org/openepics/names/docker/StructuresDisciplineIT.java @@ -766,16 +766,8 @@ class StructuresDisciplineIT { ITUtilStructures.assertRead("?type=DISCIPLINE&description=%sc%", 30, -1); ITUtilStructures.assertRead("?type=DISCIPLINE&description=description", 10, -1); - ITUtilStructures.assertRead("?type=DISCIPLINE&who=test who", 30, -1); + ITUtilStructures.assertRead("?type=DISCIPLINE&who=", 30, -1); ITUtilStructures.assertRead("?type=DISCIPLINE&who=test", 0); - ITUtilStructures.assertRead("?type=DISCIPLINE&who=who", 0); - ITUtilStructures.assertRead("?type=DISCIPLINE&who=test%", 30, -1); - ITUtilStructures.assertRead("?type=DISCIPLINE&who=%who", 30, -1); - ITUtilStructures.assertRead("?type=DISCIPLINE&who=%est%", 30, -1); - ITUtilStructures.assertRead("?type=DISCIPLINE&who=%wh%", 30, -1); - ITUtilStructures.assertRead("?type=DISCIPLINE&who=wh%", 0); - ITUtilStructures.assertRead("?type=DISCIPLINE&who=asdf", 0); - ITUtilStructures.assertRead("?type=DISCIPLINE&who=%asdf%", 0); // order by // avoid diff --git a/src/test/java/org/openepics/names/docker/StructuresSubsystemIT.java b/src/test/java/org/openepics/names/docker/StructuresSubsystemIT.java index eb3c04b4a20b8767d8b471b4d11c960be29681bb..cef336b790f3b87c11f445bcbe0ab89e53ffd5a5 100644 --- a/src/test/java/org/openepics/names/docker/StructuresSubsystemIT.java +++ b/src/test/java/org/openepics/names/docker/StructuresSubsystemIT.java @@ -908,16 +908,8 @@ class StructuresSubsystemIT { ITUtilStructures.assertRead("?type=SUBSYSTEM&description=%sc%", 30, -1); ITUtilStructures.assertRead("?type=SUBSYSTEM&description=description", 10, -1); - ITUtilStructures.assertRead("?type=SUBSYSTEM&who=test who", 30, -1); + ITUtilStructures.assertRead("?type=SUBSYSTEM&who=", 30, -1); ITUtilStructures.assertRead("?type=SUBSYSTEM&who=test", 0); - ITUtilStructures.assertRead("?type=SUBSYSTEM&who=who", 0); - ITUtilStructures.assertRead("?type=SUBSYSTEM&who=test%", 30, -1); - ITUtilStructures.assertRead("?type=SUBSYSTEM&who=%who", 30, -1); - ITUtilStructures.assertRead("?type=SUBSYSTEM&who=%est%", 30, -1); - ITUtilStructures.assertRead("?type=SUBSYSTEM&who=%wh%", 30, -1); - ITUtilStructures.assertRead("?type=SUBSYSTEM&who=wh%", 0); - ITUtilStructures.assertRead("?type=SUBSYSTEM&who=asdf", 0); - ITUtilStructures.assertRead("?type=SUBSYSTEM&who=%asdf%", 0); // order by // avoid diff --git a/src/test/java/org/openepics/names/docker/StructuresSystemGroupIT.java b/src/test/java/org/openepics/names/docker/StructuresSystemGroupIT.java index e284a557275a2c9989053baefdbfdb63e87feda6..b4b05e973ebe4a7f3f8b676cb33cf364ef816add 100644 --- a/src/test/java/org/openepics/names/docker/StructuresSystemGroupIT.java +++ b/src/test/java/org/openepics/names/docker/StructuresSystemGroupIT.java @@ -813,16 +813,8 @@ class StructuresSystemGroupIT { ITUtilStructures.assertRead("?type=SYSTEMGROUP&description=%sc%", 30, -1); ITUtilStructures.assertRead("?type=SYSTEMGROUP&description=description", 10, -1); - ITUtilStructures.assertRead("?type=SYSTEMGROUP&who=test who", 30, -1); + ITUtilStructures.assertRead("?type=SYSTEMGROUP&who=", 30, -1); ITUtilStructures.assertRead("?type=SYSTEMGROUP&who=test", 0); - ITUtilStructures.assertRead("?type=SYSTEMGROUP&who=who", 0); - ITUtilStructures.assertRead("?type=SYSTEMGROUP&who=test%", 30, -1); - ITUtilStructures.assertRead("?type=SYSTEMGROUP&who=%who", 30, -1); - ITUtilStructures.assertRead("?type=SYSTEMGROUP&who=%est%", 30, -1); - ITUtilStructures.assertRead("?type=SYSTEMGROUP&who=%wh%", 30, -1); - ITUtilStructures.assertRead("?type=SYSTEMGROUP&who=wh%", 0); - ITUtilStructures.assertRead("?type=SYSTEMGROUP&who=asdf", 0); - ITUtilStructures.assertRead("?type=SYSTEMGROUP&who=%asdf%", 0); // order by // avoid diff --git a/src/test/java/org/openepics/names/docker/StructuresSystemIT.java b/src/test/java/org/openepics/names/docker/StructuresSystemIT.java index e307784abc6da007861b60526d3024704b0b1cb4..9afadef27c0cfd0bb16ed6d2bd1427d8d8514ace 100644 --- a/src/test/java/org/openepics/names/docker/StructuresSystemIT.java +++ b/src/test/java/org/openepics/names/docker/StructuresSystemIT.java @@ -852,16 +852,8 @@ class StructuresSystemIT { ITUtilStructures.assertRead("?type=SYSTEM&description=%sc%", 30, -1); ITUtilStructures.assertRead("?type=SYSTEM&description=description", 10, -1); - ITUtilStructures.assertRead("?type=SYSTEM&who=test who", 30, -1); + ITUtilStructures.assertRead("?type=SYSTEM&who=", 30, -1); ITUtilStructures.assertRead("?type=SYSTEM&who=test", 0); - ITUtilStructures.assertRead("?type=SYSTEM&who=who", 0); - ITUtilStructures.assertRead("?type=SYSTEM&who=test%", 30, -1); - ITUtilStructures.assertRead("?type=SYSTEM&who=%who", 30, -1); - ITUtilStructures.assertRead("?type=SYSTEM&who=%est%", 30, -1); - ITUtilStructures.assertRead("?type=SYSTEM&who=%wh%", 30, -1); - ITUtilStructures.assertRead("?type=SYSTEM&who=wh%", 0); - ITUtilStructures.assertRead("?type=SYSTEM&who=asdf", 0); - ITUtilStructures.assertRead("?type=SYSTEM&who=%asdf%", 0); // order by // avoid