Expand my Community achievements bar.

SOLVED

Setting Properties using AEM Mocks and PageManager

Avatar

Level 4

Hello, after I was able to start my test cases using AEM Mocks, I want to know if it is possible to set also properties for the pages created with the AemContext.

I want to give the pages some properties and test them afterwards.

context.pageManager().create("/", "content", "cq:Page", "content");
context.pageManager().create("/content", "de", "cq:Page", "de");
context.pageManager().create("/content/de", "ueber-uns", "cq:Page", "ueber-uns");
context.pageManager().create("/content/de/ueber-uns", "presse", "cq:Page", "presse");
context.pageManager().create("/content/de/ueber-uns/presse", "press-releases", "cq:Page", "press-releases");
context.pageManager().create("/content/de/ueber-uns/presse/press-releases", "2017", "cq:Page", "2017");

Br,

Tim

1 Accepted Solution

Avatar

Correct answer by
Level 4

Yes it is sorry for too fast asking

context.build().resource("/content/de/ueber-uns/presse/press-releases/2017/release1", "prop1", "value1").

  resource("/content/de/ueber-uns/presse/press-releases/2017/release1", "prop2", "value2");
context.build().resource("/content/de/ueber-uns/presse/press-releases/jcr:content", "prop1", "value1").

  resource("/content/de/ueber-uns/presse/press-releases/jcr:content", "prop2", "value2");

View solution in original post

1 Reply

Avatar

Correct answer by
Level 4

Yes it is sorry for too fast asking

context.build().resource("/content/de/ueber-uns/presse/press-releases/2017/release1", "prop1", "value1").

  resource("/content/de/ueber-uns/presse/press-releases/2017/release1", "prop2", "value2");
context.build().resource("/content/de/ueber-uns/presse/press-releases/jcr:content", "prop1", "value1").

  resource("/content/de/ueber-uns/presse/press-releases/jcr:content", "prop2", "value2");