@Test
public void testCreationOfDeviceWithNoAvailableAdapter() {

    ArgumentCaptor<DeviceAdapterId> adapter = ArgumentCaptor.forClass(DeviceAdapterId.class);
    EditContainmentNode deviceEditNode = new EditContainmentNode(DEVICE_MANAGEMENT_QNAME, EditConfigOperations.MERGE);
    deviceEditNode.addLeafChangeNode(TYPE_QNAME, new GenericConfigAttribute(TYPE, NS, "TYPE2"));
    deviceEditNode.addLeafChangeNode(INTERFACE_VERSION_QNAME, new GenericConfigAttribute(INTERFACE_VERSION, NS, "2.0"));
    deviceEditNode.addLeafChangeNode(VENDOR_QNAME, new GenericConfigAttribute(VENDOR, NS, "VENDOR2"));
    deviceEditNode.addLeafChangeNode(MODEL_QNAME, new GenericConfigAttribute(MODEL, NS, "MODEL2"));
    EditContext editContext = new EditContext(deviceEditNode, null, ERROR_ON_ROLLBACK, null);
    try {
        m_deviceConfigInterceptor.interceptEditConfig(m_modelNode, editContext);
    }
    catch (EditConfigException e) {
        NetconfRpcError error = e.getRpcError();
        assertEquals(ADAPTER_NOR_DEPLOYED_ERROR, error.getErrorMessage());
        assertEquals(INVALID_VALUE, error.getErrorTag());
        assertEquals(Application, error.getErrorType());
        assertEquals(Error, error.getErrorSeverity());
        verify(m_adapterManager).getDeviceAdapter(adapter.capture());
    }
}