@Mocked
PageContent pageContent;
@Test
public void testStart() throws Exception {
final Namespace parent = Namespace.createFromString("net.tralfamadore");
new NonStrictExpectations() {
{
pageContent.getNamespace(); result = new Delegate() {
Namespace returnANamespace() {
return parent;
}
};
pageContent.getNamespaceToAdd(); result = Namespace.createFromString("net.tralfamadore.site");
}
};
adminController.addNewNamespace();
new Verifications() {
{
pageContent.getNamespace(); times = 1;
pageContent.setNamespaceToAdd(new Namespace(parent, "")); times = 1;
pageContent.getNamespaceToAdd(); times = 1;
pageContent.setAddingNamespace(anyBoolean); times = 1;
forEachInvocation = new Object() {
void validate(boolean b) {
assertTrue(b);