Conversation
|
|
||
| @Getter(onMethod = @__({@AttributeGetter(value = AttributeType.PROPERTY, targetName = "lifecycleStatus")})) | ||
| @Setter(onMethod = @__({@AttributeSetter(value = AttributeType.PROPERTY, targetName = "lifecycleStatus")})) | ||
| private String lifecycleStatus; |
|
|
||
| @EqualsAndHashCode(callSuper = true) | ||
| @MappingEnabled(entityType = DocumentSpecification.TYPE_DOCUMENT_SPECIFICATION) | ||
| public class DocumentSpecification extends EntityWithId { |
There was a problem hiding this comment.
The object lacks a numer of properties defined in the api. There is no:
- entitySpecRelationship
- specCharacteristic
- tragetEntitySchema
- validFor
| @@ -0,0 +1,783 @@ | |||
| { | |||
There was a problem hiding this comment.
This is not the same file as provided by the OpenAPI(https://tmf-open-api-table-documents.s3.eu-west-1.amazonaws.com/OpenApiTable/TMF667_Document/4.0.0/swagger/TMF667_Document_Management_API_v4.0.0_swagger.json)
Please use the right spec
| .map(att -> processAttachmentForOffload(att, entityId)) | ||
| .collect(Collectors.toList()); | ||
| } | ||
|
|
There was a problem hiding this comment.
Public methods should be properly documented
|
|
||
| @Singleton | ||
| @Slf4j | ||
| public class S3AttachmentService { |
There was a problem hiding this comment.
Please add some class-level doc
| public abstract DocumentSpecificationVO map(DocumentSpecificationCreateVO createVO, URI id); | ||
|
|
||
| @AfterMapping | ||
| protected void afterMapCreateVO(DocumentSpecificationCreateVO source, @MappingTarget DocumentSpecificationVO target) { |
There was a problem hiding this comment.
What is this required for? Its nowhere else used. SchemaLocation should automatically be mapped.
| } | ||
| } | ||
|
|
||
| @Mapping(target = "atSchemaLocation", ignore = true) |
There was a problem hiding this comment.
Why do you ignore the schemaLocation?
|
|
||
| @Test | ||
| void testAttachmentWithNullContent() { | ||
| // Create a mock service that doesn't actually connect to MinIO |
There was a problem hiding this comment.
Where is this mock service? The S3AttachmentService needs to be tested with a mocked connection.
|
|
||
| @Test | ||
| void testAttachmentWithEmptyContent() { | ||
| AttachmentRefOrValue attachment = new AttachmentRefOrValue(); |
There was a problem hiding this comment.
Why do you test auto-generated setters?
|
|
||
| import static org.junit.jupiter.api.Assertions.*; | ||
|
|
||
| class S3AttachmentServiceTest { |
There was a problem hiding this comment.
Please create proper tests for the service. Most of the tests here do not provide any assurance of functionality.
Greetings @wistefan
This is the Document API management feature. I also added the changes to add this to the all-in-one feature recently added.
Best regards