### Question:
CpkCoreService { public void createContent( Map<String, Map<String, Object>> bloatedMap ) throws Exception { final ICpkEnvironment environment = this.getEngine().getEnvironment(); final HttpServletResponse response = (HttpServletResponse) bloatedMap.get( PATH_KEY ).get( HTTP_RESPONSE_KEY ); final String path = getPath( bloatedMap ); logger.debug( "Creating content" ); final boolean isDefaultElementPath = "".equals( path ) || "/".equals( path ); final IElement element = isDefaultElementPath ? this.getDefaultElement() : getElement( path ); if ( element != null ) { if ( isDefaultElementPath ) { final String url = getElementUrl( element, path ); CpkUtils.redirect( response, url ); } final IAccessControl accessControl = environment.getAccessControl(); if ( accessControl.isAllowed( element ) ) { element.processRequest( bloatedMap ); } else { accessControl.throwAccessDenied( response ); } } else { final String elementNotFound = "Unable to get element: " + path + ". " + "This is probably a call to a control CPK operation (reload, status)"; logger.debug( elementNotFound ); throw new Exception( "Unable to get element! - " + path ); } } CpkCoreService( ICpkEnvironment environment ); CpkEngine getEngine(); CpkCoreService setEngine( CpkEngine engine ); void createContent( Map<String, Map<String, Object>> bloatedMap ); String getLocalizationResourceContent( String elementId, String resource ); void reload( OutputStream out, Map<String, Map<String, Object>> bloatedMap ); String reload( Map<String, Map<String, Object>> bloatedMap ); void refresh( OutputStream out, Map<String, Map<String, Object>> bloatedMap ); String refresh( Map<String, Map<String, Object>> bloatedMap ); void clearKettleResultsCache(); void status( OutputStream out, Map<String, Map<String, Object>> bloatedMap ); String status( Map<String, Map<String, Object>> bloatedMap ); void statusJson( OutputStream out, HttpServletResponse response ); String statusJson( HttpServletResponse response ); boolean hasElement( String elementId ); Collection<IElement> getElements(); void getElementsList( OutputStream out, Map<String, Map<String, Object>> bloatedMap ); String getElementsList(); IElement getDefaultElement(); RestRequestHandler getRequestHandler();  }### Answer:
@Test public void testCreateContentSampleTrans() throws Exception { final String sampleTransResult = createContent( sampleTrans() ); JSONObject queryInfo = new JSONObject( sampleTransResult ).getJSONObject( "queryInfo" ); assertFalse( queryInfo.length() < 1 ); }
@Test public void testCreateContentEvaluateResultRows() throws Exception { final String evaluateResultRowsResult = createContent( evaluateResultRows() ); JSONObject evaluateResultRowsJson = new JSONObject( evaluateResultRowsResult ); assertTrue( evaluateResultRowsJson.getBoolean( "result" ) ); }
@Test public void testCreateContentCreateResultRows() throws Exception { final String createResultRowsResult = createContent( createResultRows() ); JSONObject queryInfo = new JSONObject( createResultRowsResult ).getJSONObject( "queryInfo" ); assertFalse( queryInfo.length() < 1 ); }
@Test public void testCreateContentGenerateRows() throws Exception { final String generateRowsResult = createContent( generateRows() ); JSONObject queryInfo = new JSONObject( generateRowsResult ).getJSONObject( "queryInfo" ); assertFalse( queryInfo.length() < 1 ); }