From 610eb5daf6be4174cf15b11b472a5c44075f11cc Mon Sep 17 00:00:00 2001 From: Tommy Situ Date: Fri, 19 Jul 2019 17:25:13 +0100 Subject: [PATCH] #215 Fix false @ClassRule warning --- .../java/io/specto/hoverfly/junit/rule/HoverflyRuleUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/specto/hoverfly/junit/rule/HoverflyRuleUtils.java b/src/main/java/io/specto/hoverfly/junit/rule/HoverflyRuleUtils.java index 9a0dc054..79cae5c5 100644 --- a/src/main/java/io/specto/hoverfly/junit/rule/HoverflyRuleUtils.java +++ b/src/main/java/io/specto/hoverfly/junit/rule/HoverflyRuleUtils.java @@ -61,7 +61,7 @@ static boolean isAnnotatedWithRule(Description description) { boolean isRule = false; Field[] fields = description.getTestClass().getFields(); for (Field field : fields) { - if (field.getType().isAssignableFrom(HoverflyRule.class) && field.getAnnotation(Rule.class) != null) { + if (field.getType().equals(HoverflyRule.class) && field.getAnnotation(Rule.class) != null) { isRule = true; break; }