Fix URL for test connection in Trello repository

This commit is contained in:
Mikhail Golubev
2014-12-24 20:18:52 +03:00
parent 9d4d642f75
commit bffcf4231f
2 changed files with 10 additions and 1 deletions
@@ -376,7 +376,7 @@ public final class TrelloRepository extends NewBaseRepositoryImpl {
@Nullable
@Override
public CancellableConnection createCancellableConnection() {
return new HttpTestConnection(new HttpGet(getRestApiUrl("me", "cards") + "?limit=1"));
return new HttpTestConnection(new HttpGet(getRestApiUrl("members", "me", "cards") + "?limit=1"));
}
/**
@@ -156,6 +156,15 @@ public class TrelloIntegrationTest extends LiveIntegrationTestCase<TrelloReposit
assertEquals(EnumSet.of(SKY, LIME, PINK, BLACK), card.getColors());
}
public void testTestConnection() throws Exception {
assertNull(myRepository.createCancellableConnection().call());
myRepository.setPassword("illegal password");
final Exception error = myRepository.createCancellableConnection().call();
assertNotNull(error);
assertTrue(error.getMessage().contains("Unauthorized"));
}
static void assertObjectsNamed(@NotNull String message, @NotNull Collection<? extends TrelloModel> objects, @NotNull String... names) {
assertEquals(message, ContainerUtil.newHashSet(names), ContainerUtil.map2Set(objects, new Function<TrelloModel, String>() {
@Override