### Question:
GetEntityMetadataCommand extends AbstractRestCommand { @Override public String run() { LOGGER.debug("run: entity={}, version={}", entity, version); Error.reset(); Error.push(getClass().getSimpleName()); try { EntityMetadata md = getMetadata().getEntityMetadata(entity, version); if (md != null) { JSONMetadataParser parser = getJSONParser(); return parser.convert(md).toString(); } else { throw Error.get(RestMetadataConstants.ERR_NO_ENTITY_VERSION, entity + ":" + version); } } catch (Error e) { return e.toString(); } catch (Exception e) { LOGGER.error("Failure: {}", e); return Error.get(RestMetadataConstants.ERR_REST_ERROR, e.toString()).toString(); } } GetEntityMetadataCommand(String entity, String version);  GetEntityMetadataCommand(Metadata metadata, String entity, String version); @Override String run();  }### Answer:
@Test public void execute() { GetEntityMetadataCommand command = new GetEntityMetadataCommand(metadata, null, null); String output = command.run(); Assert.assertNotNull(output); }
@Test public void executeDefault() { GetEntityMetadataCommand command = new GetEntityMetadataCommand(metadata, "test", "default"); String output = command.run(); Assert.assertNotNull(output); Assert.assertNull(metadata.args[1]); }