Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sonar: This block of commented-out lines of code should be removed #26272

Merged
merged 5 commits into from
May 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -826,14 +826,14 @@ _%>
<%_ if (databaseTypeCouchbase) { _%>
SecurityContextHolder.setContext(TestSecurityContextHolder.getContext());
<%_ } _%>
List<<%= persistClass %>> <%= entityInstance %>List = <%= entityInstance %>Repository.findAll()<%= callListBlock %>;
assertSameRepositoryCount(databaseSizeBeforeCreate);
<%= persistClass %> test<%= entityClass %> = <%= entityInstance %>List.get(<%= entityInstance %>List.size() - 1);

// Validate the id for MapsId, the ids must be same
// Uncomment the following line for assertion. However, please note that there is a known issue and uncommenting will fail the test.
// Please look at https://github.com/jhipster/generator-jhipster/issues/9100. You can modify this test as necessary.
// assertThat(test<%= entityClass %>.get<%= primaryKey.nameCapitalized %>()).isEqualTo(test<%= entityClass %>.get<%= mapsIdEntity %>().get<%= primaryKey.nameCapitalized %>());
/**
* Validate the id for MapsId, the ids must be same
* Uncomment the following line for assertion. However, please note that there is a known issue and uncommenting will fail the test.
* Please look at https://github.com/jhipster/generator-jhipster/issues/9100. You can modify this test as necessary.
* assertThat(test<%= entityClass %>.get<%= primaryKey.nameCapitalized %>()).isEqualTo(test<%= entityClass %>.get<%= mapsIdEntity %>().get<%= primaryKey.nameCapitalized %>());
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if the issue still applies.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mshima I suggest that because VSCode complains with // and not with /* .... */

Before
image

After
image

*/
<%_ if (searchEngineElasticsearch) { _%>
int searchDatabaseSizeAfter = IterableUtil.sizeOf(<%= entityInstance %>SearchRepository.findAll()<%= callListBlock %>);
assertThat(searchDatabaseSizeAfter).isEqualTo(searchDatabaseSizeBefore);
Expand Down
Loading