Clean-up sal-rest-docgen test classes
[netconf.git] / restconf / sal-rest-docgen / src / test / java / org / opendaylight / netconf / sal / rest / doc / impl / DocGenTestHelper.java
diff --git a/restconf/sal-rest-docgen/src/test/java/org/opendaylight/netconf/sal/rest/doc/impl/DocGenTestHelper.java b/restconf/sal-rest-docgen/src/test/java/org/opendaylight/netconf/sal/rest/doc/impl/DocGenTestHelper.java
deleted file mode 100644 (file)
index cb9d987..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (c) 2014 Brocade Communications Systems, Inc. and others.  All rights reserved.
- *
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- */
-package org.opendaylight.netconf.sal.rest.doc.impl;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.when;
-
-import com.fasterxml.jackson.databind.JsonNode;
-import java.net.URI;
-import javax.ws.rs.core.UriBuilder;
-import javax.ws.rs.core.UriInfo;
-import org.mockito.ArgumentCaptor;
-
-final class DocGenTestHelper {
-
-    private DocGenTestHelper() {
-        // hidden on purpose
-    }
-
-    static UriInfo createMockUriInfo(final String urlPrefix) throws Exception {
-        final URI uri = new URI(urlPrefix);
-        final UriBuilder mockBuilder = mock(UriBuilder.class);
-
-        final ArgumentCaptor<String> subStringCapture = ArgumentCaptor.forClass(String.class);
-        when(mockBuilder.path(subStringCapture.capture())).thenReturn(mockBuilder);
-        when(mockBuilder.build()).then(invocation -> URI.create(uri + "/" + subStringCapture.getValue()));
-
-        final UriInfo info = mock(UriInfo.class);
-        when(info.getRequestUriBuilder()).thenReturn(mockBuilder);
-        when(mockBuilder.replaceQuery(any())).thenReturn(mockBuilder);
-        when(info.getBaseUri()).thenReturn(uri);
-
-        return info;
-    }
-
-    /**
-     * Checks whether object {@code mainObject} contains in properties/items key $ref with concrete value.
-     */
-    static void containsReferences(final JsonNode mainObject, final String childObject, final String expectedRef) {
-        final JsonNode properties = mainObject.get("properties");
-        assertNotNull(properties);
-
-        final JsonNode childNode = properties.get(childObject);
-        assertNotNull(childNode);
-
-        //list case
-        JsonNode refWrapper = childNode.get("items");
-        if (refWrapper == null) {
-            //container case
-            refWrapper = childNode;
-        }
-        assertEquals(expectedRef, refWrapper.get("$ref").asText());
-    }
-}