2 * Copyright (c) 2017 Pantheon Technologies s.r.o. and others. All rights reserved.
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
8 package org.opendaylight.controller.cluster.access.concepts;
10 import static org.junit.Assert.assertFalse;
11 import static org.junit.Assert.assertNull;
12 import static org.junit.Assert.assertTrue;
14 import akka.actor.ActorRef;
15 import akka.actor.ActorSystem;
16 import akka.testkit.TestProbe;
17 import org.opendaylight.controller.cluster.access.commands.CreateLocalHistoryRequest;
19 public class UnsupportedRequestExceptionTest extends RequestExceptionTest<UnsupportedRequestException> {
21 private static final FrontendIdentifier FRONTEND =
22 new FrontendIdentifier(MemberName.forName("test"), FrontendIdentifierTest.ONE_FRONTEND_TYPE);
23 private static final ClientIdentifier CLIENT = new ClientIdentifier(FRONTEND, 0);
25 private static final LocalHistoryIdentifier LOCAL_HISTORY = new LocalHistoryIdentifier(CLIENT, 10);
26 private static final ActorSystem SYSTEM = ActorSystem.create("test");
27 private static final ActorRef ACTOR_REF = TestProbe.apply(SYSTEM).ref();
28 private static final Request<?, ?> REQUEST = new CreateLocalHistoryRequest(LOCAL_HISTORY, ACTOR_REF);
29 private static final RequestException OBJECT = new UnsupportedRequestException(REQUEST);
32 protected void isRetriable() {
33 assertFalse(OBJECT.isRetriable());
37 protected void checkMessage() {
38 final String message = OBJECT.getMessage();
39 final String checkMessage = "Unsupported request class org.opendaylight.controller"
40 + ".cluster.access.commands.CreateLocalHistoryRequest";
41 assertTrue(checkMessage.equals(message));
42 assertNull(OBJECT.getCause());