unbreak unit test

minor test fix
This commit is contained in:
Jonathan Shook 2023-10-17 15:34:59 -05:00
parent ff7d6e1aee
commit c362065c1d

View File

@ -125,13 +125,13 @@ public class MapLabels implements NBLabels {
String rawName = null; String rawName = null;
if (null != bareName) { if (null != bareName) {
rawName = this.labels.get(bareName); rawName = this.labels.get(bareName);
includedNames.remove(bareName);
if (null == rawName) throw new RuntimeException("Unable to get value for key '" + bareName + '\''); if (null == rawName) throw new RuntimeException("Unable to get value for key '" + bareName + '\'');
sb.append(rawName); sb.append(rawName);
} }
if (1 < includedNames.size()) { if (!includedNames.isEmpty()) {
sb.append('{'); sb.append('{');
for (final String includedName : includedNames) { for (final String includedName : includedNames) {
if (includedName.equals(bareName)) continue;
final String includedValue = this.labels.get(includedName); final String includedValue = this.labels.get(includedName);
Objects.requireNonNull(includedValue); Objects.requireNonNull(includedValue);
sb.append(includedName) sb.append(includedName)
@ -139,10 +139,10 @@ public class MapLabels implements NBLabels {
.append(includedValue) .append(includedValue)
.append('"') .append('"')
.append(','); .append(',');
}
sb.setLength(sb.length()-",".length()); sb.setLength(sb.length()-",".length());
sb.append('}'); sb.append('}');
} }
}
return sb.toString(); return sb.toString();
} }