Format Java code to ONAP standard
[aai/search-data-service.git] / src / test / java / org / onap / aai / sa / auth / SearchDbServiceAuthTest.java
index 3ffb422..a4b5395 100644 (file)
@@ -39,47 +39,47 @@ public class SearchDbServiceAuthTest {
     @Mock\r
     HttpHeaders headers;\r
 \r
-//    @Mock\r
-//    Cookie mockedCookie;\r
+    // @Mock\r
+    // Cookie mockedCookie;\r
 \r
     @Before\r
     public void setUp() throws NoSuchFieldException, IllegalAccessException, IOException {\r
         MockitoAnnotations.initMocks(this);\r
         System.setProperty("AJSC_HOME", new File(".").getCanonicalPath().replace('\\', '/'));\r
-        setFinalStatic(System.getProperty("AJSC_HOME")+"/src/test/resources/json/search_policy.json");\r
+        setFinalStatic(System.getProperty("AJSC_HOME") + "/src/test/resources/json/search_policy.json");\r
     }\r
 \r
     @Test\r
-    public void testAuthUser(){\r
+    public void testAuthUser() {\r
         SearchDbServiceAuth aaiAuth = new SearchDbServiceAuth();\r
         String auth = aaiAuth.authUser(headers, "user-1", "function-1");\r
         Assert.assertEquals(auth, "AAI_9101");\r
     }\r
 \r
-//    @Test\r
-//    public void testAuthCookie_NullCookie(){\r
-//        SearchDbServiceAuth aaiAuth = new SearchDbServiceAuth();\r
-//        Cookie cookie = null;\r
-//        Assert.assertFalse(aaiAuth.authCookie(cookie, "function-1", new StringBuilder("user-1")));\r
-//    }\r
+    // @Test\r
+    // public void testAuthCookie_NullCookie(){\r
+    // SearchDbServiceAuth aaiAuth = new SearchDbServiceAuth();\r
+    // Cookie cookie = null;\r
+    // Assert.assertFalse(aaiAuth.authCookie(cookie, "function-1", new StringBuilder("user-1")));\r
+    // }\r
 \r
-//    @Test\r
-//    public void testAuthCookie_NotNullCookie(){\r
-//        SearchDbServiceAuth aaiAuth = new SearchDbServiceAuth();\r
-//        Cookie cookie = new Cookie ( "TestCookie", "TestValue");\r
-//         // Cookie cookie = new Cookie ( "TestCookie", "TestValue" );\r
-//        boolean retValue = aaiAuth.authCookie(cookie, "GET:testFunction", new StringBuilder("testuser"));\r
-//        Assert.assertTrue(retValue);\r
-//        }\r
+    // @Test\r
+    // public void testAuthCookie_NotNullCookie(){\r
+    // SearchDbServiceAuth aaiAuth = new SearchDbServiceAuth();\r
+    // Cookie cookie = new Cookie ( "TestCookie", "TestValue");\r
+    // // Cookie cookie = new Cookie ( "TestCookie", "TestValue" );\r
+    // boolean retValue = aaiAuth.authCookie(cookie, "GET:testFunction", new StringBuilder("testuser"));\r
+    // Assert.assertTrue(retValue);\r
+    // }\r
 \r
-    static void setFinalStatic(String fieldValue) throws NoSuchFieldException, SecurityException,\r
-            IllegalArgumentException, IllegalAccessException {\r
+    static void setFinalStatic(String fieldValue)\r
+            throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {\r
         Field configField = SearchDbConstants.class.getDeclaredField("SDB_AUTH_CONFIG_FILENAME");\r
         configField.setAccessible(true);\r
 \r
-        Field modifiersField = Field.class.getDeclaredField( "modifiers" );\r
-        modifiersField.setAccessible( true );\r
-        modifiersField.setInt( configField, configField.getModifiers() & ~Modifier.FINAL );\r
+        Field modifiersField = Field.class.getDeclaredField("modifiers");\r
+        modifiersField.setAccessible(true);\r
+        modifiersField.setInt(configField, configField.getModifiers() & ~Modifier.FINAL);\r
 \r
         configField.set(null, fieldValue);\r
     }\r