fixed SpotBugs JUA_DONT_ASSERT_INSTANCEOF_IN_TESTS

This commit is contained in:
Stefan Spieker committed 2020-12-31 16:01:19 +01:00
1 parent 1e0488f19c
commit 71e689c698
1 file changed
+3 -1
@@ -25,11 +25,13 @@ package jenkins.util.xstream;
import hudson.util.XStream2;
import org.apache.commons.io.IOUtils;
import org.hamcrest.core.IsInstanceOf;
import org.junit.Before;
import org.junit.Test;
import org.xmlunit.diff.DefaultNodeMatcher;
import org.xmlunit.diff.ElementSelectors;
import static org.hamcrest.Matchers.instanceOf;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;
import static org.hamcrest.MatcherAssert.assertThat;
@@ -141,7 +143,7 @@ public class XStreamDOMTest {
v.values.put("foo",createSomeFoo().bar);
String xml = xs.toXML(v);
Object v2 = xs.fromXML(xml);
assertTrue(v2 instanceof DomInMap);
assertThat(v2, instanceOf(DomInMap.class));
assertXStreamDOMEquals(v.values.get("foo"), ((DomInMap)v2).values.get("foo"));
}