@Test void testIsWritablePackageAddPackagePermission() { Package aPackage = when(mock(Package.class).getId()).thenReturn("packageId").getMock(); doReturn(true) .when(userPermissionEvaluator) .hasPermission(new PackageIdentity("packageId"), ADD_PACKAGE); doReturn(false) .when(userPermissionEvaluator) .hasPermission(new PackageIdentity("packageId"), ADD_ENTITY_TYPE); assertTrue(PackagePermissionUtils.isWritablePackage(aPackage, userPermissionEvaluator)); }
public static boolean isWritablePackage( Package aPackage, UserPermissionEvaluator userPermissionEvaluator) { return isPermittedPackage(aPackage, userPermissionEvaluator, ADD_PACKAGE); }
PackagePermissionUtils { public static boolean isWritablePackage( Package aPackage, UserPermissionEvaluator userPermissionEvaluator) { return isPermittedPackage(aPackage, userPermissionEvaluator, ADD_PACKAGE); } }
PackagePermissionUtils { public static boolean isWritablePackage( Package aPackage, UserPermissionEvaluator userPermissionEvaluator) { return isPermittedPackage(aPackage, userPermissionEvaluator, ADD_PACKAGE); } private  PackagePermissionUtils(); }
PackagePermissionUtils { public static boolean isWritablePackage( Package aPackage, UserPermissionEvaluator userPermissionEvaluator) { return isPermittedPackage(aPackage, userPermissionEvaluator, ADD_PACKAGE); } private  PackagePermissionUtils(); static boolean isReadablePackage(
      Package aPackage, UserPermissionEvaluator userPermissionEvaluator); static boolean isWritablePackage(
      Package aPackage, UserPermissionEvaluator userPermissionEvaluator); }
PackagePermissionUtils { public static boolean isWritablePackage( Package aPackage, UserPermissionEvaluator userPermissionEvaluator) { return isPermittedPackage(aPackage, userPermissionEvaluator, ADD_PACKAGE); } private  PackagePermissionUtils(); static boolean isReadablePackage(
      Package aPackage, UserPermissionEvaluator userPermissionEvaluator); static boolean isWritablePackage(
      Package aPackage, UserPermissionEvaluator userPermissionEvaluator);  }