Skip to content

Add mocks for create/get component#13

Open
valituguran wants to merge 3 commits intodevelopfrom
feature/component-mock-api-service
Open

Add mocks for create/get component#13
valituguran wants to merge 3 commits intodevelopfrom
feature/component-mock-api-service

Conversation

@valituguran
Copy link
Copy Markdown

Add mocks for create/get component and fix REST paths.

@github-actions
Copy link
Copy Markdown

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

this.componentId = componentId;
}

@Override
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove it

}

@Override
public int hashCode() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

remove this method as well

return true;
}

private Map<ComposedId, Component> mockComponentsCache = Collections.synchronizedMap(new HashMap<>());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

avoid to use synchro methods!

Component mockComponent = new Component();
mockComponent.setId(generateNextId());
mockComponent.setName("Mock Component " + mockComponent.getId() + " for project " + projectId);
synchronized (mockComponentsCache) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

avoid to use synchronized blocks!

@Service
@AllArgsConstructor
@Slf4j
public class ComponentMockService implements ExternalService {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

you can name this class ComponentService

@github-actions
Copy link
Copy Markdown

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

@sonarqubecloud
Copy link
Copy Markdown

@github-actions
Copy link
Copy Markdown

📊 Static Analysis Summary

🔍 Code Quality Checks

  • ✅ JaCoCo coverage report generated

📦 Download detailed reports from the workflow artifacts.

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