public void templateIsFoundByTypeOnly() {
TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE)
.build();
- when(nodeTemplate.getMetaData()).thenReturn(metadata);
+ when(nodeTemplate.getMetadata()).thenReturn(metadata);
when(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)).thenReturn(SdcTypes.SERVICE.getValue());
assertTrue(topologyTemplateQuery.isMatchingSearchCriteria(nodeTemplate));
}
public void templateIsNotFoundWhenMetadataIsNull() {
TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.VF)
.build();
- when(nodeTemplate.getMetaData()).thenReturn(null);
+ when(nodeTemplate.getMetadata()).thenReturn(null);
assertFalse(topologyTemplateQuery.isMatchingSearchCriteria(nodeTemplate));
}
public void templateIsFoundIfItIsService() {
TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.SERVICE)
.build();
- when(nodeTemplate.getMetaData()).thenReturn(metadata);
+ when(nodeTemplate.getMetadata()).thenReturn(metadata);
when(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)).thenReturn(SdcTypes.SERVICE.getValue());
assertTrue(topologyTemplateQuery.isMatchingSearchCriteria(nodeTemplate));
}
TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.CVFC)
.customizationUUID("345")
.build();
- when(nodeTemplate.getMetaData()).thenReturn(metadata);
+ when(nodeTemplate.getMetadata()).thenReturn(metadata);
when(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)).thenReturn(SdcTypes.CVFC.getValue());
when(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)).thenReturn("345");
assertTrue(topologyTemplateQuery.isMatchingSearchCriteria(nodeTemplate));
public void templateIsNotFoundWhenTypeIsNotMatchedAndCuuidIsNotSet() {
TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.CVFC)
.build();
- when(nodeTemplate.getMetaData()).thenReturn(metadata);
+ when(nodeTemplate.getMetadata()).thenReturn(metadata);
when(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)).thenReturn(SdcTypes.VF.getValue());
assertFalse(topologyTemplateQuery.isMatchingSearchCriteria(nodeTemplate));
}
TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.VF)
.customizationUUID("2345")
.build();
- when(nodeTemplate.getMetaData()).thenReturn(metadata);
+ when(nodeTemplate.getMetadata()).thenReturn(metadata);
when(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)).thenReturn(null);
when(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)).thenReturn(SdcTypes.VF.getValue());
assertFalse(topologyTemplateQuery.isMatchingSearchCriteria(nodeTemplate));
public void templateIsFoundWhenTypeIsMatchedAndCuuidIsNullInMetadata() {
TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.VF)
.build();
- when(nodeTemplate.getMetaData()).thenReturn(metadata);
+ when(nodeTemplate.getMetadata()).thenReturn(metadata);
when(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)).thenReturn(null);
when(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)).thenReturn(SdcTypes.VF.getValue());
assertTrue(topologyTemplateQuery.isMatchingSearchCriteria(nodeTemplate));
TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.CVFC)
.customizationUUID("345")
.build();
- when(nodeTemplate.getMetaData()).thenReturn(metadata);
+ when(nodeTemplate.getMetadata()).thenReturn(metadata);
when(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)).thenReturn(SdcTypes.CVFC.getValue());
when(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_CUSTOMIZATIONUUID)).thenReturn("345");
assertTrue(topologyTemplateQuery.isMatchingSearchCriteria(nodeTemplate));
TopologyTemplateQuery topologyTemplateQuery = TopologyTemplateQuery.newBuilder(SdcTypes.CR)
.customizationUUID("345")
.build();
- when(nodeTemplate.getMetaData()).thenReturn(metadata);
+ when(nodeTemplate.getMetadata()).thenReturn(metadata);
when(metadata.getValue(SdcPropertyNames.PROPERTY_NAME_TYPE)).thenReturn(SdcTypes.CVFC.getValue());
assertFalse(topologyTemplateQuery.isMatchingSearchCriteria(nodeTemplate));
}