Skip to content

Commit 8b7068c

Browse files
authored
Merge pull request #5 from MicroFocus/luiza_defect_1107461_skipped_added_to_need_attention
Luiza defect 1107461 skipped added to need attention group
2 parents f4107bf + 001882c commit 8b7068c

File tree

3 files changed

+20
-8
lines changed

3 files changed

+20
-8
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<modelVersion>4.0.0</modelVersion>
88
<groupId>com.microfocus.octane.plugins</groupId>
99
<artifactId>jira-octane-quality-insight-plugin</artifactId>
10-
<version>1.0.7</version>
10+
<version>1.0.7.1</version>
1111
<organization>
1212
<name>Micro Focus ALM Octane</name>
1313
<url>https://www.microfocus.com/en-us/products/alm-octane/overview</url>

src/main/java/com/microfocus/octane/plugins/configuration/OctaneRestManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ public static GroupEntityCollection getCoverage(SpaceConfiguration sc, OctaneEnt
5151
String queryParam = queryBuilder.build();
5252

5353
String responseStr = sc.getRestConnector().httpGet(url, Arrays.asList(queryParam), headers).getResponseData();
54-
GroupEntityCollection col = OctaneEntityParser.parseGroupCollection(responseStr);
55-
return col;
54+
55+
return OctaneEntityParser.parseGroupCollection(responseStr);
5656
}
5757

5858
public static GroupEntityCollection getNativeStatusCoverageForRunsWithoutStatus(SpaceConfiguration sc, OctaneEntity octaneEntity, OctaneEntityTypeDescriptor typeDescriptor, long workspaceId) {

src/main/java/com/microfocus/octane/plugins/views/CoverageUiHelper.java

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ private static List<MapBasedObject> getCoverageGroups(SpaceConfiguration sc, Oct
9898
Map<String, GroupEntity> statusId2group = coverage.getGroups().stream().filter(gr -> gr.getValue() != null).collect(Collectors.toMap(g -> ((OctaneEntity) g.getValue()).getId(), Function.identity()));
9999
coverage.getGroups().stream().filter(gr -> gr.getValue() == null).findFirst();
100100

101-
//Octane may return on coverage group without status - it will be assigned to skipped status
102-
//if already skipped group exist - we will add count to it
103-
//if skipped group not exist - we will create new one
101+
//Octane may return on coverage group without status - it will be assigned to need attention status
102+
//if need attention group already exists - we will add count to it
103+
//if need attention group does not exist - we will create new one
104104
Optional<GroupEntity> groupWithoutStatusOpt = coverage.getGroups().stream().filter(gr -> gr.getValue() == null).findFirst();
105105
if (groupWithoutStatusOpt.isPresent()) {
106106
GroupEntityCollection coverageOfRunsWithoutStatus = OctaneRestManager.getNativeStatusCoverageForRunsWithoutStatus(sc, octaneEntity, typeDescriptor, workspaceId);
@@ -113,11 +113,16 @@ private static List<MapBasedObject> getCoverageGroups(SpaceConfiguration sc, Oct
113113
appendCountToExistingGroupOrCreateNewOne(statusId2group, convertedStatus, gr.getCount());
114114
});
115115
} else {
116-
//if we receive different numbers -> put all not-statused items to skipped
117-
appendCountToExistingGroupOrCreateNewOne(statusId2group, skippedStatus.getLogicalName(), groupWithoutStatusOpt.get().getCount());
116+
//if we receive different numbers -> put all not-statused items to need attention
117+
appendCountToExistingGroupOrCreateNewOne(statusId2group, needAttentionStatus.getLogicalName(), groupWithoutStatusOpt.get().getCount());
118118
}
119119
}
120120

121+
//in order to align with Octane test coverage tooltip
122+
//we add skipped category to requires attention
123+
addSkippedToRequiresAttention(statusId2group);
124+
statusId2group.remove(skippedStatus.getLogicalName());
125+
121126
int total = statusId2group.values().stream().mapToInt(o -> o.getCount()).sum();
122127
List<MapBasedObject> groups = statusId2group.entrySet().stream()
123128
.map(entry -> convertGroupEntityToUiEntity(testStatusDescriptors.get(entry.getKey()), entry.getValue().getCount(), total))
@@ -127,6 +132,13 @@ private static List<MapBasedObject> getCoverageGroups(SpaceConfiguration sc, Oct
127132
return groups;
128133
}
129134

135+
private static void addSkippedToRequiresAttention(Map<String, GroupEntity> statusId2group) {
136+
if (statusId2group.containsKey(skippedStatus.getLogicalName())) {
137+
int skippedCount = statusId2group.get(skippedStatus.getLogicalName()).getCount();
138+
appendCountToExistingGroupOrCreateNewOne(statusId2group, needAttentionStatus.getLogicalName(), skippedCount);
139+
}
140+
}
141+
130142
private static void appendCountToExistingGroupOrCreateNewOne(Map<String, GroupEntity> statusId2group, String groupName, int count) {
131143
if (statusId2group.containsKey(groupName)) {
132144
GroupEntity grEntity = statusId2group.get(groupName);

0 commit comments

Comments
 (0)