Open kazurayam opened 10 months ago
A sample successful case:
<dd>
<span>{</span>
<span class="ignoring-key">"URL.host":</span>
<span>"myadmin.kazurayam.com"</span>
<span>, </span>
<span>"URL.path":</span>
<span>"/"</span>
<span>, </span>
<span>"URL.protocol":</span>
<span>"http"</span>
<span>, </span>
<span class="ignoring-key">"profile":</span>
<span class="matched-value">"MyAdmin_ProductionEnv"</span>
<span>, </span>
<span>"selector":</span>
<span>"body"</span>
<span>}</span>
</dd>
<span class="ignoring-key">"profile":</span>
will be painted grey.
<span class="matched-value">"MyAdmin_ProductionEnv"</span>
will be painted green.
@Override
public void annotate(final QueryOnMetadata query,
final IgnoreMetadataKeys ignoreMetadataKeys,
final IdentifyMetadataValues identifyMetadataValues) {
Objects.requireNonNull(query);
Objects.requireNonNull(ignoreMetadataKeys);
Objects.requireNonNull(identifyMetadataValues);
Set<String> keys = attributes.keySet();
keys.forEach( key -> {
MetadataAttribute attribute = attributes.get(key);
if (ignoreMetadataKeys.contains(key)) {
attribute.setIgnoredByKey(true);
}
if (canBePaired(query, key)) {
attribute.setPaired(true);
}
if (canBeIdentified(key, identifyMetadataValues)) {
attribute.setIdentifiedByValue(true);
}
//
Matcher m = SemanticVersionPattern.straightMatcher(this.get(key));
if (m.matches()) {
SemanticVersionMatcherResult result = new SemanticVersionMatcherResult(m);
attribute.setSemanticVersionMatcherResult(result);
}
});
}
This is where the ignoredByKey
attribute is set to the QueryOnMetadata object.
I traced the call chain from the MetadataImpl#annotate() up to the MaterialProductGroup#add():
I checked how the MaterialProductGroup#add() is used.
Surprising enough, it is used only by tests. Application is not calling it!
This is the reason why the grey painting is not done.
In the https://github.com/kazurayam/inspectus4selenium-sample-project/blob/0.5.0/src/test/java/com/kazurayam/inspectus/selenium4sample/AppleTwinsDiffTest.java , LINE#90
So these Keys should be painted grey color in the report. But actually not, as the following: