4f6625b6c5d0da0fb5d812b0b2e5b2b76e37f373
[controller.git] / opendaylight / md-sal / sal-distributed-datastore / src / test / java / org / opendaylight / controller / cluster / access / client / AccessClientUtil.java
1 /*
2  * Copyright (c) 2017 Pantheon Technologies s.r.o. and others.  All rights reserved.
3  *
4  * This program and the accompanying materials are made available under the
5  * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6  * and is available at http://www.eclipse.org/legal/epl-v10.html
7  */
8 package org.opendaylight.controller.cluster.access.client;
9
10 import akka.actor.ActorRef;
11 import akka.actor.ActorSystem;
12 import org.opendaylight.controller.cluster.access.concepts.ClientIdentifier;
13 import org.opendaylight.controller.cluster.access.concepts.ResponseEnvelope;
14
15 /**
16  * Util class to access package private members in cds-access-client for test purposes.
17  */
18 public class AccessClientUtil {
19
20     public static ClientActorContext createClientActorContext(final ActorSystem system, final ActorRef actor,
21                                                               final ClientIdentifier id, final String persistenceId) {
22         return new ClientActorContext(actor, system.scheduler(), system.dispatcher(), persistenceId, id);
23     }
24
25     public static void completeRequest(final AbstractClientConnection<? extends BackendInfo> connection,
26                                        final ResponseEnvelope<?> envelope) {
27         connection.receiveResponse(envelope);
28     }
29
30 }