### Question:
MetadataService extends PentahoBase { public Model loadModel( String domainId, String modelId ) { if ( domainId == null ) { error( Messages.getErrorString( "MetadataService.ERROR_0003_NULL_DOMAIN" ) ); return null; } if ( modelId == null ) { error( Messages.getErrorString( "MetadataService.ERROR_0004_NULL_Model" ) ); return null; } Domain domain = getMetadataRepository().getDomain( domainId ); if ( domain == null ) { error( Messages.getErrorString( "MetadataService.ERROR_0005_DOMAIN_NOT_FOUND", domainId ) ); return null; } LogicalModel model = domain.findLogicalModel( modelId ); if ( model == null ) { error( Messages.getErrorString( "MetadataService.ERROR_0006_MODEL_NOT_FOUND", modelId ) ); return null; } MetadataServiceUtil util = getMetadataServiceUtil(); util.setDomain( domain ); Model thinModel = util.createThinModel( model, domainId ); return thinModel; } MetadataService(); @GET @Path( "/getDatasourcePermissions" ) @Produces( { APPLICATION_JSON } ) String getDatasourcePermissions(); ModelInfo[] listBusinessModels( String domainName ); String listBusinessModelsJson( String domainName ); Model loadModel( String domainId, String modelId ); String loadModelJson( String domainId, String modelId ); MarshallableResultSet doQuery( Query query, Integer rowLimit ); MarshallableResultSet doXmlQuery( String xml, Integer rowLimit ); String doXmlQueryToJson( String xml, int rowLimit ); String doXmlQueryToCdaJson( String xml, int rowLimit ); MarshallableResultSet doJsonQuery( String json, Integer rowLimit ); String doJsonQueryToJson( String json, int rowLimit ); String doJsonQueryToCdaJson( String json, int rowLimit ); @Override Log getLogger();  }### Answer:
@Test public void testLoadModel() { when( metadataService.loadModel( anyString(), anyString() ) ).thenCallRealMethod(); Model model = metadataService.loadModel( DOMAIN_ID, LOGICAL_MODEL_ID ); Assert.assertTrue( model.getName() == LOGICAL_MODEL_NAME ); }