@Test public void ReadDeleteOnlyモード時に__authzに対するPOSTメソッドが実行された場合はDcCoreExceptionが発生しないこと() throws Exception { PowerMockito.spy(ReadDeleteModeLockManager.class); PowerMockito.when(ReadDeleteModeLockManager.class, "isReadDeleteOnlyMode").thenReturn(true); List<PathSegment> pathSegment = getPathSegmentList(new String[] {"cell", "__authz" }); try { DcReadDeleteModeManager.checkReadDeleteOnlyMode(HttpMethod.POST, pathSegment); } catch (DcCoreException e) { fail(e.getMessage()); } }
public static void checkReadDeleteOnlyMode(String method, List<PathSegment> pathSegment) { if (!ReadDeleteModeLockManager.isReadDeleteOnlyMode()) { return; } if (isAuthPath(pathSegment)) { return; } if (isBatchPath(pathSegment)) { return; } if (ACCEPT_METHODS.contains(method)) { return; } throw DcCoreException.Server.READ_DELETE_ONLY; }
DcReadDeleteModeManager { public static void checkReadDeleteOnlyMode(String method, List<PathSegment> pathSegment) { if (!ReadDeleteModeLockManager.isReadDeleteOnlyMode()) { return; } if (isAuthPath(pathSegment)) { return; } if (isBatchPath(pathSegment)) { return; } if (ACCEPT_METHODS.contains(method)) { return; } throw DcCoreException.Server.READ_DELETE_ONLY; } }
DcReadDeleteModeManager { public static void checkReadDeleteOnlyMode(String method, List<PathSegment> pathSegment) { if (!ReadDeleteModeLockManager.isReadDeleteOnlyMode()) { return; } if (isAuthPath(pathSegment)) { return; } if (isBatchPath(pathSegment)) { return; } if (ACCEPT_METHODS.contains(method)) { return; } throw DcCoreException.Server.READ_DELETE_ONLY; } private  DcReadDeleteModeManager(); }
DcReadDeleteModeManager { public static void checkReadDeleteOnlyMode(String method, List<PathSegment> pathSegment) { if (!ReadDeleteModeLockManager.isReadDeleteOnlyMode()) { return; } if (isAuthPath(pathSegment)) { return; } if (isBatchPath(pathSegment)) { return; } if (ACCEPT_METHODS.contains(method)) { return; } throw DcCoreException.Server.READ_DELETE_ONLY; } private  DcReadDeleteModeManager(); static boolean isAllowedMethod(String method); static void checkReadDeleteOnlyMode(String method, List<PathSegment> pathSegment); }
DcReadDeleteModeManager { public static void checkReadDeleteOnlyMode(String method, List<PathSegment> pathSegment) { if (!ReadDeleteModeLockManager.isReadDeleteOnlyMode()) { return; } if (isAuthPath(pathSegment)) { return; } if (isBatchPath(pathSegment)) { return; } if (ACCEPT_METHODS.contains(method)) { return; } throw DcCoreException.Server.READ_DELETE_ONLY; } private  DcReadDeleteModeManager(); static boolean isAllowedMethod(String method); static void checkReadDeleteOnlyMode(String method, List<PathSegment> pathSegment);  }