BUG-47 : PCEP migration to generated DTOs.
[bgpcep.git] / pcep / impl / src / test / java / org / opendaylight / protocol / pcep / impl / MockPCE.java
index c6a0d0fcb16741babbe86b4178fc9594fbbf5095..b3e3f5dfdbef019774552c03fe8cce0d4c84562d 100644 (file)
@@ -14,10 +14,8 @@ import org.opendaylight.protocol.pcep.PCEPErrors;
 import org.opendaylight.protocol.pcep.PCEPSession;
 import org.opendaylight.protocol.pcep.PCEPSessionListener;
 import org.opendaylight.protocol.pcep.PCEPTerminationReason;
-import org.opendaylight.protocol.pcep.message.PCEPErrorMessage;
-import org.opendaylight.protocol.pcep.object.PCEPErrorObject;
-import org.opendaylight.protocol.pcep.object.PCEPOpenObject;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.Message;
+import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.pcep.types.rev131005.OpenObject;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -40,11 +38,8 @@ public class MockPCE implements PCEPSessionListener {
                this.session.handleMessage(msg);
        }
 
-       public void sendErrorMessage(final PCEPErrors value, final PCEPOpenObject open) {
-               final PCEPErrorObject error = new PCEPErrorObject(value);
-               final List<PCEPErrorObject> errors = new ArrayList<PCEPErrorObject>();
-               errors.add(error);
-               this.sendMessage(new PCEPErrorMessage(open, errors, null));
+       public void sendErrorMessage(final PCEPErrors value, final OpenObject open) {
+               this.sendMessage(Util.createErrorMessage(value, open));
        }
 
        public List<Message> getListMsg() {