Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
App Blocks
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Genesys PGR
App Blocks
Commits
6f8adc31
Commit
6f8adc31
authored
Sep 19, 2018
by
Matija Obreza
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update javadoc
- JAutodoc headers and members
parent
cabd3831
Changes
118
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
118 changed files
with
917 additions
and
145 deletions
+917
-145
auditlog/src/main/java/org/genesys/blocks/auditlog/annotations/Audited.java
...java/org/genesys/blocks/auditlog/annotations/Audited.java
+1
-1
auditlog/src/main/java/org/genesys/blocks/auditlog/annotations/NotAudited.java
...a/org/genesys/blocks/auditlog/annotations/NotAudited.java
+1
-1
auditlog/src/main/java/org/genesys/blocks/auditlog/component/AuditTrailInterceptor.java
...esys/blocks/auditlog/component/AuditTrailInterceptor.java
+11
-1
auditlog/src/main/java/org/genesys/blocks/auditlog/model/AuditAction.java
...n/java/org/genesys/blocks/auditlog/model/AuditAction.java
+1
-1
auditlog/src/main/java/org/genesys/blocks/auditlog/model/AuditLog.java
...main/java/org/genesys/blocks/auditlog/model/AuditLog.java
+1
-1
auditlog/src/main/java/org/genesys/blocks/auditlog/model/TransactionAuditLog.java
...rg/genesys/blocks/auditlog/model/TransactionAuditLog.java
+1
-1
auditlog/src/main/java/org/genesys/blocks/auditlog/model/filters/AuditLogFilter.java
...genesys/blocks/auditlog/model/filters/AuditLogFilter.java
+1
-1
auditlog/src/main/java/org/genesys/blocks/auditlog/persistence/AuditLogCustomRepository.java
...blocks/auditlog/persistence/AuditLogCustomRepository.java
+3
-3
auditlog/src/main/java/org/genesys/blocks/auditlog/persistence/AuditLogRepository.java
...nesys/blocks/auditlog/persistence/AuditLogRepository.java
+1
-1
auditlog/src/main/java/org/genesys/blocks/auditlog/persistence/AuditLogRepositoryCustomImpl.java
...ks/auditlog/persistence/AuditLogRepositoryCustomImpl.java
+1
-1
auditlog/src/main/java/org/genesys/blocks/auditlog/service/AuditTrailService.java
...rg/genesys/blocks/auditlog/service/AuditTrailService.java
+1
-1
auditlog/src/main/java/org/genesys/blocks/auditlog/service/ClassPKService.java
...a/org/genesys/blocks/auditlog/service/ClassPKService.java
+1
-1
auditlog/src/main/java/org/genesys/blocks/auditlog/service/impl/AuditTrailServiceImpl.java
...s/blocks/auditlog/service/impl/AuditTrailServiceImpl.java
+1
-1
auditlog/src/main/java/org/genesys/blocks/auditlog/service/impl/ClassPKServiceImpl.java
...esys/blocks/auditlog/service/impl/ClassPKServiceImpl.java
+1
-1
auditlog/src/test/java/org/genesys/blocks/auditlog/component/AuditTrailInterceptorTest.java
.../blocks/auditlog/component/AuditTrailInterceptorTest.java
+12
-1
auditlog/src/test/java/org/genesys/blocks/auditlog/model/AuditLogEntityTest.java
...org/genesys/blocks/auditlog/model/AuditLogEntityTest.java
+10
-1
auditlog/src/test/java/org/genesys/blocks/auditlog/model/ClassPKEntityTest.java
.../org/genesys/blocks/auditlog/model/ClassPKEntityTest.java
+13
-1
auditlog/src/test/java/org/genesys/blocks/auditlog/model/ExampleAuditedEntity.java
...g/genesys/blocks/auditlog/model/ExampleAuditedEntity.java
+44
-1
auditlog/src/test/java/org/genesys/blocks/auditlog/persistence/ExampleAuditedEntityRepository.java
.../auditlog/persistence/ExampleAuditedEntityRepository.java
+1
-1
auditlog/src/test/java/org/genesys/blocks/auditlog/service/AuditTrailServiceTest.java
...enesys/blocks/auditlog/service/AuditTrailServiceTest.java
+31
-1
auditlog/src/test/java/org/genesys/blocks/auditlog/service/ClassPKServiceTest.java
...g/genesys/blocks/auditlog/service/ClassPKServiceTest.java
+19
-2
auditlog/src/test/java/org/genesys/blocks/auditlog/service/ExampleAuditedEntityService.java
.../blocks/auditlog/service/ExampleAuditedEntityService.java
+29
-1
auditlog/src/test/java/org/genesys/blocks/auditlog/service/impl/ExampleAuditedEntityServiceImpl.java
...uditlog/service/impl/ExampleAuditedEntityServiceImpl.java
+4
-1
auditlog/src/test/java/org/genesys/blocks/auditlog/test/ApplicationConfig.java
...a/org/genesys/blocks/auditlog/test/ApplicationConfig.java
+24
-1
auditlog/src/test/java/org/genesys/blocks/auditlog/test/BaseTest.java
.../test/java/org/genesys/blocks/auditlog/test/BaseTest.java
+43
-1
auditlog/src/test/java/org/genesys/blocks/auditlog/test/DatabaseConfig.java
...java/org/genesys/blocks/auditlog/test/DatabaseConfig.java
+44
-1
auditlog/src/test/java/org/genesys/blocks/auditlog/test/EntityTest.java
...est/java/org/genesys/blocks/auditlog/test/EntityTest.java
+16
-1
auditlog/src/test/java/org/genesys/blocks/auditlog/test/ServiceTest.java
...st/java/org/genesys/blocks/auditlog/test/ServiceTest.java
+7
-1
core/src/main/java/org/genesys/blocks/model/Activatable.java
core/src/main/java/org/genesys/blocks/model/Activatable.java
+1
-1
core/src/main/java/org/genesys/blocks/model/AuditedVersionedModel.java
.../java/org/genesys/blocks/model/AuditedVersionedModel.java
+1
-1
core/src/main/java/org/genesys/blocks/model/AuditedVersionedModelWithoutId.java
.../genesys/blocks/model/AuditedVersionedModelWithoutId.java
+1
-1
core/src/main/java/org/genesys/blocks/model/BasicModel.java
core/src/main/java/org/genesys/blocks/model/BasicModel.java
+1
-1
core/src/main/java/org/genesys/blocks/model/ClassPK.java
core/src/main/java/org/genesys/blocks/model/ClassPK.java
+1
-1
core/src/main/java/org/genesys/blocks/model/Copyable.java
core/src/main/java/org/genesys/blocks/model/Copyable.java
+1
-1
core/src/main/java/org/genesys/blocks/model/DefaultModelConstants.java
.../java/org/genesys/blocks/model/DefaultModelConstants.java
+1
-1
core/src/main/java/org/genesys/blocks/model/EntityId.java
core/src/main/java/org/genesys/blocks/model/EntityId.java
+1
-1
core/src/main/java/org/genesys/blocks/model/IdUUID.java
core/src/main/java/org/genesys/blocks/model/IdUUID.java
+1
-1
core/src/main/java/org/genesys/blocks/model/InMemoryIdGenerator.java
...in/java/org/genesys/blocks/model/InMemoryIdGenerator.java
+1
-1
core/src/main/java/org/genesys/blocks/model/JsonViews.java
core/src/main/java/org/genesys/blocks/model/JsonViews.java
+3
-3
core/src/main/java/org/genesys/blocks/model/Publishable.java
core/src/main/java/org/genesys/blocks/model/Publishable.java
+1
-1
core/src/main/java/org/genesys/blocks/model/SelfCleaning.java
.../src/main/java/org/genesys/blocks/model/SelfCleaning.java
+3
-0
core/src/main/java/org/genesys/blocks/model/UuidModel.java
core/src/main/java/org/genesys/blocks/model/UuidModel.java
+1
-1
core/src/main/java/org/genesys/blocks/model/VersionedModel.java
...rc/main/java/org/genesys/blocks/model/VersionedModel.java
+2
-1
core/src/main/java/org/genesys/blocks/model/VersionedModelWithoutId.java
...ava/org/genesys/blocks/model/VersionedModelWithoutId.java
+1
-1
core/src/main/java/org/genesys/blocks/model/filters/AuditedVersionedModelFilter.java
...sys/blocks/model/filters/AuditedVersionedModelFilter.java
+3
-0
core/src/main/java/org/genesys/blocks/model/filters/DateFilter.java
...ain/java/org/genesys/blocks/model/filters/DateFilter.java
+1
-1
core/src/main/java/org/genesys/blocks/model/filters/NumberFilter.java
...n/java/org/genesys/blocks/model/filters/NumberFilter.java
+1
-1
core/src/main/java/org/genesys/blocks/model/filters/StringFilter.java
...n/java/org/genesys/blocks/model/filters/StringFilter.java
+1
-1
core/src/main/java/org/genesys/blocks/model/filters/UuidModelFilter.java
...ava/org/genesys/blocks/model/filters/UuidModelFilter.java
+3
-0
core/src/main/java/org/genesys/blocks/model/filters/VersionedModelFilter.java
...rg/genesys/blocks/model/filters/VersionedModelFilter.java
+3
-0
core/src/main/java/org/genesys/blocks/persistence/ClassPKRepository.java
...ava/org/genesys/blocks/persistence/ClassPKRepository.java
+1
-1
core/src/main/java/org/genesys/blocks/util/BetterHSQLDialect.java
.../main/java/org/genesys/blocks/util/BetterHSQLDialect.java
+1
-1
core/src/main/java/org/genesys/blocks/util/JsonClassNameWriter.java
...ain/java/org/genesys/blocks/util/JsonClassNameWriter.java
+1
-1
core/src/test/java/org/genesys/blocks/config/ApplicationConfig.java
...est/java/org/genesys/blocks/config/ApplicationConfig.java
+14
-1
core/src/test/java/org/genesys/blocks/config/DatabaseConfig.java
...c/test/java/org/genesys/blocks/config/DatabaseConfig.java
+33
-1
core/src/test/java/org/genesys/blocks/model/UuidEntity.java
core/src/test/java/org/genesys/blocks/model/UuidEntity.java
+14
-1
core/src/test/java/org/genesys/blocks/model/VersionedEntity.java
...c/test/java/org/genesys/blocks/model/VersionedEntity.java
+14
-1
core/src/test/java/org/genesys/blocks/persistence/UuidEntityRepository.java
.../org/genesys/blocks/persistence/UuidEntityRepository.java
+4
-1
core/src/test/java/org/genesys/blocks/persistence/VersionedEntityRepository.java
...genesys/blocks/persistence/VersionedEntityRepository.java
+4
-1
core/src/test/java/org/genesys/blocks/tests/BaseTest.java
core/src/test/java/org/genesys/blocks/tests/BaseTest.java
+10
-1
core/src/test/java/org/genesys/blocks/tests/ServiceTest.java
core/src/test/java/org/genesys/blocks/tests/ServiceTest.java
+6
-1
core/src/test/java/org/genesys/blocks/tests/model/CopyableTest.java
...est/java/org/genesys/blocks/tests/model/CopyableTest.java
+7
-1
core/src/test/java/org/genesys/blocks/tests/model/UuidModelTest.java
...st/java/org/genesys/blocks/tests/model/UuidModelTest.java
+21
-1
core/src/test/java/org/genesys/blocks/tests/model/VersionedModelTest.java
...va/org/genesys/blocks/tests/model/VersionedModelTest.java
+21
-1
pom.xml
pom.xml
+1
-1
security/src/main/java/org/genesys/blocks/oauth/model/AccessToken.java
...main/java/org/genesys/blocks/oauth/model/AccessToken.java
+1
-1
security/src/main/java/org/genesys/blocks/oauth/model/OAuthClient.java
...main/java/org/genesys/blocks/oauth/model/OAuthClient.java
+34
-1
security/src/main/java/org/genesys/blocks/oauth/model/OAuthRole.java
...c/main/java/org/genesys/blocks/oauth/model/OAuthRole.java
+3
-2
security/src/main/java/org/genesys/blocks/oauth/model/RefreshToken.java
...ain/java/org/genesys/blocks/oauth/model/RefreshToken.java
+1
-1
security/src/main/java/org/genesys/blocks/oauth/persistence/AccessTokenRepository.java
...nesys/blocks/oauth/persistence/AccessTokenRepository.java
+1
-1
security/src/main/java/org/genesys/blocks/oauth/persistence/RefreshTokenRepository.java
...esys/blocks/oauth/persistence/RefreshTokenRepository.java
+1
-1
security/src/main/java/org/genesys/blocks/oauth/service/OAuthServiceImpl.java
...va/org/genesys/blocks/oauth/service/OAuthServiceImpl.java
+2
-1
security/src/main/java/org/genesys/blocks/oauth/service/OAuthTokenStoreService.java
.../genesys/blocks/oauth/service/OAuthTokenStoreService.java
+1
-1
security/src/main/java/org/genesys/blocks/oauth/util/AppBlocksInitializer.java
...a/org/genesys/blocks/oauth/util/AppBlocksInitializer.java
+3
-2
security/src/main/java/org/genesys/blocks/security/NoUserFoundException.java
...ava/org/genesys/blocks/security/NoUserFoundException.java
+1
-1
security/src/main/java/org/genesys/blocks/security/NotUniqueUserException.java
...a/org/genesys/blocks/security/NotUniqueUserException.java
+1
-1
security/src/main/java/org/genesys/blocks/security/SecurityContextUtil.java
...java/org/genesys/blocks/security/SecurityContextUtil.java
+4
-2
security/src/main/java/org/genesys/blocks/security/SpringSecurityAuditorAware.java
...g/genesys/blocks/security/SpringSecurityAuditorAware.java
+1
-1
security/src/main/java/org/genesys/blocks/security/UserException.java
.../main/java/org/genesys/blocks/security/UserException.java
+1
-1
security/src/main/java/org/genesys/blocks/security/component/AclAssignerAspect.java
.../genesys/blocks/security/component/AclAssignerAspect.java
+1
-1
security/src/main/java/org/genesys/blocks/security/component/Slf4jLogAuditLogger.java
...enesys/blocks/security/component/Slf4jLogAuditLogger.java
+1
-1
security/src/main/java/org/genesys/blocks/security/lockout/AccountLockoutConfig.java
...genesys/blocks/security/lockout/AccountLockoutConfig.java
+1
-1
security/src/main/java/org/genesys/blocks/security/lockout/AccountLockoutManager.java
...enesys/blocks/security/lockout/AccountLockoutManager.java
+1
-1
security/src/main/java/org/genesys/blocks/security/lockout/AuthenticationFailureBadCredentialsListener.java
.../lockout/AuthenticationFailureBadCredentialsListener.java
+1
-1
security/src/main/java/org/genesys/blocks/security/lockout/AuthenticationSuccessListener.java
...locks/security/lockout/AuthenticationSuccessListener.java
+1
-1
security/src/main/java/org/genesys/blocks/security/model/AclClass.java
...main/java/org/genesys/blocks/security/model/AclClass.java
+1
-1
security/src/main/java/org/genesys/blocks/security/model/AclEntry.java
...main/java/org/genesys/blocks/security/model/AclEntry.java
+1
-1
security/src/main/java/org/genesys/blocks/security/model/AclObjectIdentity.java
.../org/genesys/blocks/security/model/AclObjectIdentity.java
+1
-1
security/src/main/java/org/genesys/blocks/security/model/AclSid.java
...c/main/java/org/genesys/blocks/security/model/AclSid.java
+3
-3
security/src/main/java/org/genesys/blocks/security/model/BasicUser.java
...ain/java/org/genesys/blocks/security/model/BasicUser.java
+5
-1
security/src/main/java/org/genesys/blocks/security/persistence/AclClassPersistence.java
...esys/blocks/security/persistence/AclClassPersistence.java
+1
-1
security/src/main/java/org/genesys/blocks/security/persistence/AclEntryPersistence.java
...esys/blocks/security/persistence/AclEntryPersistence.java
+5
-5
security/src/main/java/org/genesys/blocks/security/persistence/AclObjectIdentityPersistence.java
...ks/security/persistence/AclObjectIdentityPersistence.java
+1
-1
security/src/main/java/org/genesys/blocks/security/persistence/AclSidPersistence.java
...enesys/blocks/security/persistence/AclSidPersistence.java
+2
-2
security/src/main/java/org/genesys/blocks/security/serialization/AclEntriesToPermissions.java
...locks/security/serialization/AclEntriesToPermissions.java
+1
-1
security/src/main/java/org/genesys/blocks/security/serialization/CurrentPermissionsWriter.java
...ocks/security/serialization/CurrentPermissionsWriter.java
+1
-1
security/src/main/java/org/genesys/blocks/security/serialization/Permissions.java
...rg/genesys/blocks/security/serialization/Permissions.java
+8
-8
security/src/main/java/org/genesys/blocks/security/serialization/SidPermissions.java
...genesys/blocks/security/serialization/SidPermissions.java
+5
-5
security/src/main/java/org/genesys/blocks/security/service/PasswordPolicy.java
...a/org/genesys/blocks/security/service/PasswordPolicy.java
+1
-1
security/src/main/java/org/genesys/blocks/security/service/impl/SimplePasswordPolicy.java
...ys/blocks/security/service/impl/SimplePasswordPolicy.java
+1
-1
security/src/main/java/org/genesys/blocks/util/CurrentApplicationContext.java
...va/org/genesys/blocks/util/CurrentApplicationContext.java
+5
-4
security/src/test/java/org/genesys/blocks/oauth/OAuth2GrantTypeTest.java
...st/java/org/genesys/blocks/oauth/OAuth2GrantTypeTest.java
+13
-1
security/src/test/java/org/genesys/blocks/oauth/OAuthClientTest.java
...c/test/java/org/genesys/blocks/oauth/OAuthClientTest.java
+18
-1
security/src/test/java/org/genesys/blocks/security/component/AclAssignerTest.java
...rg/genesys/blocks/security/component/AclAssignerTest.java
+28
-1
security/src/test/java/org/genesys/blocks/security/config/ApplicationConfig.java
...org/genesys/blocks/security/config/ApplicationConfig.java
+23
-1
security/src/test/java/org/genesys/blocks/security/config/AuthorizationServerConfig.java
...sys/blocks/security/config/AuthorizationServerConfig.java
+3
-1
security/src/test/java/org/genesys/blocks/security/config/DatabaseConfig.java
...va/org/genesys/blocks/security/config/DatabaseConfig.java
+38
-1
security/src/test/java/org/genesys/blocks/security/config/SecurityConfig.java
...va/org/genesys/blocks/security/config/SecurityConfig.java
+8
-1
security/src/test/java/org/genesys/blocks/security/model/AclEntity.java
...est/java/org/genesys/blocks/security/model/AclEntity.java
+12
-2
security/src/test/java/org/genesys/blocks/security/model/TestUser.java
...test/java/org/genesys/blocks/security/model/TestUser.java
+4
-1
security/src/test/java/org/genesys/blocks/security/model/UserRole.java
...test/java/org/genesys/blocks/security/model/UserRole.java
+35
-2
security/src/test/java/org/genesys/blocks/security/persistence/AclEntityPersistence.java
...sys/blocks/security/persistence/AclEntityPersistence.java
+10
-1
security/src/test/java/org/genesys/blocks/security/persistence/TestUserPersistence.java
...esys/blocks/security/persistence/TestUserPersistence.java
+10
-1
security/src/test/java/org/genesys/blocks/security/rest/AbstractRestTest.java
...va/org/genesys/blocks/security/rest/AbstractRestTest.java
+11
-1
security/src/test/java/org/genesys/blocks/security/test/BaseTest.java
.../test/java/org/genesys/blocks/security/test/BaseTest.java
+20
-1
security/src/test/java/org/genesys/blocks/security/test/BasicUserServiceTest.java
...rg/genesys/blocks/security/test/BasicUserServiceTest.java
+38
-1
security/src/test/java/org/genesys/blocks/security/test/PermissionsTest.java
...ava/org/genesys/blocks/security/test/PermissionsTest.java
+29
-1
security/src/test/java/org/genesys/blocks/security/test/ServiceTest.java
...st/java/org/genesys/blocks/security/test/ServiceTest.java
+6
-1
No files found.
auditlog/src/main/java/org/genesys/blocks/auditlog/annotations/Audited.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
auditlog/src/main/java/org/genesys/blocks/auditlog/annotations/NotAudited.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
auditlog/src/main/java/org/genesys/blocks/auditlog/component/AuditTrailInterceptor.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -771,6 +771,16 @@ public class AuditTrailInterceptor extends EmptyInterceptor implements Initializ
}
}
/**
* Try method.
*
* @param entity the entity
* @param methodName the method name
* @return the boolean
* @throws NoSuchMethodException the no such method exception
* @throws IllegalAccessException the illegal access exception
* @throws InvocationTargetException the invocation target exception
*/
public
Boolean
tryMethod
(
final
Object
entity
,
final
String
methodName
)
throws
NoSuchMethodException
,
IllegalAccessException
,
InvocationTargetException
{
final
Method
getter
=
entity
.
getClass
().
getMethod
(
methodName
);
if
(
getter
!=
null
)
{
...
...
auditlog/src/main/java/org/genesys/blocks/auditlog/model/AuditAction.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
auditlog/src/main/java/org/genesys/blocks/auditlog/model/AuditLog.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
auditlog/src/main/java/org/genesys/blocks/auditlog/model/TransactionAuditLog.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
auditlog/src/main/java/org/genesys/blocks/auditlog/model/filters/AuditLogFilter.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
auditlog/src/main/java/org/genesys/blocks/auditlog/persistence/AuditLogCustomRepository.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -64,8 +64,8 @@ public interface AuditLogCustomRepository {
Page
<
AuditLog
>
listAuditLogs
(
AuditLogFilter
filters
,
Pageable
page
);
/**
* Load entity from database by classname and id
*
* Load entity from database by classname and id
.
*
* @param classPk classPK of the entity
* @param id the internal database id of the entity
* @return the persisted entity of type classPk
...
...
auditlog/src/main/java/org/genesys/blocks/auditlog/persistence/AuditLogRepository.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
auditlog/src/main/java/org/genesys/blocks/auditlog/persistence/AuditLogRepositoryCustomImpl.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
auditlog/src/main/java/org/genesys/blocks/auditlog/service/AuditTrailService.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
auditlog/src/main/java/org/genesys/blocks/auditlog/service/ClassPKService.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
auditlog/src/main/java/org/genesys/blocks/auditlog/service/impl/AuditTrailServiceImpl.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
auditlog/src/main/java/org/genesys/blocks/auditlog/service/impl/ClassPKServiceImpl.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
auditlog/src/test/java/org/genesys/blocks/auditlog/component/AuditTrailInterceptorTest.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -26,7 +26,12 @@ import java.util.stream.Stream;
import
org.genesys.blocks.auditlog.annotations.Audited
;
import
org.junit.Test
;
/**
* The Class AuditTrailInterceptorTest.
*/
public
class
AuditTrailInterceptorTest
{
/** The audit trail interceptor. */
AuditTrailInterceptor
auditTrailInterceptor
=
new
AuditTrailInterceptor
();
private
abstract
class
AbstractSuperClass
{
...
...
@@ -61,6 +66,9 @@ public class AuditTrailInterceptorTest {
auditTrailInterceptor
.
setAuditedClasses
(
Stream
.
of
(
AbstractSuperClass
.
class
,
SuperInterface
.
class
,
StandaloneClass
.
class
).
collect
(
Collectors
.
toSet
()));
}
/**
* Test primitive types.
*/
@Test
public
void
testPrimitiveTypes
()
{
assertThat
(
auditTrailInterceptor
.
isPrimitiveType
(
Long
.
class
),
is
(
true
));
...
...
@@ -80,6 +88,9 @@ public class AuditTrailInterceptorTest {
assertThat
(
auditTrailInterceptor
.
isPrimitiveType
(
UUID
.
class
),
is
(
true
));
}
/**
* Test audited.
*/
@Test
public
void
testAudited
()
{
for
(
int
i
=
0
;
i
<
10
;
i
++)
{
...
...
auditlog/src/test/java/org/genesys/blocks/auditlog/model/AuditLogEntityTest.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -31,6 +31,9 @@ import org.junit.Test;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.dao.DataIntegrityViolationException
;
/**
* The Class AuditLogEntityTest.
*/
public
class
AuditLogEntityTest
extends
EntityTest
<
AuditLog
,
AuditLogRepository
>
{
@Autowired
...
...
@@ -44,11 +47,17 @@ public class AuditLogEntityTest extends EntityTest<AuditLog, AuditLogRepository>
assertThat
(
repository
.
count
(),
is
(
0
l
));
}
/**
* Fail persist.
*/
@Test
(
expected
=
DataIntegrityViolationException
.
class
)
public
void
failPersist
()
{
repository
.
save
(
new
AuditLog
());
}
/**
* Successful persist.
*/
@Test
public
void
successfulPersist
()
{
final
AuditLog
log
=
makeDefault
();
...
...
auditlog/src/test/java/org/genesys/blocks/auditlog/model/ClassPKEntityTest.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -24,6 +24,9 @@ import org.genesys.blocks.persistence.ClassPKRepository;
import
org.junit.Test
;
import
org.springframework.dao.DataIntegrityViolationException
;
/**
* The Class ClassPKEntityTest.
*/
public
class
ClassPKEntityTest
extends
EntityTest
<
ClassPK
,
ClassPKRepository
>
{
@Override
...
...
@@ -33,17 +36,26 @@ public class ClassPKEntityTest extends EntityTest<ClassPK, ClassPKRepository> {
repository
.
deleteAll
();
}
/**
* Fail persist.
*/
@Test
(
expected
=
DataIntegrityViolationException
.
class
)
public
void
failPersist
()
{
repository
.
save
(
new
ClassPK
());
}
/**
* Fail duplicate.
*/
@Test
(
expected
=
DataIntegrityViolationException
.
class
)
public
void
failDuplicate
()
{
repository
.
save
(
makeClassPK
(
Long
.
class
));
repository
.
save
(
makeClassPK
(
Long
.
class
));
}
/**
* Successful persist.
*/
@Test
public
void
successfulPersist
()
{
final
ClassPK
cpk
=
repository
.
save
(
makeClassPK
(
Long
.
class
));
...
...
auditlog/src/test/java/org/genesys/blocks/auditlog/model/ExampleAuditedEntity.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -31,6 +31,9 @@ import javax.persistence.Table;
import
org.genesys.blocks.auditlog.annotations.Audited
;
import
org.genesys.blocks.model.BasicModel
;
/**
* The Class ExampleAuditedEntity.
*/
@Entity
@Table
(
name
=
"exampleauditedentity"
)
@Audited
...
...
@@ -54,34 +57,74 @@ public class ExampleAuditedEntity extends BasicModel {
@CollectionTable
(
name
=
"entity_set"
,
joinColumns
=
@JoinColumn
(
name
=
"entityId"
,
referencedColumnName
=
"id"
))
private
Set
<
String
>
set
;
/**
* Gets the name.
*
* @return the name
*/
public
String
getName
()
{
return
name
;
}
/**
* Sets the name.
*
* @param name the new name
*/
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
/**
* Sets the reference.
*
* @param refEntity the new reference
*/
public
void
setReference
(
ExampleAuditedEntity
refEntity
)
{
this
.
reference
=
refEntity
;
}
/**
* Gets the reference.
*
* @return the reference
*/
public
ExampleAuditedEntity
getReference
()
{
return
reference
;
}
/**
* Gets the list.
*
* @return the list
*/
public
List
<
Long
>
getList
()
{
return
list
;
}
/**
* Sets the list.
*
* @param list the new list
*/
public
void
setList
(
List
<
Long
>
list
)
{
this
.
list
=
list
;
}
/**
* Gets the sets the.
*
* @return the sets the
*/
public
Set
<
String
>
getSet
()
{
return
set
;
}
/**
* Sets the sets the.
*
* @param set the new sets the
*/
public
void
setSet
(
Set
<
String
>
set
)
{
this
.
set
=
set
;
}
...
...
auditlog/src/test/java/org/genesys/blocks/auditlog/persistence/ExampleAuditedEntityRepository.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
auditlog/src/test/java/org/genesys/blocks/auditlog/service/AuditTrailServiceTest.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -37,6 +37,9 @@ import org.junit.Test;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.dao.DataIntegrityViolationException
;
/**
* The Class AuditTrailServiceTest.
*/
public
class
AuditTrailServiceTest
extends
ServiceTest
{
@Autowired
...
...
@@ -57,6 +60,9 @@ public class AuditTrailServiceTest extends ServiceTest {
auditLogRepository
.
deleteAll
();
}
/**
* Save 1.
*/
@Test
public
void
save1
()
{
final
Long
entity
=
new
Long
(
42
);
...
...
@@ -71,6 +77,9 @@ public class AuditTrailServiceTest extends ServiceTest {
assertThat
(
log
.
getReferencedEntity
(),
nullValue
());
}
/**
* Save ref ent.
*/
@Test
public
void
saveRefEnt
()
{
final
Long
entity
=
new
Long
(
42
);
...
...
@@ -86,6 +95,9 @@ public class AuditTrailServiceTest extends ServiceTest {
assertThat
(
log
.
getReferencedEntity
(),
equalTo
(
classPkService
.
getClassPk
(
AuditLog
.
class
)));
}
/**
* Test example audited entity.
*/
@Test
public
void
testExampleAuditedEntity
()
{
ExampleAuditedEntity
entity
=
new
ExampleAuditedEntity
();
...
...
@@ -100,6 +112,9 @@ public class AuditTrailServiceTest extends ServiceTest {
assertThat
(
listAuditLogs
(
entity
),
hasSize
(
1
));
}
/**
* Test transactional list query.
*/
@Test
public
void
testTransactionalListQuery
()
{
ExampleAuditedEntity
entity
=
exampleAuditedEntityService
.
testList
();
...
...
@@ -115,6 +130,9 @@ public class AuditTrailServiceTest extends ServiceTest {
assertThat
(
lastLog
.
getNewState
(),
is
(
entity
.
getName
()));
}
/**
* Test delete.
*/
@Test
public
void
testDelete
()
{
ExampleAuditedEntity
entity
=
exampleAuditedEntityService
.
testList
();
...
...
@@ -131,6 +149,9 @@ public class AuditTrailServiceTest extends ServiceTest {
assertThat
(
lastLog
.
getPreviousState
(),
is
(
entity
.
getName
()));
}
/**
* Test rollback.
*/
@Test
public
void
testRollback
()
{
ExampleAuditedEntity
entity
=
new
ExampleAuditedEntity
();
...
...
@@ -153,6 +174,9 @@ public class AuditTrailServiceTest extends ServiceTest {
}
}
/**
* Test load referenced entity.
*/
@Test
public
void
testLoadReferencedEntity
()
{
ExampleAuditedEntity
entity
=
new
ExampleAuditedEntity
();
...
...
@@ -169,6 +193,9 @@ public class AuditTrailServiceTest extends ServiceTest {
assertThat
(((
ExampleAuditedEntity
)
lookup
).
getId
(),
is
(
entity
.
getId
()));
}
/**
* Test referenced entity audit log.
*/
@Test
public
void
testReferencedEntityAuditLog
()
{
ExampleAuditedEntity
refEntity
=
new
ExampleAuditedEntity
();
...
...
@@ -191,6 +218,9 @@ public class AuditTrailServiceTest extends ServiceTest {
assertThat
(((
ExampleAuditedEntity
)
listAuditLogs
(
entity
).
get
(
0
).
getNewEntity
()).
getId
(),
is
(
refEntity
.
getId
()));
}
/**
* Test embedded collections.
*/
@Test
public
void
testEmbeddedCollections
()
{
ExampleAuditedEntity
entity
=
new
ExampleAuditedEntity
();
...
...
auditlog/src/test/java/org/genesys/blocks/auditlog/service/ClassPKServiceTest.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -24,6 +24,9 @@ import org.genesys.blocks.auditlog.test.ServiceTest;
import
org.genesys.blocks.model.ClassPK
;
import
org.junit.Test
;
/**
* The Class ClassPKServiceTest.
*/
public
class
ClassPKServiceTest
extends
ServiceTest
{
@Override
...
...
@@ -33,6 +36,9 @@ public class ClassPKServiceTest extends ServiceTest {
classPkRepository
.
deleteAll
();
}
/**
* Auto create.
*/
@Test
public
void
autoCreate
()
{
final
ClassPK
cpk
=
classPkService
.
getClassPk
(
Long
.
class
);
...
...
@@ -40,6 +46,11 @@ public class ClassPKServiceTest extends ServiceTest {
assertThat
(
cpk
.
getClassname
(),
equalTo
(
Long
.
class
.
getName
()));
}
/**
* Gets the existing.
*
* @return the existing
*/
@Test
public
void
getExisting
()
{
final
ClassPK
cpk
=
classPkService
.
getClassPk
(
Long
.
class
);
...
...
@@ -51,6 +62,9 @@ public class ClassPKServiceTest extends ServiceTest {
assertThat
(
cpk
.
getId
(),
equalTo
(
cpk2
.
getId
()));
}
/**
* Test get class pk id.
*/
@Test
public
void
testGetClassPkId
()
{
final
ClassPK
cpk
=
classPkService
.
getClassPk
(
Long
.
class
);
...
...
@@ -61,6 +75,9 @@ public class ClassPKServiceTest extends ServiceTest {
assertThat
(
id
,
equalTo
(
cpk
.
getId
()));
}
/**
* Test create class pk id.
*/
@Test
public
void
testCreateClassPkId
()
{
final
Long
id
=
classPkService
.
getClassPkId
(
Long
.
class
.
getName
());
...
...
@@ -73,7 +90,7 @@ public class ClassPKServiceTest extends ServiceTest {
}
/**
* Test that classPk is not created for classnames that don't exist
* Test that classPk is not created for classnames that don't exist
.
*/
@Test
public
void
testNoCreateClassPkForCNFE
()
{
...
...
auditlog/src/test/java/org/genesys/blocks/auditlog/service/ExampleAuditedEntityService.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -18,11 +18,39 @@ package org.genesys.blocks.auditlog.service;
import
org.genesys.blocks.auditlog.model.ExampleAuditedEntity
;
/**
* The Interface ExampleAuditedEntityService.
*/
public
interface
ExampleAuditedEntityService
{
/**
* Gets the.
*
* @param id the id
* @return the example audited entity
*/
ExampleAuditedEntity
get
(
Long
id
);
/**
* Save.
*
* @param entity the entity
* @return the example audited entity
*/
ExampleAuditedEntity
save
(
ExampleAuditedEntity
entity
);
/**
* Delete.
*
* @param entity the entity
* @return the example audited entity
*/
ExampleAuditedEntity
delete
(
ExampleAuditedEntity
entity
);
/**
* Test list.
*
* @return the example audited entity
*/
ExampleAuditedEntity
testList
();
}
auditlog/src/test/java/org/genesys/blocks/auditlog/service/impl/ExampleAuditedEntityServiceImpl.java
View file @
6f8adc31
/*
* Copyright 201
7
Global Crop Diversity Trust
* Copyright 201
8
Global Crop Diversity Trust
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -23,6 +23,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
/**
* The Class ExampleAuditedEntityServiceImpl.