ServerResource extends AbstractBrooklynRestResource implements ServerApi { @Override public VersionSummary getVersion() { if (!Entitlements.isEntitled(mgmt().getEntitlementManager(), Entitlements.SERVER_STATUS, null)) throw WebResourceUtils.forbidden("User '%s' is not authorized to perform this operation", Entitlements.getEntitlementContext().user()); InputStream input = ResourceUtils.create(this).getResourceFromUrl("classpath: Properties properties = new Properties(); String gitSha1 = null, gitBranch = null; try { properties.load(input); gitSha1 = properties.getProperty(BUILD_SHA_1_PROPERTY); gitBranch = properties.getProperty(BUILD_BRANCH_PROPERTY); } catch (IOException e) { log.error("Failed to load build-metadata.properties", e); } gitSha1 = BrooklynVersion.INSTANCE.getSha1FromOsgiManifest(); FluentIterable<BrooklynFeatureSummary> features = FluentIterable.from(BrooklynVersion.getFeatures(mgmt())) .transform(BrooklynFeatureTransformer.FROM_FEATURE); return new VersionSummary(BrooklynVersion.get(), gitSha1, gitBranch, features.toList()); }  @Override void reloadBrooklynProperties(); @Override void shutdown(final boolean stopAppsFirst, final boolean forceShutdownOnError,
            String shutdownTimeoutRaw, String requestTimeoutRaw, String delayForHttpReturnRaw,
            Long delayMillis); @Override VersionSummary getVersion(); @Override String getPlaneId(); @Override boolean isUp(); @Override boolean isShuttingDown(); @Override boolean isHealthy(); @Override Map<String,Object> getUpExtended(); @Override String getConfig(String configKey); @Override ManagementNodeState getHighAvailabilityNodeState(); @Override ManagementNodeState setHighAvailabilityNodeState(HighAvailabilityMode mode); @Override Map<String, Object> getHighAvailabilityMetrics(); @Override long getHighAvailabitlityPriority(); @Override long setHighAvailabilityPriority(long priority); @Override HighAvailabilitySummary getHighAvailabilityPlaneStates(); @Override Response clearHighAvailabilityPlaneStates(); @Override String getUser(); @Override Response exportPersistenceData(String preferredOrigin);  }
@Test public void testGetVersion() throws Exception { VersionSummary version = client().path("/server/version").get(VersionSummary.class); assertEquals(version.getVersion(), BrooklynVersion.get()); }