Fixup checkstyle
[controller.git] / opendaylight / md-sal / cds-access-api / src / test / java / org / opendaylight / controller / cluster / access / commands / AbstractReadTransactionRequestTest.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.commands;
9
10 import com.google.common.base.MoreObjects;
11 import org.junit.Assert;
12 import org.junit.Test;
13 import org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier;
14
15 public abstract class AbstractReadTransactionRequestTest<T extends AbstractReadPathTransactionRequest<T>>
16         extends AbstractTransactionRequestTest<T> {
17     protected static final YangInstanceIdentifier PATH = YangInstanceIdentifier.empty();
18     protected static final boolean SNAPSHOT_ONLY = true;
19
20     @Override
21     protected abstract T object();
22
23     @Test
24     public void getPathTest() {
25         Assert.assertEquals(PATH, object().getPath());
26     }
27
28     @Test
29     public void isSnapshotOnlyTest() {
30         Assert.assertEquals(SNAPSHOT_ONLY, object().isSnapshotOnly());
31     }
32
33     @Test
34     public void addToStringAttributesTest() {
35         final MoreObjects.ToStringHelper result = object().addToStringAttributes(MoreObjects.toStringHelper(object()));
36         Assert.assertTrue(result.toString().contains("path=" + PATH));
37     }
38 }