use of org.apache.jackrabbit.oak.spi.commit.EmptyHook in project jackrabbit-oak by apache.
the class SecureNodeBuilderTest method before.
@Before
public void before() throws Exception {
NodeBuilder rootBuilder = store.getRoot().builder();
rootBuilder.setProperty("prop", "value").setProperty(NAME_NON_ACCESSIBLE, "value");
rootBuilder.child(NAME_ACCESSIBLE).setProperty("prop", "value").setProperty(NAME_NON_ACCESSIBLE, "value");
rootBuilder.child(NAME_NON_ACCESSIBLE).setProperty("prop", "value").setProperty(NAME_NON_ACCESSIBLE, "value");
store.merge(rootBuilder, new EmptyHook(), new CommitInfo("id", null));
rootBuilder = store.getRoot().builder();
secureNodeBuilder = new SecureNodeBuilder(rootBuilder, new LazyValue<PermissionProvider>() {
@Override
protected PermissionProvider createValue() {
return permissionProvider;
}
});
}
use of org.apache.jackrabbit.oak.spi.commit.EmptyHook in project jackrabbit-oak by apache.
the class MutableRootTest method before.
@Before
public void before() {
SecurityProvider sp = new OpenSecurityProvider() {
@Nonnull
@Override
public <T> T getConfiguration(@Nonnull Class<T> configClass) {
if (AuthorizationConfiguration.class == configClass) {
return (T) new OpenAuthorizationConfiguration() {
@Nonnull
@Override
public PermissionProvider getPermissionProvider(@Nonnull Root root, @Nonnull String workspaceName, @Nonnull Set<Principal> principals) {
return permissionProvider;
}
};
} else {
return super.getConfiguration(configClass);
}
}
};
ContentSessionImpl cs = Mockito.mock(ContentSessionImpl.class);
when(cs.toString()).thenReturn("contentSession");
when(cs.getAuthInfo()).thenReturn(AuthInfoImpl.EMPTY);
when(cs.getWorkspaceName()).thenReturn("default");
root = new MutableRoot(store, new EmptyHook(), "default", new Subject(), sp, null, null, cs);
}
Aggregations