public class MockHelper extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
add()
Finish building and add all resources to the resource tree.
|
void |
commit()
Finish building, add all resources to the resource tree and commit changes.
|
static @NotNull MockHelper |
create(@NotNull org.apache.sling.api.resource.ResourceResolver resolver)
Create a new helper
|
@NotNull MockHelper |
p(@NotNull String name,
@Nullable Object value)
Add a property to the current resource
|
@NotNull MockHelper |
resource(@NotNull String path)
Add a new resource.
|
@NotNull public static @NotNull MockHelper create(@NotNull @NotNull org.apache.sling.api.resource.ResourceResolver resolver)
resolver - Resource resolver@NotNull public @NotNull MockHelper resource(@NotNull @NotNull String path)
path - Resource path@NotNull public @NotNull MockHelper p(@NotNull @NotNull String name, @Nullable @Nullable Object value)
name - Property namevalue - Property valuepublic void add()
throws org.apache.sling.api.resource.PersistenceException
org.apache.sling.api.resource.PersistenceException - Persistence exceptionpublic void commit()
throws org.apache.sling.api.resource.PersistenceException
org.apache.sling.api.resource.PersistenceException - Persistence exceptionCopyright © 2007–2019 The Apache Software Foundation. All rights reserved.