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

chore: Use UID for event in tracker importer [DHIS2-17790] #19012

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

enricocolasante
Copy link
Contributor

No description provided.

@enricocolasante enricocolasante force-pushed the DHIS2-17790-importer-events branch 3 times, most recently from c0f8066 to e8847d7 Compare November 1, 2024 16:28
}

public Optional<Relationship> findRelationshipByUid(String uid) {
return findById(this.relationships, uid);
}

private static <T extends TrackerDto> Optional<T> findById(List<T> entities, String uid) {
return entities.stream().filter(e -> Objects.equals(e.getUid(), uid)).findFirst();
return entities.stream().filter(e -> Objects.equals(e.getStringUid(), uid)).findFirst();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
TrackerDto.getStringUid
should be avoided because it has been deprecated.
return this.getResolvedStrategyMap().get(dto.getTrackerType()).put(dto.getUid(), strategy);
return this.getResolvedStrategyMap()
.get(dto.getTrackerType())
.put(dto.getStringUid(), strategy);

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
TrackerDto.getStringUid
should be avoided because it has been deprecated.
}

public TrackerImportStrategy getStrategy(TrackerDto dto) {
return getResolvedStrategyMap().get(dto.getTrackerType()).get(dto.getUid());
return getResolvedStrategyMap().get(dto.getTrackerType()).get(dto.getStringUid());

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
TrackerDto.getStringUid
should be avoided because it has been deprecated.
@@ -107,7 +107,7 @@

for (T trackerDto : dtos) {

Entity objectReport = new Entity(getType(), trackerDto.getUid());
Entity objectReport = new Entity(getType(), trackerDto.getStringUid());

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
TrackerDto.getStringUid
should be avoided because it has been deprecated.
@@ -201,7 +202,7 @@
}

private boolean isContained(EnumMap<TrackerType, Set<String>> map, TrackerDto entity) {
return map.get(entity.getTrackerType()).contains(entity.getUid());
return map.get(entity.getTrackerType()).contains(entity.getStringUid());

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note

Invoking
TrackerDto.getStringUid
should be avoided because it has been deprecated.
@@ -567,7 +571,7 @@
private <T extends TrackerDto> Set<String> invalid(List<Entity<T>> entities) {
return entities.stream()
.filter(e -> !e.valid)
.map(e -> e.entity.getUid())
.map(e -> e.entity.getStringUid())

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
TrackerDto.getStringUid
should be avoided because it has been deprecated.
@@ -647,7 +651,7 @@

private static <T extends TrackerDto> List<String> persistableUids(
PersistablesFilter.Result persistable, Class<T> type) {
return persistable.get(type).stream().map(TrackerDto::getUid).toList();
return persistable.get(type).stream().map(TrackerDto::getStringUid).toList();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
TrackerDto.getStringUid
should be avoided because it has been deprecated.
@@ -73,7 +73,7 @@
}

TrackerType type = dto.getTrackerType();
String uid = dto.getUid();
String uid = dto.getStringUid();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
TrackerDto.getStringUid
should be avoided because it has been deprecated.
@@ -132,7 +132,7 @@
TrackerDto dto,
ValidationCode code) {
TrackerType type = dto.getTrackerType();
String uid = dto.getUid();
String uid = dto.getStringUid();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
TrackerDto.getStringUid
should be avoided because it has been deprecated.
@@ -155,7 +155,7 @@
ValidationCode code,
String messageContains) {
TrackerType type = dto.getTrackerType();
String uid = dto.getUid();
String uid = dto.getStringUid();

Check notice

Code scanning / CodeQL

Deprecated method or constructor invocation Note test

Invoking
TrackerDto.getStringUid
should be avoided because it has been deprecated.
Copy link

sonarcloud bot commented Nov 1, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
2 New issues
2 New Code Smells (required ≤ 0)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

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.

1 participant