@Test public void testIsSingleValueDescriptor() { final Repository mockRepository = mock(Repository.class); when(mockRepository.isSingleValueDescriptor(anyString())).thenReturn(false); when(mockRepository.isSingleValueDescriptor("SOME_KEY")).thenReturn(true); final RepositoryFacade facade = getFacade(mockRepository); assertTrue("SOME_KEY should be true", facade.isSingleValueDescriptor("SOME_KEY")); assertFalse("anyString key should be false", facade.isSingleValueDescriptor("ANOTHER_KEY")); final RepositoryFacade facadeNull = getFacade(null); assertFalse("null should return false", facadeNull.isSingleValueDescriptor("SOME_KEY")); }
@Override public boolean isSingleValueDescriptor(String key) { return delegate != null && delegate.isSingleValueDescriptor(key); }
RepositoryFacade implements Repository { @Override public boolean isSingleValueDescriptor(String key) { return delegate != null && delegate.isSingleValueDescriptor(key); } }
RepositoryFacade implements Repository { @Override public boolean isSingleValueDescriptor(String key) { return delegate != null && delegate.isSingleValueDescriptor(key); } @SuppressWarnings("WeakerAccess")  RepositoryFacade(final @Nullable Repository delegate); }
RepositoryFacade implements Repository { @Override public boolean isSingleValueDescriptor(String key) { return delegate != null && delegate.isSingleValueDescriptor(key); } @SuppressWarnings("WeakerAccess")  RepositoryFacade(final @Nullable Repository delegate); @Override String[] getDescriptorKeys(); @Override boolean isStandardDescriptor(String key); @Override boolean isSingleValueDescriptor(String key); @Override Value getDescriptorValue(String key); @Override Value[] getDescriptorValues(String key); @Override String getDescriptor(String key); @Override Session login(Credentials credentials, String workspaceName); @Override Session login(Credentials credentials); @Override Session login(String workspaceName); @Override Session login(); }
RepositoryFacade implements Repository { @Override public boolean isSingleValueDescriptor(String key) { return delegate != null && delegate.isSingleValueDescriptor(key); } @SuppressWarnings("WeakerAccess")  RepositoryFacade(final @Nullable Repository delegate); @Override String[] getDescriptorKeys(); @Override boolean isStandardDescriptor(String key); @Override boolean isSingleValueDescriptor(String key); @Override Value getDescriptorValue(String key); @Override Value[] getDescriptorValues(String key); @Override String getDescriptor(String key); @Override Session login(Credentials credentials, String workspaceName); @Override Session login(Credentials credentials); @Override Session login(String workspaceName); @Override Session login();  }