- LOG.debug("Get key {}", args[0]);
- return data.get(args[0]);
+ final InstanceIdentifier<?> id = (InstanceIdentifier<?>) args[0];
+
+ LOG.debug("Remove key {}", id);
+ data.remove(id);
+ return null;
+ }
+ }).when(this.mockedTransaction).removeOperationalData(Matchers.any(InstanceIdentifier.class));
+
+ Mockito.doAnswer(new Answer<Object>() {
+ @Override
+ public Object answer(final InvocationOnMock invocation) {
+ final Object[] args = invocation.getArguments();
+ final InstanceIdentifier<?> id = (InstanceIdentifier<?>) args[0];
+
+ LOG.debug("Get key {}", id);
+ Object ret = data.get(id);
+ if (ret != null) {
+ return ret;
+ }
+
+ if (attrId.containsWildcarded(id)) {
+ return new AttributesBuilder().setUptodate(true).build();
+ }
+ return null;