6bf0088c9655b38fe0d74d761a72f2dfdb21eb63
[controller.git] / opendaylight / md-sal / cds-access-api / src / test / java / org / opendaylight / controller / cluster / access / concepts / AbstractRequestTest.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.concepts;
9
10 import akka.actor.ActorRef;
11 import akka.actor.ActorSystem;
12 import akka.testkit.TestProbe;
13 import com.google.common.base.MoreObjects;
14 import org.junit.Assert;
15 import org.junit.Test;
16
17 public abstract class AbstractRequestTest<T extends Request> {
18     private static final ActorSystem SYSTEM = ActorSystem.create("test");
19     protected static final ActorRef ACTOR_REF = TestProbe.apply(SYSTEM).ref();
20
21     protected abstract T object();
22
23     @Test
24     public void getReplyToTest() {}
25
26     @Test
27     public void addToStringAttributesCommonTest() {
28         final MoreObjects.ToStringHelper result = object().addToStringAttributes(MoreObjects.toStringHelper(object()));
29         Assert.assertTrue(result.toString().contains("replyTo=" + ACTOR_REF));
30     }
31 }