### Question:
CreateWikiStep implements WikiCreationStep { @Override public void execute(WikiCreationRequest request) throws WikiCreationException { try { wikiManager.create(request.getWikiId(), request.getAlias(), request.getOwnerId(), request.isFailOnExist()); } catch (WikiManagerException e) { throw new WikiCreationException(String.format("Failed to create the wiki [%s].", request.getWikiId()), e); } }  @Override void execute(WikiCreationRequest request); @Override int getOrder();  }### Answer:
@Test public void execute() throws Exception { WikiCreationRequest request = new WikiCreationRequest(); request.setWikiId("wikiId"); request.setAlias("wikiAlias"); request.setOwnerId("owner"); request.setFailOnExist(true); mocker.getComponentUnderTest().execute(request); verify(wikiManager).create("wikiId", "wikiAlias", "owner", true); request.setFailOnExist(false); mocker.getComponentUnderTest().execute(request); verify(wikiManager).create("wikiId", "wikiAlias", "owner", false); }
@Test public void executeWhenException() throws Exception { WikiCreationRequest request = new WikiCreationRequest(); request.setWikiId("wikiId"); request.setAlias("wikiAlias"); request.setOwnerId("owner"); request.setFailOnExist(true); Exception exception = new WikiManagerException("Exception in WikiManager."); doThrow(exception).when(wikiManager).create(any(), any(), any(), anyBoolean()); WikiCreationException caughtException = null; try { mocker.getComponentUnderTest().execute(request); } catch (WikiCreationException e) { caughtException = e; } assertNotNull(caughtException); assertEquals("Failed to create the wiki [wikiId].", caughtException.getMessage()); assertEquals(exception, caughtException.getCause()); }