### Question:
RestBackendImpl implements RestBackend { @Override public boolean isCluster(String domainUid, String cluster) { LOGGER.entering(domainUid, cluster); authorize(domainUid, Operation.list); boolean result = getClusters(domainUid).contains(cluster); LOGGER.exiting(result); return result; } RestBackendImpl(String principal, String accessToken, Collection<String> targetNamespaces); @Override Set<String> getDomainUids(); @Override boolean isDomainUid(String domainUid); @Override void performDomainAction(String domainUid, DomainAction params); @Override Set<String> getClusters(String domainUid); @Override boolean isCluster(String domainUid, String cluster); @Override void scaleCluster(String domainUid, String cluster, int managedServerCount); static final String INITIAL_VERSION; }### Answer:
@Test public void acceptDefinedClusterName() { configSupport.addWlsCluster("cluster1", "ms1", "ms2", "ms3"); configSupport.addWlsCluster("cluster2", "ms4", "ms5", "ms6"); setupScanCache(); assertThat(restBackend.isCluster(NAME1, "cluster1"), is(true)); }
@Test public void rejectUndefinedClusterName() { configSupport.addWlsCluster("cluster1", "ms1", "ms2", "ms3"); configSupport.addWlsCluster("cluster2", "ms4", "ms5", "ms6"); setupScanCache(); assertThat(restBackend.isCluster(NAME1, "cluster3"), is(false)); }