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.commands;
10 import static org.hamcrest.CoreMatchers.containsString;
11 import static org.hamcrest.MatcherAssert.assertThat;
12 import static org.junit.Assert.assertEquals;
14 import com.google.common.base.MoreObjects;
15 import org.junit.Test;
16 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
18 public abstract class AbstractReadTransactionRequestTest<T extends AbstractReadPathTransactionRequest<T>>
19 extends AbstractTransactionRequestTest<T> {
20 protected static final YangInstanceIdentifier PATH = YangInstanceIdentifier.of();
21 protected static final boolean SNAPSHOT_ONLY = true;
23 protected AbstractReadTransactionRequestTest(final T object, final int baseSize) {
24 super(object, baseSize);
28 public void getPathTest() {
29 assertEquals(PATH, object().getPath());
33 public void isSnapshotOnlyTest() {
34 assertEquals(SNAPSHOT_ONLY, object().isSnapshotOnly());
38 public void addToStringAttributesTest() {
39 final var result = object().addToStringAttributes(MoreObjects.toStringHelper(object())).toString();
40 assertThat(result, containsString("path=" + PATH));