summaryrefslogtreecommitdiffstats
path: root/v3po/v3po2vpp/src/test/java
diff options
context:
space:
mode:
authorMarek Gradzki <mgradzki@cisco.com>2016-09-14 14:49:56 +0200
committerMarek Gradzki <mgradzki@cisco.com>2016-09-14 13:07:20 +0000
commit10bdd5c1120d715a838d81892a1da697f3303c5b (patch)
treeee35adc34b7de83cfd8155d43081250e8bfce6c5 /v3po/v3po2vpp/src/test/java
parent451a916cd7d466e7957135418d06e10a79c0c5dc (diff)
Fix ClassifySession read NPE when NodeContext is missing
Change-Id: Ieca5ad125df5f26f82351871a0238e65be3e300c Signed-off-by: Marek Gradzki <mgradzki@cisco.com>
Diffstat (limited to 'v3po/v3po2vpp/src/test/java')
-rw-r--r--v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/VppClassifierContextManagerImplTest.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/VppClassifierContextManagerImplTest.java b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/VppClassifierContextManagerImplTest.java
index cbc0c3802..3e198e002 100644
--- a/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/VppClassifierContextManagerImplTest.java
+++ b/v3po/v3po2vpp/src/test/java/io/fd/honeycomb/translate/v3po/vppclassifier/VppClassifierContextManagerImplTest.java
@@ -120,6 +120,14 @@ public class VppClassifierContextManagerImplTest {
}
@Test
+ public void testGetNodeNameMissingNodeCtx() throws Exception {
+ final ClassifyTableContext tableCtx = table(TABLE_ID_0, TABLE_NAME_0, "aa");
+ when(ctx.read(VPP_CLASSIFIER_CONTEXT_IID)).thenReturn(Optional.of(context(tableCtx)));
+ when(ctx.read(TABLE_IID_0)).thenReturn(Optional.of(tableCtx));
+ assertEquals(Optional.absent(), vppClassfierContext.getNodeName(TABLE_ID_0, 123, ctx));
+ }
+
+ @Test
public void testGetNodeName() throws Exception {
final ClassifyTableContext tableCtx = table(TABLE_ID_0, TABLE_NAME_0, "aa", node("node123", 123));
when(ctx.read(VPP_CLASSIFIER_CONTEXT_IID)).thenReturn(Optional.of(context(tableCtx)));