@Test public void testGetDomains() throws TranslatorException { ListDomainsResult listDomainsResult = Mockito.mock(ListDomainsResult.class); List<String> domainName = Arrays.asList(new String[]{"abc", "def"}); when(listDomainsResult.getDomainNames()).thenReturn(domainName); when(simpleDBClient.listDomains()).thenReturn(listDomainsResult); assertEquals(domainName, simpleDBConnection.getDomains()); }
@Override public List<String> getDomains() throws TranslatorException { return amazonSimpleDBClient.listDomains().getDomainNames(); }
SimpleDBConnectionImpl implements SimpleDBConnection { @Override public List<String> getDomains() throws TranslatorException { return amazonSimpleDBClient.listDomains().getDomainNames(); } }
SimpleDBConnectionImpl implements SimpleDBConnection { @Override public List<String> getDomains() throws TranslatorException { return amazonSimpleDBClient.listDomains().getDomainNames(); } SimpleDBConnectionImpl(AmazonSimpleDB amazonSimpleDBClient); }
SimpleDBConnectionImpl implements SimpleDBConnection { @Override public List<String> getDomains() throws TranslatorException { return amazonSimpleDBClient.listDomains().getDomainNames(); } SimpleDBConnectionImpl(AmazonSimpleDB amazonSimpleDBClient); @Override void createDomain(String domainName); @Override void deleteDomain(String domainName); @Override List<String> getDomains(); @Override Set<SimpleDBAttribute> getAttributeNames(String domainName); @Override int performInsert(String domainName, List<Column> columns, Iterator<? extends List<?>> valueList); @Override SelectResult performSelect(String selectExpression, String nextToken); @Override int performUpdate(String domainName, Map<String, Object> updateAttributes, String selectExpression); @Override int performDelete(String domainName, String selectExpression); @Override void close(); }
SimpleDBConnectionImpl implements SimpleDBConnection { @Override public List<String> getDomains() throws TranslatorException { return amazonSimpleDBClient.listDomains().getDomainNames(); } SimpleDBConnectionImpl(AmazonSimpleDB amazonSimpleDBClient); @Override void createDomain(String domainName); @Override void deleteDomain(String domainName); @Override List<String> getDomains(); @Override Set<SimpleDBAttribute> getAttributeNames(String domainName); @Override int performInsert(String domainName, List<Column> columns, Iterator<? extends List<?>> valueList); @Override SelectResult performSelect(String selectExpression, String nextToken); @Override int performUpdate(String domainName, Map<String, Object> updateAttributes, String selectExpression); @Override int performDelete(String domainName, String selectExpression); @Override void close();  }