Committed by
Gerrit Code Review
Due to type mismatch, test wasn't actually testing the contents of the intent
Change-Id: Iac78d3917ce6287423c4369f22e448b007a6b5e9
Showing
1 changed file
with
4 additions
and
2 deletions
| ... | @@ -96,7 +96,8 @@ public class MplsIntentCompilerTest extends AbstractIntentTest { | ... | @@ -96,7 +96,8 @@ public class MplsIntentCompilerTest extends AbstractIntentTest { |
| 96 | Intent forwardResultIntent = result.get(0); | 96 | Intent forwardResultIntent = result.get(0); |
| 97 | assertThat(forwardResultIntent instanceof MplsPathIntent, is(true)); | 97 | assertThat(forwardResultIntent instanceof MplsPathIntent, is(true)); |
| 98 | 98 | ||
| 99 | - if (forwardResultIntent instanceof MplsIntent) { | 99 | + // if statement suppresses static analysis warnings about unchecked cast |
| 100 | + if (forwardResultIntent instanceof MplsPathIntent) { | ||
| 100 | MplsPathIntent forwardPathIntent = (MplsPathIntent) forwardResultIntent; | 101 | MplsPathIntent forwardPathIntent = (MplsPathIntent) forwardResultIntent; |
| 101 | // 7 links for the hops, plus one default lnk on ingress and egress | 102 | // 7 links for the hops, plus one default lnk on ingress and egress |
| 102 | assertThat(forwardPathIntent.path().links(), hasSize(hops.length + 1)); | 103 | assertThat(forwardPathIntent.path().links(), hasSize(hops.length + 1)); |
| ... | @@ -133,7 +134,8 @@ public class MplsIntentCompilerTest extends AbstractIntentTest { | ... | @@ -133,7 +134,8 @@ public class MplsIntentCompilerTest extends AbstractIntentTest { |
| 133 | Intent reverseResultIntent = result.get(0); | 134 | Intent reverseResultIntent = result.get(0); |
| 134 | assertThat(reverseResultIntent instanceof MplsPathIntent, is(true)); | 135 | assertThat(reverseResultIntent instanceof MplsPathIntent, is(true)); |
| 135 | 136 | ||
| 136 | - if (reverseResultIntent instanceof MplsIntent) { | 137 | + // if statement suppresses static analysis warnings about unchecked cast |
| 138 | + if (reverseResultIntent instanceof MplsPathIntent) { | ||
| 137 | MplsPathIntent reversePathIntent = (MplsPathIntent) reverseResultIntent; | 139 | MplsPathIntent reversePathIntent = (MplsPathIntent) reverseResultIntent; |
| 138 | assertThat(reversePathIntent.path().links(), hasSize(hops.length + 1)); | 140 | assertThat(reversePathIntent.path().links(), hasSize(hops.length + 1)); |
| 139 | assertThat(reversePathIntent.path().links(), linksHasPath("d2", "d1")); | 141 | assertThat(reversePathIntent.path().links(), linksHasPath("d2", "d1")); | ... | ... |
-
Please register or login to post a comment