From 61dc2b94daafa6a182825b2614348ff7186d797f Mon Sep 17 00:00:00 2001 From: lukaskabc Date: Wed, 4 Sep 2024 13:03:33 +0200 Subject: [PATCH] optimize imports --- .../termit/config/SessionTimeoutManager.java | 5 ++-- .../kbss/termit/dto/AggregatedChangeInfo.java | 6 ++++- .../kbss/termit/dto/ConfigurationDto.java | 6 ++++- .../cz/cvut/kbss/termit/dto/RdfsResource.java | 8 ++++++- .../termit/dto/RecentlyCommentedAsset.java | 10 +++++++- .../termit/dto/RecentlyModifiedAsset.java | 13 ++++++++-- .../cz/cvut/kbss/termit/dto/Snapshot.java | 9 ++++++- .../cz/cvut/kbss/termit/dto/TermInfo.java | 8 ++++++- .../dto/acl/AccessControlRecordDto.java | 6 ++++- .../assignment/ResourceTermOccurrences.java | 7 +++++- .../dto/assignment/TermOccurrences.java | 6 ++++- .../kbss/termit/dto/mapper/DtoMapper.java | 8 ++++++- .../termit/dto/readonly/ReadOnlyTerm.java | 13 ++++++++-- .../dto/search/FacetedSearchResult.java | 7 +++++- .../dto/search/FullTextSearchResult.java | 10 +++++++- .../termit/event/DocumentRenameEvent.java | 3 ++- .../java/cz/cvut/kbss/termit/model/User.java | 2 +- .../cvut/kbss/termit/model/UserAccount.java | 8 +++++-- .../cz/cvut/kbss/termit/model/UserGroup.java | 8 +++++-- .../termit/model/acl/AccessControlRecord.java | 6 ++++- .../model/assignment/OccurrenceTarget.java | 6 ++++- .../changetracking/AbstractChangeRecord.java | 6 ++++- .../kbss/termit/model/comment/Comment.java | 10 +++++++- .../cvut/kbss/termit/model/resource/File.java | 6 ++++- .../kbss/termit/model/resource/Resource.java | 2 +- .../termit/model/selector/CssSelector.java | 2 +- .../model/selector/FragmentSelector.java | 2 +- .../model/selector/TextPositionSelector.java | 2 +- .../model/selector/TextQuoteSelector.java | 2 +- .../termit/model/selector/XPathSelector.java | 2 +- .../validation/WithoutQueryParameters.java | 1 + .../WithoutQueryParametersValidator.java | 1 + .../model/validation/ValidationResult.java | 3 ++- .../persistence/MainPersistenceFactory.java | 11 ++++++--- .../kbss/termit/persistence/dao/DataDao.java | 2 +- .../termit/persistence/dao/SearchDao.java | 2 +- .../persistence/dao/UserAccountDao.java | 2 +- .../persistence/dao/skos/SKOSExporter.java | 12 ++++++++-- .../SparqlResultToTermOccurrenceMapper.java | 12 ++++++++-- .../validation/ResultCachingValidator.java | 7 +++++- .../persistence/validation/Validator.java | 7 ++++-- .../kbss/termit/rest/SnapshotController.java | 7 +++++- .../cvut/kbss/termit/rest/UserController.java | 11 ++++++++- .../kbss/termit/rest/UserGroupController.java | 10 +++++++- .../kbss/termit/rest/WorkspaceController.java | 7 +++++- .../rest/readonly/ReadOnlyTermController.java | 6 ++++- .../ReadOnlyVocabularyController.java | 6 ++++- .../servlet/DiagnosticsContextFilter.java | 6 ++--- .../cvut/kbss/termit/rest/util/RestUtils.java | 4 ++-- .../security/AuthenticationFailure.java | 4 ++-- .../security/AuthenticationSuccess.java | 4 ++-- .../security/JwtAuthenticationFilter.java | 8 +++---- .../security/model/TermItUserDetails.java | 11 +++++---- .../kbss/termit/security/model/UserRole.java | 1 + .../service/business/VocabularyService.java | 2 +- .../MetamodelBasedChangeCalculator.java | 16 +++++++++++-- .../document/DefaultDocumentManager.java | 11 +++++++-- .../service/document/TextAnalysisService.java | 6 ++++- .../export/ExcelVocabularyExporter.java | 2 +- .../kbss/termit/service/mail/Postman.java | 8 +++---- .../notification/CommentChangeNotifier.java | 16 +++++++++++-- .../notification/NotificationService.java | 5 +++- .../BaseAssetRepositoryService.java | 3 +-- .../repository/BaseRepositoryService.java | 2 +- .../RepositoryAccessControlListService.java | 6 ++++- .../repository/ResourceRepositoryService.java | 2 +- .../UserGroupRepositoryService.java | 2 +- .../repository/UserRepositoryService.java | 3 +-- .../util/AdjustedUriTemplateProxyServlet.java | 6 ++--- ...lingualStringPrimaryNotBlankValidator.java | 3 +-- .../termit/validation/PrimaryNotBlank.java | 8 ++++++- .../termit/validation/ValidationResult.java | 1 + .../termit/websocket/ResultWithHeaders.java | 2 +- .../websocket/VocabularySocketController.java | 2 -- .../workspace/EditableVocabularies.java | 4 +++- .../workspace/EditableVocabulariesHolder.java | 6 ++++- .../dto/assignment/TermOccurrencesTest.java | 2 +- .../kbss/termit/dto/mapper/DtoMapperTest.java | 6 ++++- .../termit/dto/readonly/ReadOnlyTermTest.java | 10 ++++++-- .../termit/dto/search/SearchParamTest.java | 2 +- .../environment/TestPersistenceFactory.java | 9 ++++--- .../exception/ValidationExceptionTest.java | 3 +-- .../cvut/kbss/termit/model/DocumentTest.java | 6 ++++- .../cz/cvut/kbss/termit/model/TermTest.java | 10 ++++++-- .../kbss/termit/model/UserAccountTest.java | 6 ++++- .../acl/RoleAccessControlRecordTest.java | 4 +++- .../acl/UserAccessControlRecordTest.java | 4 +++- .../acl/UserGroupAccessControlRecordTest.java | 4 +++- .../util/EntityToOwlClassMapperTest.java | 5 ++-- .../TextAnalysisRecordDaoTest.java | 4 +++- .../DefaultVocabularyContextMapperTest.java | 6 ++++- .../context/DescriptorFactoryTest.java | 4 +++- .../WorkspaceVocabularyContextMapperTest.java | 4 +++- .../termit/persistence/dao/AssetDaoTest.java | 10 ++++++-- .../persistence/dao/BaseAssetDaoTest.java | 3 ++- .../persistence/dao/SnapshotDaoTest.java | 4 +++- .../dao/TermDaoExactMatchTermsTest.java | 24 +++++++++---------- .../dao/TermDaoRelatedTermsTest.java | 18 +++++++++++--- .../persistence/dao/TermDaoSnapshotsTest.java | 11 +++++++-- .../dao/TermOccurrenceDaoTest.java | 22 +++++++++++++---- .../persistence/dao/UserAccountDaoTest.java | 5 +++- .../dao/acl/AccessControlListDaoTest.java | 16 ++++++++++--- .../changetracking/ChangeRecordDaoTest.java | 12 ++++++++-- .../ChangeTrackingContextResolverTest.java | 4 +++- .../ChangeTrackingHelperDaoTest.java | 5 +++- .../dao/comment/CommentReactionDaoTest.java | 4 +++- .../dao/lucene/LuceneSearchDaoTest.java | 7 +++++- .../SparqlResultToTermInfoMapperTest.java | 2 +- .../CascadingSnapshotCreatorTest.java | 5 +++- .../ResultCachingValidatorTest.java | 6 ++++- .../termit/rest/BaseControllerTestRunner.java | 5 +++- .../termit/rest/CommentControllerTest.java | 11 +++++++-- .../ConfigurationControllerSecurityTest.java | 4 +++- .../termit/rest/ResourceControllerTest.java | 2 +- .../kbss/termit/rest/TermControllerTest.java | 2 +- .../rest/UserControllerSecurityTest.java | 10 +++++--- .../kbss/termit/rest/UserControllerTest.java | 10 ++++++-- .../termit/rest/UserGroupControllerTest.java | 4 +++- .../VocabularyControllerSecurityTest.java | 4 +++- .../termit/rest/VocabularyControllerTest.java | 4 +--- .../servlet/DiagnosticsContextFilterTest.java | 10 ++++---- .../kbss/termit/rest/util/RestUtilsTest.java | 7 ++++-- .../security/AuthenticationFailureTest.java | 4 +++- .../security/AuthenticationSuccessTest.java | 5 +++- .../kbss/termit/security/JwtUtilsTest.java | 12 ++++++++-- ...OntologicalAuthenticationProviderTest.java | 11 +++++++-- .../security/model/TermItUserDetailsTest.java | 6 +++-- .../service/IdentifierResolverTest.java | 6 ++++- .../service/business/ResourceServiceTest.java | 2 +- .../service/business/SearchServiceTest.java | 10 ++++++-- .../service/business/TermServiceTest.java | 2 +- .../readonly/ReadOnlyTermServiceTest.java | 5 +++- .../ReadOnlyVocabularyServiceTest.java | 5 +++- .../MetamodelBasedChangeCalculatorTest.java | 8 +++++-- .../document/DefaultDocumentManagerTest.java | 7 +++++- .../document/TextAnalysisServiceTest.java | 19 ++++++++++++--- .../service/export/ExcelTermExporterTest.java | 8 ++++++- .../export/ExcelVocabularyExporterTest.java | 7 +++++- .../export/SKOSVocabularyExporterTest.java | 12 ++++++++-- .../init/AdminAccountGeneratorTest.java | 9 +++++-- ...abularyAccessControlListGeneratorTest.java | 11 +++++---- .../language/UfoTermTypesServiceTest.java | 4 +++- .../termit/service/mail/AssetLinkTest.java | 4 +++- .../CommentChangeNotifierTest.java | 15 +++++++++--- .../notification/NotificationServiceTest.java | 4 +++- .../BaseAssetRepositoryServiceImpl.java | 3 +-- .../BaseAssetRepositoryServiceTest.java | 6 +++-- .../repository/BaseRepositoryServiceImpl.java | 3 +-- .../repository/BaseRepositoryServiceTest.java | 16 ++++++++++--- ...epositoryAccessControlListServiceTest.java | 16 ++++++++++--- .../ResourceRepositoryServiceTest.java | 13 ++++++---- .../repository/UserRepositoryServiceTest.java | 15 ++++++++---- .../RuntimeBasedLoginTrackerTest.java | 9 +++++-- .../TermItUserDetailsServiceTest.java | 6 +++-- .../ResourceAuthorizationServiceTest.java | 4 +++- .../SnapshotAuthorizationServiceTest.java | 5 +++- .../VocabularyAuthorizationServiceTest.java | 10 ++++++-- ...trolListBasedAuthorizationServiceTest.java | 14 ++++++++--- ...sertedInferredValueDifferentiatorTest.java | 8 +++++-- ...thenticatingServletRequestWrapperTest.java | 4 +++- .../cvut/kbss/termit/util/CsvUtilsTest.java | 4 ++-- .../cz/cvut/kbss/termit/util/UtilsTest.java | 7 +++++- ...ualStringPrimaryNotBlankValidatorTest.java | 3 +-- .../workspace/EditableVocabulariesTest.java | 4 +++- 164 files changed, 827 insertions(+), 269 deletions(-) diff --git a/src/main/java/cz/cvut/kbss/termit/config/SessionTimeoutManager.java b/src/main/java/cz/cvut/kbss/termit/config/SessionTimeoutManager.java index e4896c0ca..51d7ec681 100644 --- a/src/main/java/cz/cvut/kbss/termit/config/SessionTimeoutManager.java +++ b/src/main/java/cz/cvut/kbss/termit/config/SessionTimeoutManager.java @@ -18,12 +18,11 @@ package cz.cvut.kbss.termit.config; import cz.cvut.kbss.termit.security.SecurityConstants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - import jakarta.servlet.annotation.WebListener; import jakarta.servlet.http.HttpSessionEvent; import jakarta.servlet.http.HttpSessionListener; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; @WebListener public class SessionTimeoutManager implements HttpSessionListener { diff --git a/src/main/java/cz/cvut/kbss/termit/dto/AggregatedChangeInfo.java b/src/main/java/cz/cvut/kbss/termit/dto/AggregatedChangeInfo.java index 6624d8fbd..c07bc314f 100644 --- a/src/main/java/cz/cvut/kbss/termit/dto/AggregatedChangeInfo.java +++ b/src/main/java/cz/cvut/kbss/termit/dto/AggregatedChangeInfo.java @@ -17,7 +17,11 @@ */ package cz.cvut.kbss.termit.dto; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.ConstructorResult; +import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; +import cz.cvut.kbss.jopa.model.annotations.SparqlResultSetMapping; +import cz.cvut.kbss.jopa.model.annotations.Types; +import cz.cvut.kbss.jopa.model.annotations.VariableResult; import cz.cvut.kbss.termit.model.util.HasTypes; import cz.cvut.kbss.termit.util.Vocabulary; diff --git a/src/main/java/cz/cvut/kbss/termit/dto/ConfigurationDto.java b/src/main/java/cz/cvut/kbss/termit/dto/ConfigurationDto.java index d8c4cb821..8b4591fcc 100644 --- a/src/main/java/cz/cvut/kbss/termit/dto/ConfigurationDto.java +++ b/src/main/java/cz/cvut/kbss/termit/dto/ConfigurationDto.java @@ -17,7 +17,11 @@ */ package cz.cvut.kbss.termit.dto; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.Id; +import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; +import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; import cz.cvut.kbss.jopa.model.annotations.util.NonEntity; import cz.cvut.kbss.jopa.vocabulary.DC; import cz.cvut.kbss.termit.model.UserRole; diff --git a/src/main/java/cz/cvut/kbss/termit/dto/RdfsResource.java b/src/main/java/cz/cvut/kbss/termit/dto/RdfsResource.java index 9b21b85aa..43228b2a2 100644 --- a/src/main/java/cz/cvut/kbss/termit/dto/RdfsResource.java +++ b/src/main/java/cz/cvut/kbss/termit/dto/RdfsResource.java @@ -18,7 +18,13 @@ package cz.cvut.kbss.termit.dto; import cz.cvut.kbss.jopa.model.MultilingualString; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.ConstructorResult; +import cz.cvut.kbss.jopa.model.annotations.Id; +import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; +import cz.cvut.kbss.jopa.model.annotations.SparqlResultSetMapping; +import cz.cvut.kbss.jopa.model.annotations.Types; +import cz.cvut.kbss.jopa.model.annotations.VariableResult; import cz.cvut.kbss.jopa.vocabulary.RDFS; import cz.cvut.kbss.ontodriver.model.LangString; import cz.cvut.kbss.termit.model.util.HasIdentifier; diff --git a/src/main/java/cz/cvut/kbss/termit/dto/RecentlyCommentedAsset.java b/src/main/java/cz/cvut/kbss/termit/dto/RecentlyCommentedAsset.java index 03419f92c..2e80ce4f0 100644 --- a/src/main/java/cz/cvut/kbss/termit/dto/RecentlyCommentedAsset.java +++ b/src/main/java/cz/cvut/kbss/termit/dto/RecentlyCommentedAsset.java @@ -17,12 +17,20 @@ */ package cz.cvut.kbss.termit.dto; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.ConstructorResult; +import cz.cvut.kbss.jopa.model.annotations.Id; +import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; +import cz.cvut.kbss.jopa.model.annotations.SparqlResultSetMapping; +import cz.cvut.kbss.jopa.model.annotations.Transient; +import cz.cvut.kbss.jopa.model.annotations.Types; +import cz.cvut.kbss.jopa.model.annotations.VariableResult; import cz.cvut.kbss.jopa.vocabulary.RDFS; import cz.cvut.kbss.termit.model.comment.Comment; import cz.cvut.kbss.termit.model.util.HasTypes; import cz.cvut.kbss.termit.util.Utils; import cz.cvut.kbss.termit.util.Vocabulary; + import java.io.Serializable; import java.net.URI; import java.util.Collections; diff --git a/src/main/java/cz/cvut/kbss/termit/dto/RecentlyModifiedAsset.java b/src/main/java/cz/cvut/kbss/termit/dto/RecentlyModifiedAsset.java index e8f2afb9d..f0c6aa53d 100644 --- a/src/main/java/cz/cvut/kbss/termit/dto/RecentlyModifiedAsset.java +++ b/src/main/java/cz/cvut/kbss/termit/dto/RecentlyModifiedAsset.java @@ -18,7 +18,13 @@ package cz.cvut.kbss.termit.dto; import com.fasterxml.jackson.annotation.JsonIgnore; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.ConstructorResult; +import cz.cvut.kbss.jopa.model.annotations.Id; +import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; +import cz.cvut.kbss.jopa.model.annotations.SparqlResultSetMapping; +import cz.cvut.kbss.jopa.model.annotations.Types; +import cz.cvut.kbss.jopa.model.annotations.VariableResult; import cz.cvut.kbss.jopa.vocabulary.DC; import cz.cvut.kbss.jopa.vocabulary.RDFS; import cz.cvut.kbss.termit.model.User; @@ -29,7 +35,10 @@ import java.io.Serializable; import java.net.URI; import java.time.Instant; -import java.util.*; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; @SparqlResultSetMapping(name = "RecentlyModifiedAsset", classes = {@ConstructorResult(targetClass = RecentlyModifiedAsset.class, variables = { diff --git a/src/main/java/cz/cvut/kbss/termit/dto/Snapshot.java b/src/main/java/cz/cvut/kbss/termit/dto/Snapshot.java index ffd48370d..75b92277b 100644 --- a/src/main/java/cz/cvut/kbss/termit/dto/Snapshot.java +++ b/src/main/java/cz/cvut/kbss/termit/dto/Snapshot.java @@ -17,7 +17,14 @@ */ package cz.cvut.kbss.termit.dto; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.ConstructorResult; +import cz.cvut.kbss.jopa.model.annotations.Id; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; +import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; +import cz.cvut.kbss.jopa.model.annotations.SparqlResultSetMapping; +import cz.cvut.kbss.jopa.model.annotations.Types; +import cz.cvut.kbss.jopa.model.annotations.VariableResult; import cz.cvut.kbss.termit.model.util.HasIdentifier; import cz.cvut.kbss.termit.model.util.HasTypes; import cz.cvut.kbss.termit.util.Vocabulary; diff --git a/src/main/java/cz/cvut/kbss/termit/dto/TermInfo.java b/src/main/java/cz/cvut/kbss/termit/dto/TermInfo.java index 8e966bc8b..37164b087 100644 --- a/src/main/java/cz/cvut/kbss/termit/dto/TermInfo.java +++ b/src/main/java/cz/cvut/kbss/termit/dto/TermInfo.java @@ -18,7 +18,13 @@ package cz.cvut.kbss.termit.dto; import cz.cvut.kbss.jopa.model.MultilingualString; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.Id; +import cz.cvut.kbss.jopa.model.annotations.Inferred; +import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; +import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; +import cz.cvut.kbss.jopa.model.annotations.Types; import cz.cvut.kbss.jopa.vocabulary.SKOS; import cz.cvut.kbss.termit.model.AbstractTerm; import cz.cvut.kbss.termit.model.Term; diff --git a/src/main/java/cz/cvut/kbss/termit/dto/acl/AccessControlRecordDto.java b/src/main/java/cz/cvut/kbss/termit/dto/acl/AccessControlRecordDto.java index d92f9853b..854c8b3ea 100644 --- a/src/main/java/cz/cvut/kbss/termit/dto/acl/AccessControlRecordDto.java +++ b/src/main/java/cz/cvut/kbss/termit/dto/acl/AccessControlRecordDto.java @@ -17,7 +17,11 @@ */ package cz.cvut.kbss.termit.dto.acl; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.EnumType; +import cz.cvut.kbss.jopa.model.annotations.Enumerated; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; +import cz.cvut.kbss.jopa.model.annotations.Types; import cz.cvut.kbss.jopa.model.annotations.util.NonEntity; import cz.cvut.kbss.termit.model.AbstractEntity; import cz.cvut.kbss.termit.model.acl.AccessLevel; diff --git a/src/main/java/cz/cvut/kbss/termit/dto/assignment/ResourceTermOccurrences.java b/src/main/java/cz/cvut/kbss/termit/dto/assignment/ResourceTermOccurrences.java index b77431723..4a542919a 100644 --- a/src/main/java/cz/cvut/kbss/termit/dto/assignment/ResourceTermOccurrences.java +++ b/src/main/java/cz/cvut/kbss/termit/dto/assignment/ResourceTermOccurrences.java @@ -17,7 +17,12 @@ */ package cz.cvut.kbss.termit.dto.assignment; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.ConstructorResult; +import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; +import cz.cvut.kbss.jopa.model.annotations.SparqlResultSetMapping; +import cz.cvut.kbss.jopa.model.annotations.VariableResult; import cz.cvut.kbss.jopa.vocabulary.RDFS; import cz.cvut.kbss.termit.util.Vocabulary; diff --git a/src/main/java/cz/cvut/kbss/termit/dto/assignment/TermOccurrences.java b/src/main/java/cz/cvut/kbss/termit/dto/assignment/TermOccurrences.java index 17d388961..87c5b702e 100644 --- a/src/main/java/cz/cvut/kbss/termit/dto/assignment/TermOccurrences.java +++ b/src/main/java/cz/cvut/kbss/termit/dto/assignment/TermOccurrences.java @@ -18,7 +18,11 @@ package cz.cvut.kbss.termit.dto.assignment; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.ConstructorResult; +import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; +import cz.cvut.kbss.jopa.model.annotations.SparqlResultSetMapping; +import cz.cvut.kbss.jopa.model.annotations.VariableResult; import cz.cvut.kbss.jopa.vocabulary.RDFS; import cz.cvut.kbss.termit.util.Vocabulary; diff --git a/src/main/java/cz/cvut/kbss/termit/dto/mapper/DtoMapper.java b/src/main/java/cz/cvut/kbss/termit/dto/mapper/DtoMapper.java index 7dd68b02f..0757963dc 100644 --- a/src/main/java/cz/cvut/kbss/termit/dto/mapper/DtoMapper.java +++ b/src/main/java/cz/cvut/kbss/termit/dto/mapper/DtoMapper.java @@ -25,7 +25,13 @@ import cz.cvut.kbss.termit.dto.acl.AccessHolderDto; import cz.cvut.kbss.termit.dto.listing.DocumentDto; import cz.cvut.kbss.termit.dto.listing.VocabularyDto; -import cz.cvut.kbss.termit.model.*; +import cz.cvut.kbss.termit.model.AccessControlAgent; +import cz.cvut.kbss.termit.model.Asset; +import cz.cvut.kbss.termit.model.PasswordChangeRequest; +import cz.cvut.kbss.termit.model.User; +import cz.cvut.kbss.termit.model.UserGroup; +import cz.cvut.kbss.termit.model.UserRole; +import cz.cvut.kbss.termit.model.Vocabulary; import cz.cvut.kbss.termit.model.acl.AccessControlList; import cz.cvut.kbss.termit.model.acl.AccessControlRecord; import cz.cvut.kbss.termit.model.resource.Document; diff --git a/src/main/java/cz/cvut/kbss/termit/dto/readonly/ReadOnlyTerm.java b/src/main/java/cz/cvut/kbss/termit/dto/readonly/ReadOnlyTerm.java index cd9a2ac23..e43283c94 100644 --- a/src/main/java/cz/cvut/kbss/termit/dto/readonly/ReadOnlyTerm.java +++ b/src/main/java/cz/cvut/kbss/termit/dto/readonly/ReadOnlyTerm.java @@ -18,15 +18,24 @@ package cz.cvut.kbss.termit.dto.readonly; import cz.cvut.kbss.jopa.model.MultilingualString; +import cz.cvut.kbss.jopa.model.annotations.FetchType; +import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; +import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; import cz.cvut.kbss.jopa.model.annotations.Properties; -import cz.cvut.kbss.jopa.model.annotations.*; import cz.cvut.kbss.jopa.vocabulary.DC; import cz.cvut.kbss.jopa.vocabulary.SKOS; import cz.cvut.kbss.termit.dto.TermInfo; import cz.cvut.kbss.termit.model.AbstractTerm; import cz.cvut.kbss.termit.model.Term; -import java.util.*; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; import java.util.stream.Collectors; @OWLClass(iri = SKOS.CONCEPT) diff --git a/src/main/java/cz/cvut/kbss/termit/dto/search/FacetedSearchResult.java b/src/main/java/cz/cvut/kbss/termit/dto/search/FacetedSearchResult.java index cb54fdbc7..0fd546ca3 100644 --- a/src/main/java/cz/cvut/kbss/termit/dto/search/FacetedSearchResult.java +++ b/src/main/java/cz/cvut/kbss/termit/dto/search/FacetedSearchResult.java @@ -18,7 +18,12 @@ package cz.cvut.kbss.termit.dto.search; import cz.cvut.kbss.jopa.model.MultilingualString; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.Inferred; +import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; +import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; +import cz.cvut.kbss.jopa.model.annotations.Types; import cz.cvut.kbss.jopa.vocabulary.SKOS; import cz.cvut.kbss.termit.model.Asset; import cz.cvut.kbss.termit.model.util.HasTypes; diff --git a/src/main/java/cz/cvut/kbss/termit/dto/search/FullTextSearchResult.java b/src/main/java/cz/cvut/kbss/termit/dto/search/FullTextSearchResult.java index e0a6cdde5..c107aea5d 100644 --- a/src/main/java/cz/cvut/kbss/termit/dto/search/FullTextSearchResult.java +++ b/src/main/java/cz/cvut/kbss/termit/dto/search/FullTextSearchResult.java @@ -17,7 +17,15 @@ */ package cz.cvut.kbss.termit.dto.search; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.ConstructorResult; +import cz.cvut.kbss.jopa.model.annotations.Id; +import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; +import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; +import cz.cvut.kbss.jopa.model.annotations.SparqlResultSetMapping; +import cz.cvut.kbss.jopa.model.annotations.Types; +import cz.cvut.kbss.jopa.model.annotations.VariableResult; import cz.cvut.kbss.jopa.vocabulary.RDFS; import cz.cvut.kbss.termit.model.util.HasIdentifier; import cz.cvut.kbss.termit.model.util.HasTypes; diff --git a/src/main/java/cz/cvut/kbss/termit/event/DocumentRenameEvent.java b/src/main/java/cz/cvut/kbss/termit/event/DocumentRenameEvent.java index c6510df71..529f6456e 100644 --- a/src/main/java/cz/cvut/kbss/termit/event/DocumentRenameEvent.java +++ b/src/main/java/cz/cvut/kbss/termit/event/DocumentRenameEvent.java @@ -18,9 +18,10 @@ package cz.cvut.kbss.termit.event; import cz.cvut.kbss.termit.model.resource.Document; -import java.util.Objects; import org.springframework.context.ApplicationEvent; +import java.util.Objects; + /** * Indicates that a {@link Document} asset has changed its label. */ diff --git a/src/main/java/cz/cvut/kbss/termit/model/User.java b/src/main/java/cz/cvut/kbss/termit/model/User.java index 266d971df..c7a6ff5b3 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/User.java +++ b/src/main/java/cz/cvut/kbss/termit/model/User.java @@ -24,8 +24,8 @@ import cz.cvut.kbss.jopa.model.annotations.Types; import cz.cvut.kbss.termit.model.util.HasTypes; import cz.cvut.kbss.termit.util.Vocabulary; - import jakarta.validation.constraints.NotBlank; + import java.io.Serializable; import java.util.HashSet; import java.util.Objects; diff --git a/src/main/java/cz/cvut/kbss/termit/model/UserAccount.java b/src/main/java/cz/cvut/kbss/termit/model/UserAccount.java index 29b91d0dc..1de862f79 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/UserAccount.java +++ b/src/main/java/cz/cvut/kbss/termit/model/UserAccount.java @@ -18,13 +18,17 @@ package cz.cvut.kbss.termit.model; import com.fasterxml.jackson.annotation.JsonIgnore; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.Id; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; +import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; +import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; +import cz.cvut.kbss.jopa.model.annotations.Types; import cz.cvut.kbss.termit.model.util.HasIdentifier; import cz.cvut.kbss.termit.model.util.HasTypes; import cz.cvut.kbss.termit.security.model.UserRole; import cz.cvut.kbss.termit.util.Vocabulary; - import jakarta.validation.constraints.NotBlank; + import java.io.Serializable; import java.net.URI; import java.time.Instant; diff --git a/src/main/java/cz/cvut/kbss/termit/model/UserGroup.java b/src/main/java/cz/cvut/kbss/termit/model/UserGroup.java index 19caf4e7c..7ebcc52b8 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/UserGroup.java +++ b/src/main/java/cz/cvut/kbss/termit/model/UserGroup.java @@ -17,12 +17,16 @@ */ package cz.cvut.kbss.termit.model; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.FetchType; +import cz.cvut.kbss.jopa.model.annotations.OWLAnnotationProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; +import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; import cz.cvut.kbss.jopa.vocabulary.DC; import cz.cvut.kbss.termit.util.Utils; import cz.cvut.kbss.termit.util.Vocabulary; - import jakarta.validation.constraints.NotBlank; + import java.util.HashSet; import java.util.Objects; import java.util.Set; diff --git a/src/main/java/cz/cvut/kbss/termit/model/acl/AccessControlRecord.java b/src/main/java/cz/cvut/kbss/termit/model/acl/AccessControlRecord.java index b9ff030c2..14020951e 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/acl/AccessControlRecord.java +++ b/src/main/java/cz/cvut/kbss/termit/model/acl/AccessControlRecord.java @@ -18,7 +18,11 @@ package cz.cvut.kbss.termit.model.acl; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.EnumType; +import cz.cvut.kbss.jopa.model.annotations.Enumerated; +import cz.cvut.kbss.jopa.model.annotations.FetchType; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; import cz.cvut.kbss.termit.model.AbstractEntity; import cz.cvut.kbss.termit.model.AccessControlAgent; import cz.cvut.kbss.termit.model.UserAccount; diff --git a/src/main/java/cz/cvut/kbss/termit/model/assignment/OccurrenceTarget.java b/src/main/java/cz/cvut/kbss/termit/model/assignment/OccurrenceTarget.java index a46dc56f2..1a695e734 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/assignment/OccurrenceTarget.java +++ b/src/main/java/cz/cvut/kbss/termit/model/assignment/OccurrenceTarget.java @@ -18,7 +18,11 @@ package cz.cvut.kbss.termit.model.assignment; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.CascadeType; +import cz.cvut.kbss.jopa.model.annotations.FetchType; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; +import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; import cz.cvut.kbss.termit.model.AbstractEntity; import cz.cvut.kbss.termit.model.Asset; import cz.cvut.kbss.termit.model.selector.Selector; diff --git a/src/main/java/cz/cvut/kbss/termit/model/changetracking/AbstractChangeRecord.java b/src/main/java/cz/cvut/kbss/termit/model/changetracking/AbstractChangeRecord.java index 2a388df19..58d100b92 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/changetracking/AbstractChangeRecord.java +++ b/src/main/java/cz/cvut/kbss/termit/model/changetracking/AbstractChangeRecord.java @@ -18,7 +18,11 @@ package cz.cvut.kbss.termit.model.changetracking; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.FetchType; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; +import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; +import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; import cz.cvut.kbss.termit.model.AbstractEntity; import cz.cvut.kbss.termit.model.Asset; import cz.cvut.kbss.termit.model.User; diff --git a/src/main/java/cz/cvut/kbss/termit/model/comment/Comment.java b/src/main/java/cz/cvut/kbss/termit/model/comment/Comment.java index e3731c8b4..6e73ab8f9 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/comment/Comment.java +++ b/src/main/java/cz/cvut/kbss/termit/model/comment/Comment.java @@ -17,7 +17,15 @@ */ package cz.cvut.kbss.termit.model.comment; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.CascadeType; +import cz.cvut.kbss.jopa.model.annotations.FetchType; +import cz.cvut.kbss.jopa.model.annotations.Inferred; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; +import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; +import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; +import cz.cvut.kbss.jopa.model.annotations.PrePersist; +import cz.cvut.kbss.jopa.model.annotations.PreUpdate; import cz.cvut.kbss.termit.model.AbstractEntity; import cz.cvut.kbss.termit.model.User; import cz.cvut.kbss.termit.util.Utils; diff --git a/src/main/java/cz/cvut/kbss/termit/model/resource/File.java b/src/main/java/cz/cvut/kbss/termit/model/resource/File.java index 96cadfe60..26b45f940 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/resource/File.java +++ b/src/main/java/cz/cvut/kbss/termit/model/resource/File.java @@ -19,7 +19,11 @@ import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonIgnore; -import cz.cvut.kbss.jopa.model.annotations.*; +import cz.cvut.kbss.jopa.model.annotations.FetchType; +import cz.cvut.kbss.jopa.model.annotations.Inferred; +import cz.cvut.kbss.jopa.model.annotations.OWLClass; +import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; +import cz.cvut.kbss.jopa.model.annotations.Types; import cz.cvut.kbss.jsonld.annotation.JsonLdAttributeOrder; import cz.cvut.kbss.termit.exception.TermItException; import cz.cvut.kbss.termit.model.util.SupportsStorage; diff --git a/src/main/java/cz/cvut/kbss/termit/model/resource/Resource.java b/src/main/java/cz/cvut/kbss/termit/model/resource/Resource.java index a29612c5d..f10dd9d36 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/resource/Resource.java +++ b/src/main/java/cz/cvut/kbss/termit/model/resource/Resource.java @@ -28,8 +28,8 @@ import cz.cvut.kbss.termit.model.changetracking.Audited; import cz.cvut.kbss.termit.model.util.AssetVisitor; import cz.cvut.kbss.termit.util.Vocabulary; - import jakarta.validation.constraints.NotBlank; + import java.io.Serializable; import java.util.Objects; diff --git a/src/main/java/cz/cvut/kbss/termit/model/selector/CssSelector.java b/src/main/java/cz/cvut/kbss/termit/model/selector/CssSelector.java index 740fb60e5..af81ac89d 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/selector/CssSelector.java +++ b/src/main/java/cz/cvut/kbss/termit/model/selector/CssSelector.java @@ -22,8 +22,8 @@ import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; import cz.cvut.kbss.jopa.vocabulary.RDF; import cz.cvut.kbss.termit.util.Vocabulary; - import jakarta.validation.constraints.NotBlank; + import java.util.Objects; @OWLClass(iri = Vocabulary.s_c_selektor_css) diff --git a/src/main/java/cz/cvut/kbss/termit/model/selector/FragmentSelector.java b/src/main/java/cz/cvut/kbss/termit/model/selector/FragmentSelector.java index 55cb77191..3c97fab18 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/selector/FragmentSelector.java +++ b/src/main/java/cz/cvut/kbss/termit/model/selector/FragmentSelector.java @@ -22,8 +22,8 @@ import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; import cz.cvut.kbss.jopa.vocabulary.RDF; import cz.cvut.kbss.termit.util.Vocabulary; - import jakarta.validation.constraints.NotBlank; + import java.util.Objects; @OWLClass(iri = Vocabulary.s_c_selektor_fragmentem) diff --git a/src/main/java/cz/cvut/kbss/termit/model/selector/TextPositionSelector.java b/src/main/java/cz/cvut/kbss/termit/model/selector/TextPositionSelector.java index 538d9dd87..0d5bfb66a 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/selector/TextPositionSelector.java +++ b/src/main/java/cz/cvut/kbss/termit/model/selector/TextPositionSelector.java @@ -21,8 +21,8 @@ import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; import cz.cvut.kbss.termit.util.Vocabulary; - import jakarta.validation.constraints.NotNull; + import java.util.Objects; /** diff --git a/src/main/java/cz/cvut/kbss/termit/model/selector/TextQuoteSelector.java b/src/main/java/cz/cvut/kbss/termit/model/selector/TextQuoteSelector.java index c1568019a..879374ca2 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/selector/TextQuoteSelector.java +++ b/src/main/java/cz/cvut/kbss/termit/model/selector/TextQuoteSelector.java @@ -21,8 +21,8 @@ import cz.cvut.kbss.jopa.model.annotations.OWLDataProperty; import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; import cz.cvut.kbss.termit.util.Vocabulary; - import jakarta.validation.constraints.NotBlank; + import java.util.Objects; import static cz.cvut.kbss.termit.util.Utils.trim; diff --git a/src/main/java/cz/cvut/kbss/termit/model/selector/XPathSelector.java b/src/main/java/cz/cvut/kbss/termit/model/selector/XPathSelector.java index d7097a5e4..1e3b8192a 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/selector/XPathSelector.java +++ b/src/main/java/cz/cvut/kbss/termit/model/selector/XPathSelector.java @@ -22,8 +22,8 @@ import cz.cvut.kbss.jopa.model.annotations.ParticipationConstraints; import cz.cvut.kbss.jopa.vocabulary.RDF; import cz.cvut.kbss.termit.util.Vocabulary; - import jakarta.validation.constraints.NotBlank; + import java.util.Objects; @OWLClass(iri = Vocabulary.s_c_selektor_xpath) diff --git a/src/main/java/cz/cvut/kbss/termit/model/util/validation/WithoutQueryParameters.java b/src/main/java/cz/cvut/kbss/termit/model/util/validation/WithoutQueryParameters.java index 1aeb67493..11a4c75f0 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/util/validation/WithoutQueryParameters.java +++ b/src/main/java/cz/cvut/kbss/termit/model/util/validation/WithoutQueryParameters.java @@ -19,6 +19,7 @@ import jakarta.validation.Constraint; import jakarta.validation.Payload; + import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; diff --git a/src/main/java/cz/cvut/kbss/termit/model/util/validation/WithoutQueryParametersValidator.java b/src/main/java/cz/cvut/kbss/termit/model/util/validation/WithoutQueryParametersValidator.java index 766680e08..54013a254 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/util/validation/WithoutQueryParametersValidator.java +++ b/src/main/java/cz/cvut/kbss/termit/model/util/validation/WithoutQueryParametersValidator.java @@ -19,6 +19,7 @@ import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; + import java.net.URI; /** diff --git a/src/main/java/cz/cvut/kbss/termit/model/validation/ValidationResult.java b/src/main/java/cz/cvut/kbss/termit/model/validation/ValidationResult.java index 5f6c81068..331bc461b 100644 --- a/src/main/java/cz/cvut/kbss/termit/model/validation/ValidationResult.java +++ b/src/main/java/cz/cvut/kbss/termit/model/validation/ValidationResult.java @@ -24,9 +24,10 @@ import cz.cvut.kbss.jopa.model.annotations.OWLObjectProperty; import cz.cvut.kbss.jopa.model.annotations.util.NonEntity; import cz.cvut.kbss.termit.model.Term; +import org.topbraid.shacl.vocabulary.SH; + import java.net.URI; import java.util.Objects; -import org.topbraid.shacl.vocabulary.SH; @NonEntity @OWLClass(iri = SH.BASE_URI + "ValidationResult") diff --git a/src/main/java/cz/cvut/kbss/termit/persistence/MainPersistenceFactory.java b/src/main/java/cz/cvut/kbss/termit/persistence/MainPersistenceFactory.java index 95cca9f18..250ea0b15 100644 --- a/src/main/java/cz/cvut/kbss/termit/persistence/MainPersistenceFactory.java +++ b/src/main/java/cz/cvut/kbss/termit/persistence/MainPersistenceFactory.java @@ -23,6 +23,8 @@ import cz.cvut.kbss.ontodriver.config.OntoDriverProperties; import cz.cvut.kbss.ontodriver.rdf4j.config.Rdf4jOntoDriverProperties; import cz.cvut.kbss.termit.event.EvictCacheEvent; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.PreDestroy; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; @@ -30,12 +32,15 @@ import org.springframework.context.annotation.Profile; import org.springframework.context.event.EventListener; -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; import java.util.HashMap; import java.util.Map; -import static cz.cvut.kbss.jopa.model.JOPAPersistenceProperties.*; +import static cz.cvut.kbss.jopa.model.JOPAPersistenceProperties.DATA_SOURCE_CLASS; +import static cz.cvut.kbss.jopa.model.JOPAPersistenceProperties.JPA_PERSISTENCE_PROVIDER; +import static cz.cvut.kbss.jopa.model.JOPAPersistenceProperties.LANG; +import static cz.cvut.kbss.jopa.model.JOPAPersistenceProperties.ONTOLOGY_PHYSICAL_URI_KEY; +import static cz.cvut.kbss.jopa.model.JOPAPersistenceProperties.PREFER_MULTILINGUAL_STRING; +import static cz.cvut.kbss.jopa.model.JOPAPersistenceProperties.SCAN_PACKAGE; /** * Sets up persistence and provides {@link EntityManagerFactory} as Spring bean. diff --git a/src/main/java/cz/cvut/kbss/termit/persistence/dao/DataDao.java b/src/main/java/cz/cvut/kbss/termit/persistence/dao/DataDao.java index c09d758dd..6ccb9786a 100644 --- a/src/main/java/cz/cvut/kbss/termit/persistence/dao/DataDao.java +++ b/src/main/java/cz/cvut/kbss/termit/persistence/dao/DataDao.java @@ -28,9 +28,9 @@ import cz.cvut.kbss.termit.exception.PersistenceException; import cz.cvut.kbss.termit.persistence.dao.util.Quad; import cz.cvut.kbss.termit.service.export.ExportFormat; -import cz.cvut.kbss.termit.util.TypeAwareByteArrayResource; import cz.cvut.kbss.termit.util.Configuration; import cz.cvut.kbss.termit.util.Configuration.Persistence; +import cz.cvut.kbss.termit.util.TypeAwareByteArrayResource; import cz.cvut.kbss.termit.util.TypeAwareResource; import jakarta.annotation.Nullable; import org.eclipse.rdf4j.model.Resource; diff --git a/src/main/java/cz/cvut/kbss/termit/persistence/dao/SearchDao.java b/src/main/java/cz/cvut/kbss/termit/persistence/dao/SearchDao.java index c4ca2a08d..8b6c0bffa 100644 --- a/src/main/java/cz/cvut/kbss/termit/persistence/dao/SearchDao.java +++ b/src/main/java/cz/cvut/kbss/termit/persistence/dao/SearchDao.java @@ -26,6 +26,7 @@ import cz.cvut.kbss.termit.util.Configuration; import cz.cvut.kbss.termit.util.Utils; import cz.cvut.kbss.termit.util.Vocabulary; +import jakarta.annotation.PostConstruct; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -34,7 +35,6 @@ import org.springframework.lang.NonNull; import org.springframework.stereotype.Repository; -import jakarta.annotation.PostConstruct; import java.net.URI; import java.util.Collection; import java.util.Collections; diff --git a/src/main/java/cz/cvut/kbss/termit/persistence/dao/UserAccountDao.java b/src/main/java/cz/cvut/kbss/termit/persistence/dao/UserAccountDao.java index 1a9fc53db..dd06ca16d 100644 --- a/src/main/java/cz/cvut/kbss/termit/persistence/dao/UserAccountDao.java +++ b/src/main/java/cz/cvut/kbss/termit/persistence/dao/UserAccountDao.java @@ -22,8 +22,8 @@ import cz.cvut.kbss.termit.exception.PersistenceException; import cz.cvut.kbss.termit.model.UserAccount; import cz.cvut.kbss.termit.util.Configuration; -import cz.cvut.kbss.termit.util.Vocabulary; import cz.cvut.kbss.termit.util.Configuration.Persistence; +import cz.cvut.kbss.termit.util.Vocabulary; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Repository; diff --git a/src/main/java/cz/cvut/kbss/termit/persistence/dao/skos/SKOSExporter.java b/src/main/java/cz/cvut/kbss/termit/persistence/dao/skos/SKOSExporter.java index d8995cdee..929edece9 100644 --- a/src/main/java/cz/cvut/kbss/termit/persistence/dao/skos/SKOSExporter.java +++ b/src/main/java/cz/cvut/kbss/termit/persistence/dao/skos/SKOSExporter.java @@ -25,8 +25,16 @@ import org.eclipse.rdf4j.model.Model; import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.LinkedHashModel; -import org.eclipse.rdf4j.model.vocabulary.*; -import org.eclipse.rdf4j.query.*; +import org.eclipse.rdf4j.model.vocabulary.DCTERMS; +import org.eclipse.rdf4j.model.vocabulary.OWL; +import org.eclipse.rdf4j.model.vocabulary.RDF; +import org.eclipse.rdf4j.model.vocabulary.RDFS; +import org.eclipse.rdf4j.model.vocabulary.SKOS; +import org.eclipse.rdf4j.query.BindingSet; +import org.eclipse.rdf4j.query.GraphQuery; +import org.eclipse.rdf4j.query.GraphQueryResult; +import org.eclipse.rdf4j.query.TupleQuery; +import org.eclipse.rdf4j.query.TupleQueryResult; import org.eclipse.rdf4j.repository.RepositoryConnection; import org.eclipse.rdf4j.rio.RDFWriter; import org.eclipse.rdf4j.rio.Rio; diff --git a/src/main/java/cz/cvut/kbss/termit/persistence/dao/util/SparqlResultToTermOccurrenceMapper.java b/src/main/java/cz/cvut/kbss/termit/persistence/dao/util/SparqlResultToTermOccurrenceMapper.java index 358895a49..55acedcdd 100644 --- a/src/main/java/cz/cvut/kbss/termit/persistence/dao/util/SparqlResultToTermOccurrenceMapper.java +++ b/src/main/java/cz/cvut/kbss/termit/persistence/dao/util/SparqlResultToTermOccurrenceMapper.java @@ -17,13 +17,21 @@ */ package cz.cvut.kbss.termit.persistence.dao.util; -import cz.cvut.kbss.termit.model.assignment.*; +import cz.cvut.kbss.termit.model.assignment.DefinitionalOccurrenceTarget; +import cz.cvut.kbss.termit.model.assignment.FileOccurrenceTarget; +import cz.cvut.kbss.termit.model.assignment.TermDefinitionalOccurrence; +import cz.cvut.kbss.termit.model.assignment.TermFileOccurrence; +import cz.cvut.kbss.termit.model.assignment.TermOccurrence; import cz.cvut.kbss.termit.model.selector.TextPositionSelector; import cz.cvut.kbss.termit.model.selector.TextQuoteSelector; import cz.cvut.kbss.termit.util.Vocabulary; import java.net.URI; -import java.util.*; +import java.util.ArrayList; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; /** * Maps SPARQL query results to {@link TermOccurrence} instances. diff --git a/src/main/java/cz/cvut/kbss/termit/persistence/validation/ResultCachingValidator.java b/src/main/java/cz/cvut/kbss/termit/persistence/validation/ResultCachingValidator.java index 0d25c8b6c..eb757ccfd 100644 --- a/src/main/java/cz/cvut/kbss/termit/persistence/validation/ResultCachingValidator.java +++ b/src/main/java/cz/cvut/kbss/termit/persistence/validation/ResultCachingValidator.java @@ -28,7 +28,12 @@ import org.springframework.stereotype.Component; import java.net.URI; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; @Component("cachingValidator") diff --git a/src/main/java/cz/cvut/kbss/termit/persistence/validation/Validator.java b/src/main/java/cz/cvut/kbss/termit/persistence/validation/Validator.java index 63b0689cc..80775c3b9 100644 --- a/src/main/java/cz/cvut/kbss/termit/persistence/validation/Validator.java +++ b/src/main/java/cz/cvut/kbss/termit/persistence/validation/Validator.java @@ -25,7 +25,6 @@ import cz.cvut.kbss.termit.model.validation.ValidationResult; import cz.cvut.kbss.termit.persistence.context.VocabularyContextMapper; import cz.cvut.kbss.termit.util.Configuration; -import cz.cvut.kbss.termit.util.Constants; import cz.cvut.kbss.termit.util.Utils; import org.apache.jena.rdf.model.Literal; import org.apache.jena.rdf.model.Model; @@ -52,7 +51,11 @@ import java.net.URI; import java.net.URL; import java.nio.charset.StandardCharsets; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import java.util.stream.Collectors; @Component diff --git a/src/main/java/cz/cvut/kbss/termit/rest/SnapshotController.java b/src/main/java/cz/cvut/kbss/termit/rest/SnapshotController.java index 4d95c39cf..34f164e8a 100644 --- a/src/main/java/cz/cvut/kbss/termit/rest/SnapshotController.java +++ b/src/main/java/cz/cvut/kbss/termit/rest/SnapshotController.java @@ -29,7 +29,12 @@ import io.swagger.v3.oas.annotations.tags.Tag; import org.springframework.http.HttpStatus; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; import java.net.URI; diff --git a/src/main/java/cz/cvut/kbss/termit/rest/UserController.java b/src/main/java/cz/cvut/kbss/termit/rest/UserController.java index 4f713eba8..96ea06491 100644 --- a/src/main/java/cz/cvut/kbss/termit/rest/UserController.java +++ b/src/main/java/cz/cvut/kbss/termit/rest/UserController.java @@ -39,7 +39,16 @@ import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; import java.net.URI; import java.util.List; diff --git a/src/main/java/cz/cvut/kbss/termit/rest/UserGroupController.java b/src/main/java/cz/cvut/kbss/termit/rest/UserGroupController.java index fa5df36c8..bb7ab0b78 100644 --- a/src/main/java/cz/cvut/kbss/termit/rest/UserGroupController.java +++ b/src/main/java/cz/cvut/kbss/termit/rest/UserGroupController.java @@ -36,7 +36,15 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; import java.net.URI; import java.util.List; diff --git a/src/main/java/cz/cvut/kbss/termit/rest/WorkspaceController.java b/src/main/java/cz/cvut/kbss/termit/rest/WorkspaceController.java index f9341f2ec..1c01a5157 100644 --- a/src/main/java/cz/cvut/kbss/termit/rest/WorkspaceController.java +++ b/src/main/java/cz/cvut/kbss/termit/rest/WorkspaceController.java @@ -29,7 +29,12 @@ import org.springframework.http.HttpStatus; import org.springframework.http.MediaType; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseStatus; +import org.springframework.web.bind.annotation.RestController; import java.net.URI; import java.util.Collection; diff --git a/src/main/java/cz/cvut/kbss/termit/rest/readonly/ReadOnlyTermController.java b/src/main/java/cz/cvut/kbss/termit/rest/readonly/ReadOnlyTermController.java index 75c0cfe9b..e256797e3 100644 --- a/src/main/java/cz/cvut/kbss/termit/rest/readonly/ReadOnlyTermController.java +++ b/src/main/java/cz/cvut/kbss/termit/rest/readonly/ReadOnlyTermController.java @@ -41,7 +41,11 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import java.net.URI; import java.time.Instant; diff --git a/src/main/java/cz/cvut/kbss/termit/rest/readonly/ReadOnlyVocabularyController.java b/src/main/java/cz/cvut/kbss/termit/rest/readonly/ReadOnlyVocabularyController.java index cd3cd2efc..d3bbc64c9 100644 --- a/src/main/java/cz/cvut/kbss/termit/rest/readonly/ReadOnlyVocabularyController.java +++ b/src/main/java/cz/cvut/kbss/termit/rest/readonly/ReadOnlyVocabularyController.java @@ -35,7 +35,11 @@ import org.springframework.http.MediaType; import org.springframework.http.ResponseEntity; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.web.bind.annotation.*; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.RestController; import java.net.URI; import java.time.Instant; diff --git a/src/main/java/cz/cvut/kbss/termit/rest/servlet/DiagnosticsContextFilter.java b/src/main/java/cz/cvut/kbss/termit/rest/servlet/DiagnosticsContextFilter.java index 8b64e90dd..5b10b6f13 100644 --- a/src/main/java/cz/cvut/kbss/termit/rest/servlet/DiagnosticsContextFilter.java +++ b/src/main/java/cz/cvut/kbss/termit/rest/servlet/DiagnosticsContextFilter.java @@ -17,14 +17,14 @@ */ package cz.cvut.kbss.termit.rest.servlet; -import org.slf4j.MDC; -import org.springframework.web.filter.GenericFilterBean; - import jakarta.servlet.FilterChain; import jakarta.servlet.ServletException; import jakarta.servlet.ServletRequest; import jakarta.servlet.ServletResponse; import jakarta.servlet.http.HttpServletRequest; +import org.slf4j.MDC; +import org.springframework.web.filter.GenericFilterBean; + import java.io.IOException; import java.security.Principal; diff --git a/src/main/java/cz/cvut/kbss/termit/rest/util/RestUtils.java b/src/main/java/cz/cvut/kbss/termit/rest/util/RestUtils.java index f59f8b82e..987982de8 100644 --- a/src/main/java/cz/cvut/kbss/termit/rest/util/RestUtils.java +++ b/src/main/java/cz/cvut/kbss/termit/rest/util/RestUtils.java @@ -18,14 +18,14 @@ package cz.cvut.kbss.termit.rest.util; import cz.cvut.kbss.termit.util.Constants; +import jakarta.servlet.http.Cookie; +import jakarta.servlet.http.HttpServletRequest; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.http.HttpStatus; import org.springframework.web.server.ResponseStatusException; import org.springframework.web.servlet.support.ServletUriComponentsBuilder; -import jakarta.servlet.http.Cookie; -import jakarta.servlet.http.HttpServletRequest; import java.net.URI; import java.time.Instant; import java.time.format.DateTimeParseException; diff --git a/src/main/java/cz/cvut/kbss/termit/security/AuthenticationFailure.java b/src/main/java/cz/cvut/kbss/termit/security/AuthenticationFailure.java index e40c998c5..1d55de2c6 100644 --- a/src/main/java/cz/cvut/kbss/termit/security/AuthenticationFailure.java +++ b/src/main/java/cz/cvut/kbss/termit/security/AuthenticationFailure.java @@ -19,6 +19,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import cz.cvut.kbss.termit.security.model.LoginStatus; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -30,8 +32,6 @@ import org.springframework.security.web.authentication.AuthenticationFailureHandler; import org.springframework.stereotype.Service; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; /** diff --git a/src/main/java/cz/cvut/kbss/termit/security/AuthenticationSuccess.java b/src/main/java/cz/cvut/kbss/termit/security/AuthenticationSuccess.java index 80a1656cf..17bfe45fd 100644 --- a/src/main/java/cz/cvut/kbss/termit/security/AuthenticationSuccess.java +++ b/src/main/java/cz/cvut/kbss/termit/security/AuthenticationSuccess.java @@ -19,6 +19,8 @@ import com.fasterxml.jackson.databind.ObjectMapper; import cz.cvut.kbss.termit.security.model.LoginStatus; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -30,8 +32,6 @@ import org.springframework.security.web.authentication.logout.LogoutSuccessHandler; import org.springframework.stereotype.Service; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; import java.util.Objects; diff --git a/src/main/java/cz/cvut/kbss/termit/security/JwtAuthenticationFilter.java b/src/main/java/cz/cvut/kbss/termit/security/JwtAuthenticationFilter.java index 2557c0c0d..5b5438b30 100644 --- a/src/main/java/cz/cvut/kbss/termit/security/JwtAuthenticationFilter.java +++ b/src/main/java/cz/cvut/kbss/termit/security/JwtAuthenticationFilter.java @@ -18,15 +18,15 @@ package cz.cvut.kbss.termit.security; import cz.cvut.kbss.termit.security.model.TermItUserDetails; +import jakarta.servlet.FilterChain; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.springframework.http.HttpHeaders; import org.springframework.security.authentication.AuthenticationManager; import org.springframework.security.core.Authentication; import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter; -import jakarta.servlet.FilterChain; -import jakarta.servlet.ServletException; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; import java.io.IOException; /** diff --git a/src/main/java/cz/cvut/kbss/termit/security/model/TermItUserDetails.java b/src/main/java/cz/cvut/kbss/termit/security/model/TermItUserDetails.java index c61b73227..603fb7752 100644 --- a/src/main/java/cz/cvut/kbss/termit/security/model/TermItUserDetails.java +++ b/src/main/java/cz/cvut/kbss/termit/security/model/TermItUserDetails.java @@ -17,17 +17,20 @@ */ package cz.cvut.kbss.termit.security.model; -import static cz.cvut.kbss.termit.security.SecurityConstants.ROLE_RESTRICTED_USER; - - import cz.cvut.kbss.termit.model.UserAccount; import org.springframework.security.core.GrantedAuthority; import org.springframework.security.core.authority.SimpleGrantedAuthority; import org.springframework.security.core.userdetails.UserDetails; -import java.util.*; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; import java.util.stream.Collectors; +import static cz.cvut.kbss.termit.security.SecurityConstants.ROLE_RESTRICTED_USER; + public class TermItUserDetails implements UserDetails { /** diff --git a/src/main/java/cz/cvut/kbss/termit/security/model/UserRole.java b/src/main/java/cz/cvut/kbss/termit/security/model/UserRole.java index 6d1048156..e302ba6a1 100644 --- a/src/main/java/cz/cvut/kbss/termit/security/model/UserRole.java +++ b/src/main/java/cz/cvut/kbss/termit/security/model/UserRole.java @@ -18,6 +18,7 @@ package cz.cvut.kbss.termit.security.model; import cz.cvut.kbss.termit.util.Vocabulary; + import java.util.Arrays; import java.util.HashSet; import java.util.Set; diff --git a/src/main/java/cz/cvut/kbss/termit/service/business/VocabularyService.java b/src/main/java/cz/cvut/kbss/termit/service/business/VocabularyService.java index ba7507daa..69a2dfc22 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/business/VocabularyService.java +++ b/src/main/java/cz/cvut/kbss/termit/service/business/VocabularyService.java @@ -36,7 +36,6 @@ import cz.cvut.kbss.termit.persistence.snapshot.SnapshotCreator; import cz.cvut.kbss.termit.service.business.async.AsyncTermService; import cz.cvut.kbss.termit.service.changetracking.ChangeRecordProvider; -import cz.cvut.kbss.termit.util.TypeAwareFileSystemResource; import cz.cvut.kbss.termit.service.export.ExportFormat; import cz.cvut.kbss.termit.service.repository.ChangeRecordService; import cz.cvut.kbss.termit.service.repository.VocabularyRepositoryService; @@ -44,6 +43,7 @@ import cz.cvut.kbss.termit.service.snapshot.SnapshotProvider; import cz.cvut.kbss.termit.util.Configuration; import cz.cvut.kbss.termit.util.TypeAwareClasspathResource; +import cz.cvut.kbss.termit.util.TypeAwareFileSystemResource; import cz.cvut.kbss.termit.util.TypeAwareResource; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; diff --git a/src/main/java/cz/cvut/kbss/termit/service/changetracking/MetamodelBasedChangeCalculator.java b/src/main/java/cz/cvut/kbss/termit/service/changetracking/MetamodelBasedChangeCalculator.java index 9e89a872e..2961b75a4 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/changetracking/MetamodelBasedChangeCalculator.java +++ b/src/main/java/cz/cvut/kbss/termit/service/changetracking/MetamodelBasedChangeCalculator.java @@ -18,7 +18,12 @@ package cz.cvut.kbss.termit.service.changetracking; import cz.cvut.kbss.jopa.model.EntityManagerFactory; -import cz.cvut.kbss.jopa.model.metamodel.*; +import cz.cvut.kbss.jopa.model.metamodel.Attribute; +import cz.cvut.kbss.jopa.model.metamodel.EntityType; +import cz.cvut.kbss.jopa.model.metamodel.Metamodel; +import cz.cvut.kbss.jopa.model.metamodel.PluralAttribute; +import cz.cvut.kbss.jopa.model.metamodel.PropertiesSpecification; +import cz.cvut.kbss.jopa.model.metamodel.TypesSpecification; import cz.cvut.kbss.jopa.utils.EntityPropertiesUtils; import cz.cvut.kbss.jopa.utils.IdentifierTransformer; import cz.cvut.kbss.jopa.vocabulary.RDF; @@ -29,7 +34,14 @@ import org.springframework.stereotype.Component; import java.net.URI; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; import static cz.cvut.kbss.jopa.utils.EntityPropertiesUtils.getAttributeValue; diff --git a/src/main/java/cz/cvut/kbss/termit/service/document/DefaultDocumentManager.java b/src/main/java/cz/cvut/kbss/termit/service/document/DefaultDocumentManager.java index 78125ef2f..6bf418349 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/document/DefaultDocumentManager.java +++ b/src/main/java/cz/cvut/kbss/termit/service/document/DefaultDocumentManager.java @@ -26,8 +26,8 @@ import cz.cvut.kbss.termit.model.resource.File; import cz.cvut.kbss.termit.model.resource.Resource; import cz.cvut.kbss.termit.service.IdentifierResolver; -import cz.cvut.kbss.termit.util.TypeAwareFileSystemResource; import cz.cvut.kbss.termit.util.Configuration; +import cz.cvut.kbss.termit.util.TypeAwareFileSystemResource; import cz.cvut.kbss.termit.util.TypeAwareResource; import cz.cvut.kbss.termit.util.Utils; import org.apache.tika.Tika; @@ -46,7 +46,14 @@ import java.time.format.DateTimeFormatter; import java.time.format.DateTimeParseException; import java.time.temporal.TemporalAccessor; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; import java.util.function.Consumer; /** diff --git a/src/main/java/cz/cvut/kbss/termit/service/document/TextAnalysisService.java b/src/main/java/cz/cvut/kbss/termit/service/document/TextAnalysisService.java index c5f81ba36..dbc94dfaf 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/document/TextAnalysisService.java +++ b/src/main/java/cz/cvut/kbss/termit/service/document/TextAnalysisService.java @@ -29,7 +29,11 @@ import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.io.Resource; -import org.springframework.http.*; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.MediaType; +import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.client.RestTemplate; diff --git a/src/main/java/cz/cvut/kbss/termit/service/export/ExcelVocabularyExporter.java b/src/main/java/cz/cvut/kbss/termit/service/export/ExcelVocabularyExporter.java index c15896df4..c5d262e7d 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/export/ExcelVocabularyExporter.java +++ b/src/main/java/cz/cvut/kbss/termit/service/export/ExcelVocabularyExporter.java @@ -24,10 +24,10 @@ import cz.cvut.kbss.termit.exception.UnsupportedOperationException; import cz.cvut.kbss.termit.model.Term; import cz.cvut.kbss.termit.model.Vocabulary; -import cz.cvut.kbss.termit.util.TypeAwareByteArrayResource; import cz.cvut.kbss.termit.service.repository.TermRepositoryService; import cz.cvut.kbss.termit.service.repository.VocabularyRepositoryService; import cz.cvut.kbss.termit.util.Constants; +import cz.cvut.kbss.termit.util.TypeAwareByteArrayResource; import cz.cvut.kbss.termit.util.TypeAwareResource; import cz.cvut.kbss.termit.util.Utils; import org.apache.poi.ss.usermodel.Cell; diff --git a/src/main/java/cz/cvut/kbss/termit/service/mail/Postman.java b/src/main/java/cz/cvut/kbss/termit/service/mail/Postman.java index eb7a07c11..cb66781e9 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/mail/Postman.java +++ b/src/main/java/cz/cvut/kbss/termit/service/mail/Postman.java @@ -19,6 +19,9 @@ import cz.cvut.kbss.termit.exception.PostmanException; import cz.cvut.kbss.termit.exception.ValidationException; +import jakarta.mail.MessagingException; +import jakarta.mail.internet.InternetAddress; +import jakarta.mail.internet.MimeMessage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -29,14 +32,9 @@ import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.stereotype.Service; -import jakarta.mail.MessagingException; -import jakarta.mail.internet.InternetAddress; -import jakarta.mail.internet.MimeMessage; - import javax.annotation.PostConstruct; import java.io.UnsupportedEncodingException; import java.nio.charset.StandardCharsets; -import java.util.Arrays; import java.util.Objects; @Service diff --git a/src/main/java/cz/cvut/kbss/termit/service/notification/CommentChangeNotifier.java b/src/main/java/cz/cvut/kbss/termit/service/notification/CommentChangeNotifier.java index 70711e64b..38686d556 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/notification/CommentChangeNotifier.java +++ b/src/main/java/cz/cvut/kbss/termit/service/notification/CommentChangeNotifier.java @@ -17,7 +17,11 @@ */ package cz.cvut.kbss.termit.service.notification; -import cz.cvut.kbss.termit.model.*; +import cz.cvut.kbss.termit.model.Asset; +import cz.cvut.kbss.termit.model.Term; +import cz.cvut.kbss.termit.model.User; +import cz.cvut.kbss.termit.model.UserAccount; +import cz.cvut.kbss.termit.model.Vocabulary; import cz.cvut.kbss.termit.model.comment.Comment; import cz.cvut.kbss.termit.service.business.TermService; import cz.cvut.kbss.termit.service.business.UserService; @@ -35,7 +39,15 @@ import java.time.LocalDate; import java.time.ZoneId; import java.time.temporal.ChronoUnit; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; @Component diff --git a/src/main/java/cz/cvut/kbss/termit/service/notification/NotificationService.java b/src/main/java/cz/cvut/kbss/termit/service/notification/NotificationService.java index cfd67ee26..aa440e8b8 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/notification/NotificationService.java +++ b/src/main/java/cz/cvut/kbss/termit/service/notification/NotificationService.java @@ -27,7 +27,10 @@ import org.springframework.scheduling.support.CronExpression; import org.springframework.stereotype.Service; -import java.time.*; +import java.time.Duration; +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZoneId; import java.util.Optional; @Service diff --git a/src/main/java/cz/cvut/kbss/termit/service/repository/BaseAssetRepositoryService.java b/src/main/java/cz/cvut/kbss/termit/service/repository/BaseAssetRepositoryService.java index a2e87dc80..e3c45527c 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/repository/BaseAssetRepositoryService.java +++ b/src/main/java/cz/cvut/kbss/termit/service/repository/BaseAssetRepositoryService.java @@ -23,11 +23,10 @@ import cz.cvut.kbss.termit.model.User; import cz.cvut.kbss.termit.model.util.HasIdentifier; import cz.cvut.kbss.termit.persistence.dao.BaseAssetDao; +import jakarta.validation.Validator; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; -import jakarta.validation.Validator; - /** * Base repository service implementation for asset managing services. * diff --git a/src/main/java/cz/cvut/kbss/termit/service/repository/BaseRepositoryService.java b/src/main/java/cz/cvut/kbss/termit/service/repository/BaseRepositoryService.java index a5015182d..be5bcceae 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/repository/BaseRepositoryService.java +++ b/src/main/java/cz/cvut/kbss/termit/service/repository/BaseRepositoryService.java @@ -24,10 +24,10 @@ import cz.cvut.kbss.termit.model.util.HasIdentifier; import cz.cvut.kbss.termit.persistence.dao.GenericDao; import cz.cvut.kbss.termit.validation.ValidationResult; +import jakarta.validation.Validator; import org.springframework.lang.NonNull; import org.springframework.transaction.annotation.Transactional; -import jakarta.validation.Validator; import java.net.URI; import java.util.List; import java.util.Objects; diff --git a/src/main/java/cz/cvut/kbss/termit/service/repository/RepositoryAccessControlListService.java b/src/main/java/cz/cvut/kbss/termit/service/repository/RepositoryAccessControlListService.java index e05d05df2..6598bfaaa 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/repository/RepositoryAccessControlListService.java +++ b/src/main/java/cz/cvut/kbss/termit/service/repository/RepositoryAccessControlListService.java @@ -24,7 +24,11 @@ import cz.cvut.kbss.termit.model.AccessControlAgent; import cz.cvut.kbss.termit.model.Asset; import cz.cvut.kbss.termit.model.UserRole; -import cz.cvut.kbss.termit.model.acl.*; +import cz.cvut.kbss.termit.model.acl.AccessControlList; +import cz.cvut.kbss.termit.model.acl.AccessControlRecord; +import cz.cvut.kbss.termit.model.acl.AccessLevel; +import cz.cvut.kbss.termit.model.acl.RoleAccessControlRecord; +import cz.cvut.kbss.termit.model.acl.UserAccessControlRecord; import cz.cvut.kbss.termit.model.util.HasIdentifier; import cz.cvut.kbss.termit.persistence.dao.acl.AccessControlListDao; import cz.cvut.kbss.termit.service.business.AccessControlListService; diff --git a/src/main/java/cz/cvut/kbss/termit/service/repository/ResourceRepositoryService.java b/src/main/java/cz/cvut/kbss/termit/service/repository/ResourceRepositoryService.java index 4bdd88dad..5f0b9bb61 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/repository/ResourceRepositoryService.java +++ b/src/main/java/cz/cvut/kbss/termit/service/repository/ResourceRepositoryService.java @@ -27,6 +27,7 @@ import cz.cvut.kbss.termit.persistence.dao.TermOccurrenceDao; import cz.cvut.kbss.termit.service.IdentifierResolver; import cz.cvut.kbss.termit.util.Configuration; +import jakarta.validation.Validator; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -34,7 +35,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import jakarta.validation.Validator; import java.util.Objects; @Service diff --git a/src/main/java/cz/cvut/kbss/termit/service/repository/UserGroupRepositoryService.java b/src/main/java/cz/cvut/kbss/termit/service/repository/UserGroupRepositoryService.java index 01130a855..146c83d60 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/repository/UserGroupRepositoryService.java +++ b/src/main/java/cz/cvut/kbss/termit/service/repository/UserGroupRepositoryService.java @@ -24,6 +24,7 @@ import cz.cvut.kbss.termit.security.SecurityConstants; import cz.cvut.kbss.termit.service.business.UserGroupService; import cz.cvut.kbss.termit.util.Utils; +import jakarta.validation.Validator; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.lang.NonNull; @@ -31,7 +32,6 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; -import jakarta.validation.Validator; import java.net.URI; import java.util.Collection; import java.util.HashSet; diff --git a/src/main/java/cz/cvut/kbss/termit/service/repository/UserRepositoryService.java b/src/main/java/cz/cvut/kbss/termit/service/repository/UserRepositoryService.java index 52eeefdba..c98582bfb 100644 --- a/src/main/java/cz/cvut/kbss/termit/service/repository/UserRepositoryService.java +++ b/src/main/java/cz/cvut/kbss/termit/service/repository/UserRepositoryService.java @@ -23,13 +23,12 @@ import cz.cvut.kbss.termit.persistence.dao.UserAccountDao; import cz.cvut.kbss.termit.service.IdentifierResolver; import cz.cvut.kbss.termit.util.Configuration; +import jakarta.validation.Validator; import org.jetbrains.annotations.NotNull; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; -import jakarta.validation.Validator; - import java.util.Optional; @Service diff --git a/src/main/java/cz/cvut/kbss/termit/util/AdjustedUriTemplateProxyServlet.java b/src/main/java/cz/cvut/kbss/termit/util/AdjustedUriTemplateProxyServlet.java index 8b46e3ce0..2355a18ea 100644 --- a/src/main/java/cz/cvut/kbss/termit/util/AdjustedUriTemplateProxyServlet.java +++ b/src/main/java/cz/cvut/kbss/termit/util/AdjustedUriTemplateProxyServlet.java @@ -17,14 +17,14 @@ */ package cz.cvut.kbss.termit.util; -import org.mitre.dsmiley.httpproxy.URITemplateProxyServlet; -import org.springframework.http.HttpHeaders; - import jakarta.servlet.ServletException; import jakarta.servlet.http.HttpServletRequest; import jakarta.servlet.http.HttpServletRequestWrapper; import jakarta.servlet.http.HttpServletResponse; import jakarta.servlet.http.HttpServletResponseWrapper; +import org.mitre.dsmiley.httpproxy.URITemplateProxyServlet; +import org.springframework.http.HttpHeaders; + import java.io.IOException; import java.util.Base64; import java.util.Collections; diff --git a/src/main/java/cz/cvut/kbss/termit/validation/MultilingualStringPrimaryNotBlankValidator.java b/src/main/java/cz/cvut/kbss/termit/validation/MultilingualStringPrimaryNotBlankValidator.java index 4322bef9a..180ad175e 100644 --- a/src/main/java/cz/cvut/kbss/termit/validation/MultilingualStringPrimaryNotBlankValidator.java +++ b/src/main/java/cz/cvut/kbss/termit/validation/MultilingualStringPrimaryNotBlankValidator.java @@ -20,10 +20,9 @@ import cz.cvut.kbss.jopa.model.MultilingualString; import cz.cvut.kbss.termit.util.Configuration; import cz.cvut.kbss.termit.util.Configuration.Persistence; -import org.springframework.beans.factory.annotation.Autowired; - import jakarta.validation.ConstraintValidator; import jakarta.validation.ConstraintValidatorContext; +import org.springframework.beans.factory.annotation.Autowired; /** * Validates that a {@link MultilingualString} contains translation in the primary language. diff --git a/src/main/java/cz/cvut/kbss/termit/validation/PrimaryNotBlank.java b/src/main/java/cz/cvut/kbss/termit/validation/PrimaryNotBlank.java index c22f49d47..b180115d3 100644 --- a/src/main/java/cz/cvut/kbss/termit/validation/PrimaryNotBlank.java +++ b/src/main/java/cz/cvut/kbss/termit/validation/PrimaryNotBlank.java @@ -19,7 +19,13 @@ import jakarta.validation.Constraint; import jakarta.validation.Payload; -import java.lang.annotation.*; + +import java.lang.annotation.Documented; +import java.lang.annotation.ElementType; +import java.lang.annotation.Repeatable; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; /** * Validation constraint ensuring that a {@link cz.cvut.kbss.jopa.model.MultilingualString} contains a non-empty value diff --git a/src/main/java/cz/cvut/kbss/termit/validation/ValidationResult.java b/src/main/java/cz/cvut/kbss/termit/validation/ValidationResult.java index 9dc5fc21e..82de3929c 100644 --- a/src/main/java/cz/cvut/kbss/termit/validation/ValidationResult.java +++ b/src/main/java/cz/cvut/kbss/termit/validation/ValidationResult.java @@ -18,6 +18,7 @@ package cz.cvut.kbss.termit.validation; import jakarta.validation.ConstraintViolation; + import java.io.Serializable; import java.util.Collection; diff --git a/src/main/java/cz/cvut/kbss/termit/websocket/ResultWithHeaders.java b/src/main/java/cz/cvut/kbss/termit/websocket/ResultWithHeaders.java index 1ec5c0ef6..8d74eeb72 100644 --- a/src/main/java/cz/cvut/kbss/termit/websocket/ResultWithHeaders.java +++ b/src/main/java/cz/cvut/kbss/termit/websocket/ResultWithHeaders.java @@ -1,10 +1,10 @@ package cz.cvut.kbss.termit.websocket; import cz.cvut.kbss.termit.websocket.handler.WebSocketMessageWithHeadersValueHandler; -import org.springframework.messaging.handler.invocation.HandlerMethodReturnValueHandler; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import org.springframework.messaging.handler.annotation.SendTo; +import org.springframework.messaging.handler.invocation.HandlerMethodReturnValueHandler; import org.springframework.messaging.simp.annotation.SendToUser; import java.util.Collections; diff --git a/src/main/java/cz/cvut/kbss/termit/websocket/VocabularySocketController.java b/src/main/java/cz/cvut/kbss/termit/websocket/VocabularySocketController.java index 67c1af291..7e49b35e0 100644 --- a/src/main/java/cz/cvut/kbss/termit/websocket/VocabularySocketController.java +++ b/src/main/java/cz/cvut/kbss/termit/websocket/VocabularySocketController.java @@ -8,8 +8,6 @@ import cz.cvut.kbss.termit.service.business.VocabularyService; import cz.cvut.kbss.termit.util.Configuration; import cz.cvut.kbss.termit.util.Constants; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; import org.springframework.messaging.handler.annotation.DestinationVariable; import org.springframework.messaging.handler.annotation.Header; import org.springframework.messaging.handler.annotation.MessageMapping; diff --git a/src/main/java/cz/cvut/kbss/termit/workspace/EditableVocabularies.java b/src/main/java/cz/cvut/kbss/termit/workspace/EditableVocabularies.java index 67fd3ab5c..f05b3e70c 100644 --- a/src/main/java/cz/cvut/kbss/termit/workspace/EditableVocabularies.java +++ b/src/main/java/cz/cvut/kbss/termit/workspace/EditableVocabularies.java @@ -26,7 +26,9 @@ import java.io.Serializable; import java.net.URI; -import java.util.*; +import java.util.Objects; +import java.util.Optional; +import java.util.Set; import static cz.cvut.kbss.termit.util.Utils.uriToString; diff --git a/src/main/java/cz/cvut/kbss/termit/workspace/EditableVocabulariesHolder.java b/src/main/java/cz/cvut/kbss/termit/workspace/EditableVocabulariesHolder.java index a8c801732..adb4bae0d 100644 --- a/src/main/java/cz/cvut/kbss/termit/workspace/EditableVocabulariesHolder.java +++ b/src/main/java/cz/cvut/kbss/termit/workspace/EditableVocabulariesHolder.java @@ -20,7 +20,11 @@ import org.springframework.web.context.annotation.SessionScope; import java.net.URI; -import java.util.*; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Optional; +import java.util.Set; /** * Holds editable vocabularies for a session (if applicable). diff --git a/src/test/java/cz/cvut/kbss/termit/dto/assignment/TermOccurrencesTest.java b/src/test/java/cz/cvut/kbss/termit/dto/assignment/TermOccurrencesTest.java index 3b6ebde88..f572462d3 100644 --- a/src/test/java/cz/cvut/kbss/termit/dto/assignment/TermOccurrencesTest.java +++ b/src/test/java/cz/cvut/kbss/termit/dto/assignment/TermOccurrencesTest.java @@ -26,7 +26,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.hasItem; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertNotNull; class TermOccurrencesTest { diff --git a/src/test/java/cz/cvut/kbss/termit/dto/mapper/DtoMapperTest.java b/src/test/java/cz/cvut/kbss/termit/dto/mapper/DtoMapperTest.java index f2e1ce4b1..49ac12c88 100644 --- a/src/test/java/cz/cvut/kbss/termit/dto/mapper/DtoMapperTest.java +++ b/src/test/java/cz/cvut/kbss/termit/dto/mapper/DtoMapperTest.java @@ -22,7 +22,11 @@ import cz.cvut.kbss.termit.environment.Environment; import cz.cvut.kbss.termit.environment.Generator; import cz.cvut.kbss.termit.model.UserRole; -import cz.cvut.kbss.termit.model.acl.*; +import cz.cvut.kbss.termit.model.acl.AccessControlRecord; +import cz.cvut.kbss.termit.model.acl.AccessLevel; +import cz.cvut.kbss.termit.model.acl.RoleAccessControlRecord; +import cz.cvut.kbss.termit.model.acl.UserAccessControlRecord; +import cz.cvut.kbss.termit.model.acl.UserGroupAccessControlRecord; import cz.cvut.kbss.termit.util.Vocabulary; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; diff --git a/src/test/java/cz/cvut/kbss/termit/dto/readonly/ReadOnlyTermTest.java b/src/test/java/cz/cvut/kbss/termit/dto/readonly/ReadOnlyTermTest.java index 6709a8672..f6fb0d447 100644 --- a/src/test/java/cz/cvut/kbss/termit/dto/readonly/ReadOnlyTermTest.java +++ b/src/test/java/cz/cvut/kbss/termit/dto/readonly/ReadOnlyTermTest.java @@ -26,9 +26,15 @@ import org.junit.jupiter.api.Test; import java.net.URI; -import java.util.*; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; class ReadOnlyTermTest { diff --git a/src/test/java/cz/cvut/kbss/termit/dto/search/SearchParamTest.java b/src/test/java/cz/cvut/kbss/termit/dto/search/SearchParamTest.java index b3e256c5c..811bf9cf0 100644 --- a/src/test/java/cz/cvut/kbss/termit/dto/search/SearchParamTest.java +++ b/src/test/java/cz/cvut/kbss/termit/dto/search/SearchParamTest.java @@ -25,7 +25,7 @@ import java.net.URI; import java.util.Set; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertThrows; class SearchParamTest { diff --git a/src/test/java/cz/cvut/kbss/termit/environment/TestPersistenceFactory.java b/src/test/java/cz/cvut/kbss/termit/environment/TestPersistenceFactory.java index affbb3859..978703159 100644 --- a/src/test/java/cz/cvut/kbss/termit/environment/TestPersistenceFactory.java +++ b/src/test/java/cz/cvut/kbss/termit/environment/TestPersistenceFactory.java @@ -21,6 +21,8 @@ import cz.cvut.kbss.jopa.model.EntityManagerFactory; import cz.cvut.kbss.ontodriver.rdf4j.config.Rdf4jOntoDriverProperties; import cz.cvut.kbss.termit.persistence.MainPersistenceFactory; +import jakarta.annotation.PostConstruct; +import jakarta.annotation.PreDestroy; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.context.properties.EnableConfigurationProperties; import org.springframework.context.annotation.Bean; @@ -28,11 +30,12 @@ import org.springframework.context.annotation.Primary; import org.springframework.context.annotation.Profile; -import jakarta.annotation.PostConstruct; -import jakarta.annotation.PreDestroy; import java.util.Map; -import static cz.cvut.kbss.jopa.model.JOPAPersistenceProperties.*; +import static cz.cvut.kbss.jopa.model.JOPAPersistenceProperties.DATA_SOURCE_CLASS; +import static cz.cvut.kbss.jopa.model.JOPAPersistenceProperties.LANG; +import static cz.cvut.kbss.jopa.model.JOPAPersistenceProperties.ONTOLOGY_PHYSICAL_URI_KEY; +import static cz.cvut.kbss.jopa.model.JOPAPersistenceProperties.PREFER_MULTILINGUAL_STRING; @Configuration @EnableConfigurationProperties(cz.cvut.kbss.termit.util.Configuration.class) diff --git a/src/test/java/cz/cvut/kbss/termit/exception/ValidationExceptionTest.java b/src/test/java/cz/cvut/kbss/termit/exception/ValidationExceptionTest.java index 904bf20a6..611b05a38 100644 --- a/src/test/java/cz/cvut/kbss/termit/exception/ValidationExceptionTest.java +++ b/src/test/java/cz/cvut/kbss/termit/exception/ValidationExceptionTest.java @@ -19,10 +19,9 @@ import cz.cvut.kbss.termit.model.UserAccount; import cz.cvut.kbss.termit.validation.ValidationResult; -import org.junit.jupiter.api.Test; - import jakarta.validation.Validation; import jakarta.validation.Validator; +import org.junit.jupiter.api.Test; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; diff --git a/src/test/java/cz/cvut/kbss/termit/model/DocumentTest.java b/src/test/java/cz/cvut/kbss/termit/model/DocumentTest.java index 1f7fbbda1..e31057ac7 100644 --- a/src/test/java/cz/cvut/kbss/termit/model/DocumentTest.java +++ b/src/test/java/cz/cvut/kbss/termit/model/DocumentTest.java @@ -27,7 +27,11 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.startsWith; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertSame; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; class DocumentTest { diff --git a/src/test/java/cz/cvut/kbss/termit/model/TermTest.java b/src/test/java/cz/cvut/kbss/termit/model/TermTest.java index 4530616bb..796bb463b 100644 --- a/src/test/java/cz/cvut/kbss/termit/model/TermTest.java +++ b/src/test/java/cz/cvut/kbss/termit/model/TermTest.java @@ -30,8 +30,14 @@ import java.util.stream.IntStream; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.junit.jupiter.api.Assertions.*; +import static org.hamcrest.Matchers.anyOf; +import static org.hamcrest.Matchers.emptyCollectionOf; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.hasItems; +import static org.hamcrest.Matchers.nullValue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; class TermTest { diff --git a/src/test/java/cz/cvut/kbss/termit/model/UserAccountTest.java b/src/test/java/cz/cvut/kbss/termit/model/UserAccountTest.java index 6c1841038..72cc71ca4 100644 --- a/src/test/java/cz/cvut/kbss/termit/model/UserAccountTest.java +++ b/src/test/java/cz/cvut/kbss/termit/model/UserAccountTest.java @@ -25,7 +25,11 @@ import java.util.Collections; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; class UserAccountTest { diff --git a/src/test/java/cz/cvut/kbss/termit/model/acl/RoleAccessControlRecordTest.java b/src/test/java/cz/cvut/kbss/termit/model/acl/RoleAccessControlRecordTest.java index e848791cc..7fb6dce81 100644 --- a/src/test/java/cz/cvut/kbss/termit/model/acl/RoleAccessControlRecordTest.java +++ b/src/test/java/cz/cvut/kbss/termit/model/acl/RoleAccessControlRecordTest.java @@ -26,7 +26,9 @@ import java.net.URI; import java.util.Optional; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; class RoleAccessControlRecordTest { diff --git a/src/test/java/cz/cvut/kbss/termit/model/acl/UserAccessControlRecordTest.java b/src/test/java/cz/cvut/kbss/termit/model/acl/UserAccessControlRecordTest.java index 0e472bb48..705be86b8 100644 --- a/src/test/java/cz/cvut/kbss/termit/model/acl/UserAccessControlRecordTest.java +++ b/src/test/java/cz/cvut/kbss/termit/model/acl/UserAccessControlRecordTest.java @@ -23,7 +23,9 @@ import java.util.Optional; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; class UserAccessControlRecordTest { diff --git a/src/test/java/cz/cvut/kbss/termit/model/acl/UserGroupAccessControlRecordTest.java b/src/test/java/cz/cvut/kbss/termit/model/acl/UserGroupAccessControlRecordTest.java index 964570d99..e68955c07 100644 --- a/src/test/java/cz/cvut/kbss/termit/model/acl/UserGroupAccessControlRecordTest.java +++ b/src/test/java/cz/cvut/kbss/termit/model/acl/UserGroupAccessControlRecordTest.java @@ -24,7 +24,9 @@ import java.util.Optional; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; class UserGroupAccessControlRecordTest { diff --git a/src/test/java/cz/cvut/kbss/termit/model/util/EntityToOwlClassMapperTest.java b/src/test/java/cz/cvut/kbss/termit/model/util/EntityToOwlClassMapperTest.java index 8e1ff7984..6e3c11a49 100644 --- a/src/test/java/cz/cvut/kbss/termit/model/util/EntityToOwlClassMapperTest.java +++ b/src/test/java/cz/cvut/kbss/termit/model/util/EntityToOwlClassMapperTest.java @@ -21,7 +21,8 @@ import cz.cvut.kbss.termit.util.Vocabulary; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; class EntityToOwlClassMapperTest { @@ -37,4 +38,4 @@ void getOwlClassForEntityThrowsIllegalArgumentForClassNotAnnotatedWithOwlClass() () -> EntityToOwlClassMapper.getOwlClassForEntity(EntityToOwlClassMapper.class)); assertEquals("Class " + EntityToOwlClassMapper.class + " is not an OWL entity.", ex.getMessage()); } -} \ No newline at end of file +} diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/TextAnalysisRecordDaoTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/TextAnalysisRecordDaoTest.java index 37e2af4a2..7eb5a23e8 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/TextAnalysisRecordDaoTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/TextAnalysisRecordDaoTest.java @@ -35,7 +35,9 @@ import java.util.Collections; import java.util.Optional; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; class TextAnalysisRecordDaoTest extends BaseDaoTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/context/DefaultVocabularyContextMapperTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/context/DefaultVocabularyContextMapperTest.java index 033169c3b..d0f5cdd8a 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/context/DefaultVocabularyContextMapperTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/context/DefaultVocabularyContextMapperTest.java @@ -33,7 +33,11 @@ import java.net.URI; import java.util.Optional; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; class DefaultVocabularyContextMapperTest extends BaseDaoTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/context/DescriptorFactoryTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/context/DescriptorFactoryTest.java index bb98cb09e..c22fc8a49 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/context/DescriptorFactoryTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/context/DescriptorFactoryTest.java @@ -33,7 +33,9 @@ import java.net.URI; import java.util.Collections; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/context/WorkspaceVocabularyContextMapperTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/context/WorkspaceVocabularyContextMapperTest.java index a32283f9b..e24fdff35 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/context/WorkspaceVocabularyContextMapperTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/context/WorkspaceVocabularyContextMapperTest.java @@ -31,7 +31,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class WorkspaceVocabularyContextMapperTest { diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/dao/AssetDaoTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/dao/AssetDaoTest.java index c71d1783b..35023e75d 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/dao/AssetDaoTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/dao/AssetDaoTest.java @@ -43,13 +43,19 @@ import java.net.URI; import java.time.Instant; -import java.util.*; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.IntStream; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.hasItem; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; class AssetDaoTest extends BaseDaoTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/dao/BaseAssetDaoTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/dao/BaseAssetDaoTest.java index 30f4284ad..5ec7ee8a3 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/dao/BaseAssetDaoTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/dao/BaseAssetDaoTest.java @@ -18,7 +18,8 @@ import java.net.URI; import java.util.Optional; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.atLeastOnce; import static org.mockito.Mockito.verify; diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/dao/SnapshotDaoTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/dao/SnapshotDaoTest.java index 45e1f37dd..4ab6c9458 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/dao/SnapshotDaoTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/dao/SnapshotDaoTest.java @@ -33,7 +33,9 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.hasItem; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; class SnapshotDaoTest extends BaseDaoTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/dao/TermDaoExactMatchTermsTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/dao/TermDaoExactMatchTermsTest.java index c8a6372bb..122741e10 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/dao/TermDaoExactMatchTermsTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/dao/TermDaoExactMatchTermsTest.java @@ -17,17 +17,15 @@ */ package cz.cvut.kbss.termit.persistence.dao; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.hasItem; -import static org.hamcrest.Matchers.not; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertTrue; - import cz.cvut.kbss.jopa.vocabulary.SKOS; import cz.cvut.kbss.termit.dto.TermInfo; import cz.cvut.kbss.termit.environment.Generator; import cz.cvut.kbss.termit.model.Term; +import org.eclipse.rdf4j.model.ValueFactory; +import org.eclipse.rdf4j.repository.Repository; +import org.eclipse.rdf4j.repository.RepositoryConnection; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import java.util.ArrayList; import java.util.Arrays; @@ -36,11 +34,13 @@ import java.util.List; import java.util.Optional; import java.util.stream.Collectors; -import org.eclipse.rdf4j.model.ValueFactory; -import org.eclipse.rdf4j.repository.Repository; -import org.eclipse.rdf4j.repository.RepositoryConnection; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Test; + +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.not; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public class TermDaoExactMatchTermsTest extends BaseTermDaoTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/dao/TermDaoRelatedTermsTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/dao/TermDaoRelatedTermsTest.java index 9b4ac12c2..d920b0df3 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/dao/TermDaoRelatedTermsTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/dao/TermDaoRelatedTermsTest.java @@ -25,12 +25,24 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.junit.jupiter.api.Assertions.*; +import static org.hamcrest.Matchers.anyOf; +import static org.hamcrest.Matchers.emptyCollectionOf; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.hasItems; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.nullValue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; public class TermDaoRelatedTermsTest extends BaseTermDaoTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/dao/TermDaoSnapshotsTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/dao/TermDaoSnapshotsTest.java index 4e755e688..7d62b62b2 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/dao/TermDaoSnapshotsTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/dao/TermDaoSnapshotsTest.java @@ -38,14 +38,21 @@ import java.net.URI; import java.time.Instant; import java.time.temporal.ChronoUnit; -import java.util.*; +import java.util.Collections; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.IntStream; import static cz.cvut.kbss.termit.environment.util.ContainsSameEntities.containsSameEntities; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.hasItem; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) public class TermDaoSnapshotsTest extends BaseTermDaoTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/dao/TermOccurrenceDaoTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/dao/TermOccurrenceDaoTest.java index 4bb2356b4..da7f09793 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/dao/TermOccurrenceDaoTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/dao/TermOccurrenceDaoTest.java @@ -21,14 +21,15 @@ import cz.cvut.kbss.jopa.model.JOPAPersistenceProperties; import cz.cvut.kbss.jopa.model.descriptors.Descriptor; import cz.cvut.kbss.jopa.model.descriptors.EntityDescriptor; -import cz.cvut.kbss.jopa.model.query.TypedQuery; import cz.cvut.kbss.termit.dto.assignment.TermOccurrences; import cz.cvut.kbss.termit.environment.Environment; import cz.cvut.kbss.termit.environment.Generator; import cz.cvut.kbss.termit.model.Asset; import cz.cvut.kbss.termit.model.Term; import cz.cvut.kbss.termit.model.User; -import cz.cvut.kbss.termit.model.assignment.*; +import cz.cvut.kbss.termit.model.assignment.FileOccurrenceTarget; +import cz.cvut.kbss.termit.model.assignment.TermFileOccurrence; +import cz.cvut.kbss.termit.model.assignment.TermOccurrence; import cz.cvut.kbss.termit.model.resource.Document; import cz.cvut.kbss.termit.model.resource.File; import cz.cvut.kbss.termit.model.selector.TextQuoteSelector; @@ -44,14 +45,25 @@ import org.springframework.test.annotation.DirtiesContext; import java.net.URI; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import java.util.stream.IntStream; import static org.hamcrest.CoreMatchers.instanceOf; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.junit.jupiter.api.Assertions.*; +import static org.hamcrest.Matchers.emptyCollectionOf; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.not; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) class TermOccurrenceDaoTest extends BaseDaoTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/dao/UserAccountDaoTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/dao/UserAccountDaoTest.java index 600969570..75464dd32 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/dao/UserAccountDaoTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/dao/UserAccountDaoTest.java @@ -32,7 +32,10 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) @Tag("dao") diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/dao/acl/AccessControlListDaoTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/dao/acl/AccessControlListDaoTest.java index 66c87522c..a3d016365 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/dao/acl/AccessControlListDaoTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/dao/acl/AccessControlListDaoTest.java @@ -23,7 +23,11 @@ import cz.cvut.kbss.termit.model.User; import cz.cvut.kbss.termit.model.UserRole; import cz.cvut.kbss.termit.model.Vocabulary; -import cz.cvut.kbss.termit.model.acl.*; +import cz.cvut.kbss.termit.model.acl.AccessControlList; +import cz.cvut.kbss.termit.model.acl.AccessControlRecord; +import cz.cvut.kbss.termit.model.acl.AccessLevel; +import cz.cvut.kbss.termit.model.acl.RoleAccessControlRecord; +import cz.cvut.kbss.termit.model.acl.UserAccessControlRecord; import cz.cvut.kbss.termit.persistence.context.DescriptorFactory; import cz.cvut.kbss.termit.persistence.context.StaticContexts; import cz.cvut.kbss.termit.persistence.dao.BaseDaoTestRunner; @@ -37,8 +41,14 @@ import static cz.cvut.kbss.termit.environment.util.ContainsSameEntities.containsSameEntities; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.junit.jupiter.api.Assertions.*; +import static org.hamcrest.Matchers.anyOf; +import static org.hamcrest.Matchers.empty; +import static org.hamcrest.Matchers.nullValue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; class AccessControlListDaoTest extends BaseDaoTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/dao/changetracking/ChangeRecordDaoTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/dao/changetracking/ChangeRecordDaoTest.java index e612fac57..5f43ef096 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/dao/changetracking/ChangeRecordDaoTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/dao/changetracking/ChangeRecordDaoTest.java @@ -38,7 +38,13 @@ import java.net.URI; import java.time.Instant; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.HashSet; +import java.util.List; +import java.util.Optional; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -47,7 +53,9 @@ import static org.hamcrest.CoreMatchers.nullValue; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.empty; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; @DirtiesContext(classMode = DirtiesContext.ClassMode.AFTER_EACH_TEST_METHOD) class ChangeRecordDaoTest extends BaseDaoTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/dao/changetracking/ChangeTrackingContextResolverTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/dao/changetracking/ChangeTrackingContextResolverTest.java index e8c012b65..1f98a3ebf 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/dao/changetracking/ChangeTrackingContextResolverTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/dao/changetracking/ChangeTrackingContextResolverTest.java @@ -35,7 +35,9 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.mockito.ArgumentMatchers.*; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/dao/changetracking/ChangeTrackingHelperDaoTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/dao/changetracking/ChangeTrackingHelperDaoTest.java index c5d98a471..af757f50d 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/dao/changetracking/ChangeTrackingHelperDaoTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/dao/changetracking/ChangeTrackingHelperDaoTest.java @@ -29,7 +29,10 @@ import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; class ChangeTrackingHelperDaoTest extends BaseDaoTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/dao/comment/CommentReactionDaoTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/dao/comment/CommentReactionDaoTest.java index d1d2dfcab..315df839a 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/dao/comment/CommentReactionDaoTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/dao/comment/CommentReactionDaoTest.java @@ -34,7 +34,9 @@ import static org.hamcrest.CoreMatchers.hasItem; import static org.hamcrest.MatcherAssert.assertThat; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; class CommentReactionDaoTest extends BaseDaoTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/dao/lucene/LuceneSearchDaoTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/dao/lucene/LuceneSearchDaoTest.java index c4b0c3d38..fd212efdd 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/dao/lucene/LuceneSearchDaoTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/dao/lucene/LuceneSearchDaoTest.java @@ -36,7 +36,12 @@ import static cz.cvut.kbss.termit.persistence.dao.lucene.LuceneSearchDao.LUCENE_WILDCARD; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.anyString; +import static org.mockito.Mockito.atLeastOnce; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class LuceneSearchDaoTest { diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/dao/util/SparqlResultToTermInfoMapperTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/dao/util/SparqlResultToTermInfoMapperTest.java index c523498fb..2012f36b3 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/dao/util/SparqlResultToTermInfoMapperTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/dao/util/SparqlResultToTermInfoMapperTest.java @@ -27,7 +27,7 @@ import java.util.Arrays; import java.util.List; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; class SparqlResultToTermInfoMapperTest { diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/snapshot/CascadingSnapshotCreatorTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/snapshot/CascadingSnapshotCreatorTest.java index 72fd2d356..f58ee36c8 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/snapshot/CascadingSnapshotCreatorTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/snapshot/CascadingSnapshotCreatorTest.java @@ -41,7 +41,10 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.hasItem; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; class CascadingSnapshotCreatorTest extends BaseDaoTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/persistence/validation/ResultCachingValidatorTest.java b/src/test/java/cz/cvut/kbss/termit/persistence/validation/ResultCachingValidatorTest.java index cc38b77fc..8198751a2 100644 --- a/src/test/java/cz/cvut/kbss/termit/persistence/validation/ResultCachingValidatorTest.java +++ b/src/test/java/cz/cvut/kbss/termit/persistence/validation/ResultCachingValidatorTest.java @@ -33,7 +33,11 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotSame; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.anyCollection; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class ResultCachingValidatorTest { diff --git a/src/test/java/cz/cvut/kbss/termit/rest/BaseControllerTestRunner.java b/src/test/java/cz/cvut/kbss/termit/rest/BaseControllerTestRunner.java index b90eb3bec..4075ec3fd 100644 --- a/src/test/java/cz/cvut/kbss/termit/rest/BaseControllerTestRunner.java +++ b/src/test/java/cz/cvut/kbss/termit/rest/BaseControllerTestRunner.java @@ -27,7 +27,10 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders; import org.springframework.web.accept.ContentNegotiationManager; -import static cz.cvut.kbss.termit.environment.Environment.*; +import static cz.cvut.kbss.termit.environment.Environment.createDefaultMessageConverter; +import static cz.cvut.kbss.termit.environment.Environment.createJsonLdMessageConverter; +import static cz.cvut.kbss.termit.environment.Environment.createResourceMessageConverter; +import static cz.cvut.kbss.termit.environment.Environment.createStringEncodingMessageConverter; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; diff --git a/src/test/java/cz/cvut/kbss/termit/rest/CommentControllerTest.java b/src/test/java/cz/cvut/kbss/termit/rest/CommentControllerTest.java index a623543f7..60912418c 100644 --- a/src/test/java/cz/cvut/kbss/termit/rest/CommentControllerTest.java +++ b/src/test/java/cz/cvut/kbss/termit/rest/CommentControllerTest.java @@ -41,8 +41,15 @@ import static org.hamcrest.Matchers.containsString; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.mockito.Mockito.*; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @ExtendWith(MockitoExtension.class) diff --git a/src/test/java/cz/cvut/kbss/termit/rest/ConfigurationControllerSecurityTest.java b/src/test/java/cz/cvut/kbss/termit/rest/ConfigurationControllerSecurityTest.java index c9ca87796..0f79ceaa9 100644 --- a/src/test/java/cz/cvut/kbss/termit/rest/ConfigurationControllerSecurityTest.java +++ b/src/test/java/cz/cvut/kbss/termit/rest/ConfigurationControllerSecurityTest.java @@ -40,7 +40,9 @@ import static cz.cvut.kbss.termit.util.Constants.REST_MAPPING_PATH; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; +import static org.hamcrest.Matchers.anyOf; +import static org.hamcrest.Matchers.empty; +import static org.hamcrest.Matchers.nullValue; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.mockito.Mockito.when; diff --git a/src/test/java/cz/cvut/kbss/termit/rest/ResourceControllerTest.java b/src/test/java/cz/cvut/kbss/termit/rest/ResourceControllerTest.java index a9d0e35d9..1b2021a72 100644 --- a/src/test/java/cz/cvut/kbss/termit/rest/ResourceControllerTest.java +++ b/src/test/java/cz/cvut/kbss/termit/rest/ResourceControllerTest.java @@ -32,10 +32,10 @@ import cz.cvut.kbss.termit.service.IdentifierResolver; import cz.cvut.kbss.termit.service.business.ResourceService; import cz.cvut.kbss.termit.service.document.ResourceRetrievalSpecification; -import cz.cvut.kbss.termit.util.TypeAwareFileSystemResource; import cz.cvut.kbss.termit.util.Configuration; import cz.cvut.kbss.termit.util.Constants; import cz.cvut.kbss.termit.util.Constants.QueryParams; +import cz.cvut.kbss.termit.util.TypeAwareFileSystemResource; import cz.cvut.kbss.termit.util.Utils; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; diff --git a/src/test/java/cz/cvut/kbss/termit/rest/TermControllerTest.java b/src/test/java/cz/cvut/kbss/termit/rest/TermControllerTest.java index d3e74f5aa..cedfb8e06 100644 --- a/src/test/java/cz/cvut/kbss/termit/rest/TermControllerTest.java +++ b/src/test/java/cz/cvut/kbss/termit/rest/TermControllerTest.java @@ -41,10 +41,10 @@ import cz.cvut.kbss.termit.service.export.ExportConfig; import cz.cvut.kbss.termit.service.export.ExportFormat; import cz.cvut.kbss.termit.service.export.ExportType; -import cz.cvut.kbss.termit.util.TypeAwareByteArrayResource; import cz.cvut.kbss.termit.util.Configuration; import cz.cvut.kbss.termit.util.Constants; import cz.cvut.kbss.termit.util.Constants.QueryParams; +import cz.cvut.kbss.termit.util.TypeAwareByteArrayResource; import cz.cvut.kbss.termit.util.Utils; import cz.cvut.kbss.termit.util.Vocabulary; import org.apache.poi.xssf.usermodel.XSSFSheet; diff --git a/src/test/java/cz/cvut/kbss/termit/rest/UserControllerSecurityTest.java b/src/test/java/cz/cvut/kbss/termit/rest/UserControllerSecurityTest.java index 193c10284..47799bfc8 100644 --- a/src/test/java/cz/cvut/kbss/termit/rest/UserControllerSecurityTest.java +++ b/src/test/java/cz/cvut/kbss/termit/rest/UserControllerSecurityTest.java @@ -17,7 +17,6 @@ */ package cz.cvut.kbss.termit.rest; -import cz.cvut.kbss.termit.config.SecurityConfig; import cz.cvut.kbss.termit.environment.Environment; import cz.cvut.kbss.termit.environment.Generator; import cz.cvut.kbss.termit.environment.config.TestRestSecurityConfig; @@ -38,8 +37,13 @@ import static cz.cvut.kbss.termit.service.IdentifierResolver.extractIdentifierFragment; import static cz.cvut.kbss.termit.util.Constants.REST_MAPPING_PATH; import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.mockito.Mockito.*; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; /** diff --git a/src/test/java/cz/cvut/kbss/termit/rest/UserControllerTest.java b/src/test/java/cz/cvut/kbss/termit/rest/UserControllerTest.java index b23e3ccf4..4632fbfb1 100644 --- a/src/test/java/cz/cvut/kbss/termit/rest/UserControllerTest.java +++ b/src/test/java/cz/cvut/kbss/termit/rest/UserControllerTest.java @@ -48,8 +48,14 @@ import static cz.cvut.kbss.termit.service.IdentifierResolver.extractIdentifierFragment; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.*; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.eq; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @ExtendWith(MockitoExtension.class) diff --git a/src/test/java/cz/cvut/kbss/termit/rest/UserGroupControllerTest.java b/src/test/java/cz/cvut/kbss/termit/rest/UserGroupControllerTest.java index b0f7740d1..50179f2c1 100644 --- a/src/test/java/cz/cvut/kbss/termit/rest/UserGroupControllerTest.java +++ b/src/test/java/cz/cvut/kbss/termit/rest/UserGroupControllerTest.java @@ -44,7 +44,9 @@ import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.delete; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @ExtendWith(MockitoExtension.class) diff --git a/src/test/java/cz/cvut/kbss/termit/rest/VocabularyControllerSecurityTest.java b/src/test/java/cz/cvut/kbss/termit/rest/VocabularyControllerSecurityTest.java index 8a6042fad..dfcc17ba2 100644 --- a/src/test/java/cz/cvut/kbss/termit/rest/VocabularyControllerSecurityTest.java +++ b/src/test/java/cz/cvut/kbss/termit/rest/VocabularyControllerSecurityTest.java @@ -35,7 +35,9 @@ import static cz.cvut.kbss.termit.environment.Generator.generateVocabulary; import static cz.cvut.kbss.termit.util.Constants.REST_MAPPING_PATH; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; diff --git a/src/test/java/cz/cvut/kbss/termit/rest/VocabularyControllerTest.java b/src/test/java/cz/cvut/kbss/termit/rest/VocabularyControllerTest.java index 76b2e0521..0d1c7444d 100644 --- a/src/test/java/cz/cvut/kbss/termit/rest/VocabularyControllerTest.java +++ b/src/test/java/cz/cvut/kbss/termit/rest/VocabularyControllerTest.java @@ -34,14 +34,13 @@ import cz.cvut.kbss.termit.model.acl.AccessLevel; import cz.cvut.kbss.termit.model.acl.UserAccessControlRecord; import cz.cvut.kbss.termit.model.changetracking.AbstractChangeRecord; -import cz.cvut.kbss.termit.model.validation.ValidationResult; import cz.cvut.kbss.termit.rest.handler.ErrorInfo; import cz.cvut.kbss.termit.service.IdentifierResolver; import cz.cvut.kbss.termit.service.business.VocabularyService; -import cz.cvut.kbss.termit.util.TypeAwareFileSystemResource; import cz.cvut.kbss.termit.util.Configuration; import cz.cvut.kbss.termit.util.Constants; import cz.cvut.kbss.termit.util.Constants.QueryParams; +import cz.cvut.kbss.termit.util.TypeAwareFileSystemResource; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -55,7 +54,6 @@ import org.springframework.http.MediaType; import org.springframework.mock.web.MockMultipartFile; import org.springframework.test.web.servlet.MvcResult; -import org.topbraid.shacl.vocabulary.SH; import java.io.File; import java.math.BigInteger; diff --git a/src/test/java/cz/cvut/kbss/termit/rest/servlet/DiagnosticsContextFilterTest.java b/src/test/java/cz/cvut/kbss/termit/rest/servlet/DiagnosticsContextFilterTest.java index 5f1f4fcd8..062fc281d 100644 --- a/src/test/java/cz/cvut/kbss/termit/rest/servlet/DiagnosticsContextFilterTest.java +++ b/src/test/java/cz/cvut/kbss/termit/rest/servlet/DiagnosticsContextFilterTest.java @@ -21,21 +21,23 @@ import cz.cvut.kbss.termit.model.UserAccount; import cz.cvut.kbss.termit.security.model.AuthenticationToken; import cz.cvut.kbss.termit.security.model.TermItUserDetails; +import jakarta.servlet.FilterChain; +import jakarta.servlet.http.HttpServletRequest; +import jakarta.servlet.http.HttpServletResponse; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import org.slf4j.MDC; -import jakarta.servlet.FilterChain; -import jakarta.servlet.http.HttpServletRequest; -import jakarta.servlet.http.HttpServletResponse; import java.security.Principal; import java.util.Collections; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNull; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class DiagnosticsContextFilterTest { diff --git a/src/test/java/cz/cvut/kbss/termit/rest/util/RestUtilsTest.java b/src/test/java/cz/cvut/kbss/termit/rest/util/RestUtilsTest.java index 619844599..485e6ea29 100644 --- a/src/test/java/cz/cvut/kbss/termit/rest/util/RestUtilsTest.java +++ b/src/test/java/cz/cvut/kbss/termit/rest/util/RestUtilsTest.java @@ -20,6 +20,7 @@ import cz.cvut.kbss.termit.environment.Generator; import cz.cvut.kbss.termit.util.Constants; import cz.cvut.kbss.termit.util.Utils; +import jakarta.servlet.http.Cookie; import org.junit.jupiter.api.Test; import org.springframework.http.HttpMethod; import org.springframework.http.HttpStatus; @@ -28,7 +29,6 @@ import org.springframework.web.context.request.ServletRequestAttributes; import org.springframework.web.server.ResponseStatusException; -import jakarta.servlet.http.Cookie; import java.net.URI; import java.time.Instant; import java.time.temporal.ChronoUnit; @@ -37,7 +37,10 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.endsWith; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; class RestUtilsTest { diff --git a/src/test/java/cz/cvut/kbss/termit/security/AuthenticationFailureTest.java b/src/test/java/cz/cvut/kbss/termit/security/AuthenticationFailureTest.java index 4fdd09c65..f712c4974 100644 --- a/src/test/java/cz/cvut/kbss/termit/security/AuthenticationFailureTest.java +++ b/src/test/java/cz/cvut/kbss/termit/security/AuthenticationFailureTest.java @@ -32,7 +32,9 @@ import static cz.cvut.kbss.termit.security.AuthenticationSuccessTest.request; import static cz.cvut.kbss.termit.security.AuthenticationSuccessTest.response; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; @Tag("security") class AuthenticationFailureTest { diff --git a/src/test/java/cz/cvut/kbss/termit/security/AuthenticationSuccessTest.java b/src/test/java/cz/cvut/kbss/termit/security/AuthenticationSuccessTest.java index b59e19307..46a15dac7 100644 --- a/src/test/java/cz/cvut/kbss/termit/security/AuthenticationSuccessTest.java +++ b/src/test/java/cz/cvut/kbss/termit/security/AuthenticationSuccessTest.java @@ -32,7 +32,10 @@ import org.springframework.mock.web.MockHttpSession; import org.springframework.security.core.Authentication; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; @Tag("security") class AuthenticationSuccessTest { diff --git a/src/test/java/cz/cvut/kbss/termit/security/JwtUtilsTest.java b/src/test/java/cz/cvut/kbss/termit/security/JwtUtilsTest.java index 5ee713ed0..aef1a3506 100644 --- a/src/test/java/cz/cvut/kbss/termit/security/JwtUtilsTest.java +++ b/src/test/java/cz/cvut/kbss/termit/security/JwtUtilsTest.java @@ -43,14 +43,22 @@ import java.nio.charset.StandardCharsets; import java.security.Key; -import java.util.*; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Set; import java.util.stream.Collectors; import static cz.cvut.kbss.termit.security.model.TermItUserDetails.DEFAULT_AUTHORITY; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.greaterThan; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; @Tag("security") @ExtendWith({SpringExtension.class, MockitoExtension.class}) diff --git a/src/test/java/cz/cvut/kbss/termit/security/OntologicalAuthenticationProviderTest.java b/src/test/java/cz/cvut/kbss/termit/security/OntologicalAuthenticationProviderTest.java index 859cdbbdc..82968ef1f 100644 --- a/src/test/java/cz/cvut/kbss/termit/security/OntologicalAuthenticationProviderTest.java +++ b/src/test/java/cz/cvut/kbss/termit/security/OntologicalAuthenticationProviderTest.java @@ -49,8 +49,15 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; import static org.hamcrest.Matchers.instanceOf; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.anyString; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @Tag("security") @ExtendWith(MockitoExtension.class) diff --git a/src/test/java/cz/cvut/kbss/termit/security/model/TermItUserDetailsTest.java b/src/test/java/cz/cvut/kbss/termit/security/model/TermItUserDetailsTest.java index 0dc8e67e8..55011a84e 100644 --- a/src/test/java/cz/cvut/kbss/termit/security/model/TermItUserDetailsTest.java +++ b/src/test/java/cz/cvut/kbss/termit/security/model/TermItUserDetailsTest.java @@ -27,7 +27,9 @@ import java.util.Collections; import java.util.Set; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotSame; +import static org.junit.jupiter.api.Assertions.assertTrue; class TermItUserDetailsTest { @@ -78,4 +80,4 @@ void getUserReturnsCopyOfUser() { assertEquals(user, result); assertNotSame(user, result); } -} \ No newline at end of file +} diff --git a/src/test/java/cz/cvut/kbss/termit/service/IdentifierResolverTest.java b/src/test/java/cz/cvut/kbss/termit/service/IdentifierResolverTest.java index d918e4574..7b38d4e55 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/IdentifierResolverTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/IdentifierResolverTest.java @@ -26,7 +26,11 @@ import java.net.URI; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.endsWith; +import static org.hamcrest.Matchers.greaterThan; +import static org.hamcrest.Matchers.lessThan; +import static org.hamcrest.Matchers.not; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; diff --git a/src/test/java/cz/cvut/kbss/termit/service/business/ResourceServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/business/ResourceServiceTest.java index 068a86516..6119b0f90 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/business/ResourceServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/business/ResourceServiceTest.java @@ -33,9 +33,9 @@ import cz.cvut.kbss.termit.service.document.DocumentManager; import cz.cvut.kbss.termit.service.document.ResourceRetrievalSpecification; import cz.cvut.kbss.termit.service.document.TextAnalysisService; -import cz.cvut.kbss.termit.util.TypeAwareByteArrayResource; import cz.cvut.kbss.termit.service.repository.ChangeRecordService; import cz.cvut.kbss.termit.service.repository.ResourceRepositoryService; +import cz.cvut.kbss.termit.util.TypeAwareByteArrayResource; import cz.cvut.kbss.termit.util.TypeAwareResource; import cz.cvut.kbss.termit.util.Utils; import org.jsoup.Jsoup; diff --git a/src/test/java/cz/cvut/kbss/termit/service/business/SearchServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/business/SearchServiceTest.java index 1a57954d3..a4e7fcccb 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/business/SearchServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/business/SearchServiceTest.java @@ -43,8 +43,14 @@ import java.util.List; import java.util.Set; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.anyCollection; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class SearchServiceTest { diff --git a/src/test/java/cz/cvut/kbss/termit/service/business/TermServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/business/TermServiceTest.java index 22a7898d7..2a4781da5 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/business/TermServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/business/TermServiceTest.java @@ -38,12 +38,12 @@ import cz.cvut.kbss.termit.service.export.ExportFormat; import cz.cvut.kbss.termit.service.export.ExportType; import cz.cvut.kbss.termit.service.export.VocabularyExporters; -import cz.cvut.kbss.termit.util.TypeAwareByteArrayResource; import cz.cvut.kbss.termit.service.language.LanguageService; import cz.cvut.kbss.termit.service.repository.ChangeRecordService; import cz.cvut.kbss.termit.service.repository.TermRepositoryService; import cz.cvut.kbss.termit.util.Configuration; import cz.cvut.kbss.termit.util.Constants; +import cz.cvut.kbss.termit.util.TypeAwareByteArrayResource; import cz.cvut.kbss.termit.util.TypeAwareResource; import cz.cvut.kbss.termit.util.Utils; import org.junit.jupiter.api.Test; diff --git a/src/test/java/cz/cvut/kbss/termit/service/business/readonly/ReadOnlyTermServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/business/readonly/ReadOnlyTermServiceTest.java index 2dd2eda9c..5dffc660a 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/business/readonly/ReadOnlyTermServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/business/readonly/ReadOnlyTermServiceTest.java @@ -53,7 +53,10 @@ import static org.hamcrest.Matchers.not; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.mockito.ArgumentMatchers.*; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyCollection; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/src/test/java/cz/cvut/kbss/termit/service/business/readonly/ReadOnlyVocabularyServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/business/readonly/ReadOnlyVocabularyServiceTest.java index 90b2b7fc2..9bc8b11b4 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/business/readonly/ReadOnlyVocabularyServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/business/readonly/ReadOnlyVocabularyServiceTest.java @@ -40,7 +40,10 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/src/test/java/cz/cvut/kbss/termit/service/changetracking/MetamodelBasedChangeCalculatorTest.java b/src/test/java/cz/cvut/kbss/termit/service/changetracking/MetamodelBasedChangeCalculatorTest.java index 74f834ce4..eba418e2c 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/changetracking/MetamodelBasedChangeCalculatorTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/changetracking/MetamodelBasedChangeCalculatorTest.java @@ -40,8 +40,12 @@ import java.util.stream.IntStream; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; -import static org.junit.jupiter.api.Assertions.*; +import static org.hamcrest.Matchers.anyOf; +import static org.hamcrest.Matchers.emptyCollectionOf; +import static org.hamcrest.Matchers.nullValue; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; class MetamodelBasedChangeCalculatorTest extends BaseServiceTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/service/document/DefaultDocumentManagerTest.java b/src/test/java/cz/cvut/kbss/termit/service/document/DefaultDocumentManagerTest.java index b17976107..b2f2e1ae6 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/document/DefaultDocumentManagerTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/document/DefaultDocumentManagerTest.java @@ -53,7 +53,12 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.greaterThan; import static org.hamcrest.Matchers.startsWith; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; @ContextConfiguration(initializers = {PropertyMockingApplicationContextInitializer.class}) class DefaultDocumentManagerTest extends BaseServiceTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/service/document/TextAnalysisServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/document/TextAnalysisServiceTest.java index 4f56a27ba..560d6ddd0 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/document/TextAnalysisServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/document/TextAnalysisServiceTest.java @@ -65,9 +65,22 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.*; -import static org.springframework.test.web.client.match.MockRestRequestMatchers.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.doCallRealMethod; +import static org.mockito.Mockito.doNothing; +import static org.mockito.Mockito.eq; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.content; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.header; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.method; +import static org.springframework.test.web.client.match.MockRestRequestMatchers.requestTo; import static org.springframework.test.web.client.response.MockRestResponseCreators.withServerError; import static org.springframework.test.web.client.response.MockRestResponseCreators.withSuccess; diff --git a/src/test/java/cz/cvut/kbss/termit/service/export/ExcelTermExporterTest.java b/src/test/java/cz/cvut/kbss/termit/service/export/ExcelTermExporterTest.java index 80927ceda..c6baf03a5 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/export/ExcelTermExporterTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/export/ExcelTermExporterTest.java @@ -31,7 +31,13 @@ import org.junit.jupiter.api.Test; import java.net.URI; -import java.util.*; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.IntStream; diff --git a/src/test/java/cz/cvut/kbss/termit/service/export/ExcelVocabularyExporterTest.java b/src/test/java/cz/cvut/kbss/termit/service/export/ExcelVocabularyExporterTest.java index d09176d90..1288bf35f 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/export/ExcelVocabularyExporterTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/export/ExcelVocabularyExporterTest.java @@ -47,7 +47,12 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.oneOf; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/src/test/java/cz/cvut/kbss/termit/service/export/SKOSVocabularyExporterTest.java b/src/test/java/cz/cvut/kbss/termit/service/export/SKOSVocabularyExporterTest.java index 46ebd73b9..0a969b836 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/export/SKOSVocabularyExporterTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/export/SKOSVocabularyExporterTest.java @@ -36,7 +36,11 @@ import org.eclipse.rdf4j.model.ValueFactory; import org.eclipse.rdf4j.model.impl.LinkedHashModel; import org.eclipse.rdf4j.model.impl.SimpleValueFactory; -import org.eclipse.rdf4j.model.vocabulary.*; +import org.eclipse.rdf4j.model.vocabulary.DCTERMS; +import org.eclipse.rdf4j.model.vocabulary.OWL; +import org.eclipse.rdf4j.model.vocabulary.RDF; +import org.eclipse.rdf4j.model.vocabulary.RDFS; +import org.eclipse.rdf4j.model.vocabulary.SKOS; import org.eclipse.rdf4j.repository.Repository; import org.eclipse.rdf4j.repository.RepositoryConnection; import org.eclipse.rdf4j.rio.RDFFormat; @@ -50,7 +54,11 @@ import org.springframework.http.MediaType; import java.io.IOException; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Set; import java.util.stream.Collectors; import static org.hamcrest.CoreMatchers.hasItem; diff --git a/src/test/java/cz/cvut/kbss/termit/service/init/AdminAccountGeneratorTest.java b/src/test/java/cz/cvut/kbss/termit/service/init/AdminAccountGeneratorTest.java index 43e8a362a..834a6c2d0 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/init/AdminAccountGeneratorTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/init/AdminAccountGeneratorTest.java @@ -41,11 +41,16 @@ import java.util.List; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.not; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.any; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class AdminAccountGeneratorTest { diff --git a/src/test/java/cz/cvut/kbss/termit/service/init/VocabularyAccessControlListGeneratorTest.java b/src/test/java/cz/cvut/kbss/termit/service/init/VocabularyAccessControlListGeneratorTest.java index 4b8071de0..ae328686e 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/init/VocabularyAccessControlListGeneratorTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/init/VocabularyAccessControlListGeneratorTest.java @@ -24,7 +24,6 @@ import cz.cvut.kbss.termit.model.Vocabulary; import cz.cvut.kbss.termit.model.acl.AccessControlList; import cz.cvut.kbss.termit.service.business.AccessControlListService; -import cz.cvut.kbss.termit.service.business.VocabularyService; import cz.cvut.kbss.termit.service.repository.VocabularyRepositoryService; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -36,9 +35,13 @@ import java.util.List; import java.util.stream.Collectors; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.ArgumentMatchers.*; -import static org.mockito.Mockito.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyString; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class VocabularyAccessControlListGeneratorTest { diff --git a/src/test/java/cz/cvut/kbss/termit/service/language/UfoTermTypesServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/language/UfoTermTypesServiceTest.java index a1619304e..b95a3e232 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/language/UfoTermTypesServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/language/UfoTermTypesServiceTest.java @@ -31,7 +31,9 @@ import java.util.List; import java.util.Optional; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) diff --git a/src/test/java/cz/cvut/kbss/termit/service/mail/AssetLinkTest.java b/src/test/java/cz/cvut/kbss/termit/service/mail/AssetLinkTest.java index 68d805acc..1b56c9697 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/mail/AssetLinkTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/mail/AssetLinkTest.java @@ -30,7 +30,9 @@ import java.util.Map; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; +import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.lessThan; +import static org.hamcrest.Matchers.startsWith; class AssetLinkTest { diff --git a/src/test/java/cz/cvut/kbss/termit/service/notification/CommentChangeNotifierTest.java b/src/test/java/cz/cvut/kbss/termit/service/notification/CommentChangeNotifierTest.java index bbde3c782..0f84df634 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/notification/CommentChangeNotifierTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/notification/CommentChangeNotifierTest.java @@ -44,7 +44,12 @@ import java.time.LocalDate; import java.time.ZoneId; import java.time.temporal.ChronoUnit; -import java.util.*; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.IntStream; @@ -52,8 +57,12 @@ import static cz.cvut.kbss.termit.service.notification.CommentChangeNotifier.COMMENT_CHANGES_TEMPLATE; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.hasItems; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.ArgumentMatchers.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.anyMap; +import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/src/test/java/cz/cvut/kbss/termit/service/notification/NotificationServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/notification/NotificationServiceTest.java index 83c48e7a0..738037100 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/notification/NotificationServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/notification/NotificationServiceTest.java @@ -39,7 +39,9 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.lessThan; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class NotificationServiceTest { diff --git a/src/test/java/cz/cvut/kbss/termit/service/repository/BaseAssetRepositoryServiceImpl.java b/src/test/java/cz/cvut/kbss/termit/service/repository/BaseAssetRepositoryServiceImpl.java index 37f95d768..905710cd1 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/repository/BaseAssetRepositoryServiceImpl.java +++ b/src/test/java/cz/cvut/kbss/termit/service/repository/BaseAssetRepositoryServiceImpl.java @@ -21,9 +21,8 @@ import cz.cvut.kbss.termit.persistence.dao.BaseAssetDao; import cz.cvut.kbss.termit.persistence.dao.TermDao; import cz.cvut.kbss.termit.service.security.SecurityUtils; -import org.springframework.beans.factory.annotation.Autowired; - import jakarta.validation.Validator; +import org.springframework.beans.factory.annotation.Autowired; public class BaseAssetRepositoryServiceImpl extends BaseAssetRepositoryService { diff --git a/src/test/java/cz/cvut/kbss/termit/service/repository/BaseAssetRepositoryServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/repository/BaseAssetRepositoryServiceTest.java index 770c04c5e..bee8a2772 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/repository/BaseAssetRepositoryServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/repository/BaseAssetRepositoryServiceTest.java @@ -31,6 +31,7 @@ import cz.cvut.kbss.termit.persistence.dao.TermDao; import cz.cvut.kbss.termit.service.BaseServiceTestRunner; import cz.cvut.kbss.termit.service.security.SecurityUtils; +import jakarta.validation.Validator; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.springframework.beans.factory.annotation.Autowired; @@ -41,7 +42,6 @@ import org.springframework.test.annotation.DirtiesContext; import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; -import jakarta.validation.Validator; import java.net.URI; import java.time.Instant; import java.util.List; @@ -49,7 +49,9 @@ import java.util.stream.Collectors; import java.util.stream.IntStream; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; @DirtiesContext(classMode = DirtiesContext.ClassMode.BEFORE_EACH_TEST_METHOD) class BaseAssetRepositoryServiceTest extends BaseServiceTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/service/repository/BaseRepositoryServiceImpl.java b/src/test/java/cz/cvut/kbss/termit/service/repository/BaseRepositoryServiceImpl.java index 97ae6a249..9c2dd4d5b 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/repository/BaseRepositoryServiceImpl.java +++ b/src/test/java/cz/cvut/kbss/termit/service/repository/BaseRepositoryServiceImpl.java @@ -20,9 +20,8 @@ import cz.cvut.kbss.termit.model.UserAccount; import cz.cvut.kbss.termit.persistence.dao.GenericDao; import cz.cvut.kbss.termit.persistence.dao.UserAccountDao; -import org.springframework.beans.factory.annotation.Autowired; - import jakarta.validation.Validator; +import org.springframework.beans.factory.annotation.Autowired; public class BaseRepositoryServiceImpl extends BaseRepositoryService { diff --git a/src/test/java/cz/cvut/kbss/termit/service/repository/BaseRepositoryServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/repository/BaseRepositoryServiceTest.java index 2c9b4a07d..15b4daa32 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/repository/BaseRepositoryServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/repository/BaseRepositoryServiceTest.java @@ -23,6 +23,7 @@ import cz.cvut.kbss.termit.model.UserAccount; import cz.cvut.kbss.termit.persistence.dao.UserAccountDao; import cz.cvut.kbss.termit.service.BaseServiceTestRunner; +import jakarta.validation.Validator; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.mockito.InOrder; @@ -33,15 +34,24 @@ import org.springframework.context.annotation.Bean; import org.springframework.validation.beanvalidation.LocalValidatorFactoryBean; -import jakarta.validation.Validator; import java.net.URI; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; import java.util.stream.IntStream; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.*; +import static org.junit.jupiter.api.Assertions.assertAll; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.inOrder; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @Tag("service") class BaseRepositoryServiceTest extends BaseServiceTestRunner { diff --git a/src/test/java/cz/cvut/kbss/termit/service/repository/RepositoryAccessControlListServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/repository/RepositoryAccessControlListServiceTest.java index a4532d325..a21a0944e 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/repository/RepositoryAccessControlListServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/repository/RepositoryAccessControlListServiceTest.java @@ -24,7 +24,12 @@ import cz.cvut.kbss.termit.model.User; import cz.cvut.kbss.termit.model.UserAccount; import cz.cvut.kbss.termit.model.UserRole; -import cz.cvut.kbss.termit.model.acl.*; +import cz.cvut.kbss.termit.model.acl.AccessControlList; +import cz.cvut.kbss.termit.model.acl.AccessControlRecord; +import cz.cvut.kbss.termit.model.acl.AccessLevel; +import cz.cvut.kbss.termit.model.acl.RoleAccessControlRecord; +import cz.cvut.kbss.termit.model.acl.UserAccessControlRecord; +import cz.cvut.kbss.termit.model.acl.UserGroupAccessControlRecord; import cz.cvut.kbss.termit.persistence.dao.acl.AccessControlListDao; import cz.cvut.kbss.termit.service.security.SecurityUtils; import cz.cvut.kbss.termit.util.Configuration; @@ -47,8 +52,13 @@ import static org.hamcrest.Matchers.hasItem; import static org.hamcrest.Matchers.hasItems; import static org.hamcrest.Matchers.not; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class RepositoryAccessControlListServiceTest { diff --git a/src/test/java/cz/cvut/kbss/termit/service/repository/ResourceRepositoryServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/repository/ResourceRepositoryServiceTest.java index 4cb5ce854..df9fae710 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/repository/ResourceRepositoryServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/repository/ResourceRepositoryServiceTest.java @@ -29,6 +29,8 @@ import cz.cvut.kbss.termit.service.IdentifierResolver; import cz.cvut.kbss.termit.util.Configuration; import cz.cvut.kbss.termit.util.Vocabulary; +import jakarta.validation.Validation; +import jakarta.validation.Validator; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -38,16 +40,17 @@ import org.mockito.Spy; import org.mockito.junit.jupiter.MockitoExtension; -import jakarta.validation.Validation; -import jakarta.validation.Validator; - import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.nullValue; import static org.hamcrest.collection.IsEmptyCollection.empty; import static org.hamcrest.core.AnyOf.anyOf; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; import static org.mockito.ArgumentMatchers.any; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class ResourceRepositoryServiceTest { diff --git a/src/test/java/cz/cvut/kbss/termit/service/repository/UserRepositoryServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/repository/UserRepositoryServiceTest.java index 1041c23d4..aef217484 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/repository/UserRepositoryServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/repository/UserRepositoryServiceTest.java @@ -25,6 +25,8 @@ import cz.cvut.kbss.termit.service.IdentifierResolver; import cz.cvut.kbss.termit.util.Configuration; import cz.cvut.kbss.termit.util.Vocabulary; +import jakarta.validation.Validation; +import jakarta.validation.Validator; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.ArgumentCaptor; @@ -35,15 +37,20 @@ import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; import org.springframework.security.crypto.password.PasswordEncoder; -import jakarta.validation.Validation; -import jakarta.validation.Validator; import java.net.URI; import java.util.Optional; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.doAnswer; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class UserRepositoryServiceTest { diff --git a/src/test/java/cz/cvut/kbss/termit/service/security/RuntimeBasedLoginTrackerTest.java b/src/test/java/cz/cvut/kbss/termit/service/security/RuntimeBasedLoginTrackerTest.java index 5a84b4a51..1d9d0ee5f 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/security/RuntimeBasedLoginTrackerTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/security/RuntimeBasedLoginTrackerTest.java @@ -35,8 +35,13 @@ import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit.jupiter.SpringExtension; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.spy; +import static org.mockito.Mockito.times; +import static org.mockito.Mockito.verify; @ExtendWith(SpringExtension.class) @ContextConfiguration(classes = {RuntimeBasedLoginTrackerTest.Config.class}) diff --git a/src/test/java/cz/cvut/kbss/termit/service/security/TermItUserDetailsServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/security/TermItUserDetailsServiceTest.java index 0525978b1..91d204fcb 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/security/TermItUserDetailsServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/security/TermItUserDetailsServiceTest.java @@ -26,7 +26,9 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.security.core.userdetails.UsernameNotFoundException; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; class TermItUserDetailsServiceTest extends BaseServiceTestRunner { @@ -53,4 +55,4 @@ void loadUserByUsernameThrowsUsernameNotFoundForUnknownUsername() { assertThrows(UsernameNotFoundException.class, () -> sut.loadUserByUsername(username)); assertEquals("User with username " + username + " not found.", ex.getMessage()); } -} \ No newline at end of file +} diff --git a/src/test/java/cz/cvut/kbss/termit/service/security/authorization/ResourceAuthorizationServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/security/authorization/ResourceAuthorizationServiceTest.java index 5905b7470..27eb6d2c1 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/security/authorization/ResourceAuthorizationServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/security/authorization/ResourceAuthorizationServiceTest.java @@ -27,7 +27,9 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; diff --git a/src/test/java/cz/cvut/kbss/termit/service/security/authorization/SnapshotAuthorizationServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/security/authorization/SnapshotAuthorizationServiceTest.java index 6b0829f3c..c654482f6 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/security/authorization/SnapshotAuthorizationServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/security/authorization/SnapshotAuthorizationServiceTest.java @@ -41,7 +41,10 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTrue; -import static org.mockito.Mockito.*; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class SnapshotAuthorizationServiceTest { diff --git a/src/test/java/cz/cvut/kbss/termit/service/security/authorization/VocabularyAuthorizationServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/security/authorization/VocabularyAuthorizationServiceTest.java index f7c0204c5..db2362516 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/security/authorization/VocabularyAuthorizationServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/security/authorization/VocabularyAuthorizationServiceTest.java @@ -39,8 +39,14 @@ import java.util.stream.Stream; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.eq; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class VocabularyAuthorizationServiceTest { diff --git a/src/test/java/cz/cvut/kbss/termit/service/security/authorization/acl/AccessControlListBasedAuthorizationServiceTest.java b/src/test/java/cz/cvut/kbss/termit/service/security/authorization/acl/AccessControlListBasedAuthorizationServiceTest.java index dc765c5e5..6ed873ad8 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/security/authorization/acl/AccessControlListBasedAuthorizationServiceTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/security/authorization/acl/AccessControlListBasedAuthorizationServiceTest.java @@ -22,7 +22,11 @@ import cz.cvut.kbss.termit.model.UserGroup; import cz.cvut.kbss.termit.model.UserRole; import cz.cvut.kbss.termit.model.Vocabulary; -import cz.cvut.kbss.termit.model.acl.*; +import cz.cvut.kbss.termit.model.acl.AccessControlList; +import cz.cvut.kbss.termit.model.acl.AccessLevel; +import cz.cvut.kbss.termit.model.acl.RoleAccessControlRecord; +import cz.cvut.kbss.termit.model.acl.UserAccessControlRecord; +import cz.cvut.kbss.termit.model.acl.UserGroupAccessControlRecord; import cz.cvut.kbss.termit.service.business.AccessControlListService; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -38,8 +42,12 @@ import java.util.Optional; import java.util.stream.Stream; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.never; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; @ExtendWith(MockitoExtension.class) class AccessControlListBasedAuthorizationServiceTest { diff --git a/src/test/java/cz/cvut/kbss/termit/service/term/AssertedInferredValueDifferentiatorTest.java b/src/test/java/cz/cvut/kbss/termit/service/term/AssertedInferredValueDifferentiatorTest.java index af0d3f9e4..b44dcad6f 100644 --- a/src/test/java/cz/cvut/kbss/termit/service/term/AssertedInferredValueDifferentiatorTest.java +++ b/src/test/java/cz/cvut/kbss/termit/service/term/AssertedInferredValueDifferentiatorTest.java @@ -28,7 +28,11 @@ import java.util.stream.IntStream; import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.*; +import static org.hamcrest.Matchers.anyOf; +import static org.hamcrest.Matchers.emptyCollectionOf; +import static org.hamcrest.Matchers.hasItem; +import static org.hamcrest.Matchers.not; +import static org.hamcrest.Matchers.nullValue; import static org.junit.jupiter.api.Assertions.assertEquals; class AssertedInferredValueDifferentiatorTest { @@ -138,4 +142,4 @@ void differentiateExactMatchDoesNothingWhenOriginalInferredAreNotPresent() { assertEquals(asserted, target.getExactMatchTerms()); assertThat(target.getInverseExactMatchTerms(), anyOf(emptyCollectionOf(TermInfo.class), nullValue())); } -} \ No newline at end of file +} diff --git a/src/test/java/cz/cvut/kbss/termit/util/AuthenticatingServletRequestWrapperTest.java b/src/test/java/cz/cvut/kbss/termit/util/AuthenticatingServletRequestWrapperTest.java index 1fdfa680e..fc393dc06 100644 --- a/src/test/java/cz/cvut/kbss/termit/util/AuthenticatingServletRequestWrapperTest.java +++ b/src/test/java/cz/cvut/kbss/termit/util/AuthenticatingServletRequestWrapperTest.java @@ -33,7 +33,9 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalToIgnoringCase; import static org.hamcrest.Matchers.startsWith; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; class AuthenticatingServletRequestWrapperTest { diff --git a/src/test/java/cz/cvut/kbss/termit/util/CsvUtilsTest.java b/src/test/java/cz/cvut/kbss/termit/util/CsvUtilsTest.java index f6dee52dc..b3702b8d6 100644 --- a/src/test/java/cz/cvut/kbss/termit/util/CsvUtilsTest.java +++ b/src/test/java/cz/cvut/kbss/termit/util/CsvUtilsTest.java @@ -19,7 +19,7 @@ import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; class CsvUtilsTest { @@ -47,4 +47,4 @@ void sanitizeStringDuplicatesDoubleQuotesInString() { final String result = CsvUtils.sanitizeString(input); assertEquals("\"This string needs \"\"escaping\"\"\"", result); } -} \ No newline at end of file +} diff --git a/src/test/java/cz/cvut/kbss/termit/util/UtilsTest.java b/src/test/java/cz/cvut/kbss/termit/util/UtilsTest.java index 6473c6a09..64d939e6c 100644 --- a/src/test/java/cz/cvut/kbss/termit/util/UtilsTest.java +++ b/src/test/java/cz/cvut/kbss/termit/util/UtilsTest.java @@ -37,7 +37,12 @@ import org.locationtech.jts.util.Assert; import org.mockito.Mockito; -import java.util.*; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashSet; +import java.util.Optional; +import java.util.Set; import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; diff --git a/src/test/java/cz/cvut/kbss/termit/validation/MultilingualStringPrimaryNotBlankValidatorTest.java b/src/test/java/cz/cvut/kbss/termit/validation/MultilingualStringPrimaryNotBlankValidatorTest.java index eff40f102..f5cca5cd1 100644 --- a/src/test/java/cz/cvut/kbss/termit/validation/MultilingualStringPrimaryNotBlankValidatorTest.java +++ b/src/test/java/cz/cvut/kbss/termit/validation/MultilingualStringPrimaryNotBlankValidatorTest.java @@ -19,6 +19,7 @@ import cz.cvut.kbss.jopa.model.MultilingualString; import cz.cvut.kbss.termit.util.Configuration; +import jakarta.validation.ConstraintValidatorContext; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Answers; @@ -26,8 +27,6 @@ import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; -import jakarta.validation.ConstraintValidatorContext; - import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.Mockito.when; diff --git a/src/test/java/cz/cvut/kbss/termit/workspace/EditableVocabulariesTest.java b/src/test/java/cz/cvut/kbss/termit/workspace/EditableVocabulariesTest.java index 5ae9b734a..43243539b 100644 --- a/src/test/java/cz/cvut/kbss/termit/workspace/EditableVocabulariesTest.java +++ b/src/test/java/cz/cvut/kbss/termit/workspace/EditableVocabulariesTest.java @@ -31,7 +31,9 @@ import java.net.URI; import java.util.Set; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; class EditableVocabulariesTest {