### Question:
CndInstruction extends PluginInstruction { @Override public InstructionStatus process(final PluginContext context, final InstructionStatus previousStatus) { if (Strings.isNullOrEmpty(namespacePrefix)) { namespace = context.getProjectNamespacePrefix(); } else { namespace = namespacePrefix; } final Map<String, Object> data = context.getPlaceholderData(); processAllPlaceholders(data); final String prefix = context.getProjectNamespacePrefix(); final Session session = context.createSession(); try { String[] superTypes; if (!Strings.isNullOrEmpty(superType)) { final Iterable<String> split = Splitter.on(",").omitEmptyStrings().trimResults().split(superType); superTypes = Iterables.toArray(split, String.class); } else { superTypes = ArrayUtils.EMPTY_STRING_ARRAY; } CndUtils.registerDocumentType(context, prefix, documentType, true, false, superTypes); session.save(); eventBus.post(new InstructionEvent(this)); return InstructionStatus.SUCCESS; } catch (NodeTypeExistsException e) { GlobalUtils.refreshSession(session, false); } catch (RepositoryException e) { log.error(String.format("Error registering document type: %s", namespace), e); GlobalUtils.refreshSession(session, false); } finally { GlobalUtils.cleanupSession(session); } message = messageRegisterError; eventBus.post(new InstructionEvent(this)); return InstructionStatus.FAILED; }  @Override InstructionStatus process(final PluginContext context, final InstructionStatus previousStatus); @Override String getMessage(); @Override void setMessage(final String message); @Override String getAction(); @Override void setAction(final String action); @XmlAttribute String getDocumentType(); void setDocumentType(final String documentType); @XmlAttribute String getNamespacePrefix(); void setNamespacePrefix(final String namespacePrefix); @XmlAttribute String getSuperType(); void setSuperType(final String superType); @Override String toString();  }### Answer:
@Test public void testProcess() throws Exception { final Session session = getSession(); session.getRootNode().addNode(HippoNodeType.NAMESPACES_PATH); session.save(); CndUtils.registerNamespace(getContext(), TEST_PREFIX, TEST_URI); assertTrue("CndUtils.registerNamespaceUri", true); CndUtils.createHippoNamespace(getContext(), TEST_PREFIX); assertTrue("CndUtils.createHippoNamespace", true); boolean exists = CndUtils.namespaceUriExists(getContext(), TEST_URI); assertTrue(exists); cndInstruction.setDocumentType("newsdocument"); getContext().setProjectNamespacePrefix(TEST_PREFIX); final InstructionSet instructionSet = new PluginInstructionSet(); instructionSet.addInstruction(cndInstruction); InstructionStatus status = executor.execute(instructionSet, getContext()); assertTrue("Expected success but got: " + status, status == InstructionStatus.SUCCESS); status = executor.execute(instructionSet, getContext()); assertTrue("Expected success but got: " + status, status == InstructionStatus.FAILED); final String testingPrefix = "testingprefix"; cndInstruction.setNamespacePrefix(testingPrefix); assertEquals("testingprefix", cndInstruction.getNamespacePrefix()); session.logout(); }