Skip to content

Feat/doc api#130

Open
droslbl wants to merge 3 commits intoFIWARE:mainfrom
droslbl:feat/docApi
Open

Feat/doc api#130
droslbl wants to merge 3 commits intoFIWARE:mainfrom
droslbl:feat/docApi

Conversation

@droslbl
Copy link
Contributor

@droslbl droslbl commented Mar 12, 2026

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


@Getter(onMethod = @__({@AttributeGetter(value = AttributeType.PROPERTY, targetName = "lifecycleStatus")}))
@Setter(onMethod = @__({@AttributeSetter(value = AttributeType.PROPERTY, targetName = "lifecycleStatus")}))
private String lifecycleStatus;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why isnt that an enum?


@EqualsAndHashCode(callSuper = true)
@MappingEnabled(entityType = DocumentSpecification.TYPE_DOCUMENT_SPECIFICATION)
public class DocumentSpecification extends EntityWithId {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The object lacks a numer of properties defined in the api. There is no:

  • entitySpecRelationship
  • specCharacteristic
  • tragetEntitySchema
  • validFor

@@ -0,0 +1,783 @@
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.map(att -> processAttachmentForOffload(att, entityId))
.collect(Collectors.toList());
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public methods should be properly documented


@Singleton
@Slf4j
public class S3AttachmentService {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add some class-level doc

public abstract DocumentSpecificationVO map(DocumentSpecificationCreateVO createVO, URI id);

@AfterMapping
protected void afterMapCreateVO(DocumentSpecificationCreateVO source, @MappingTarget DocumentSpecificationVO target) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this required for? Its nowhere else used. SchemaLocation should automatically be mapped.

}
}

@Mapping(target = "atSchemaLocation", ignore = true)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you ignore the schemaLocation?


@Test
void testAttachmentWithNullContent() {
// Create a mock service that doesn't actually connect to MinIO
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is this mock service? The S3AttachmentService needs to be tested with a mocked connection.


@Test
void testAttachmentWithEmptyContent() {
AttachmentRefOrValue attachment = new AttachmentRefOrValue();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do you test auto-generated setters?


import static org.junit.jupiter.api.Assertions.*;

class S3AttachmentServiceTest {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please create proper tests for the service. Most of the tests here do not provide any assurance of functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants