Some code for supporting chans
This commit is contained in:
@@ -39,7 +39,7 @@ import static ch.dissem.bitmessage.entity.payload.ObjectType.*;
|
||||
import static ch.dissem.bitmessage.utils.MessageMatchers.object;
|
||||
import static org.hamcrest.CoreMatchers.is;
|
||||
import static org.hamcrest.CoreMatchers.notNullValue;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.mockito.Matchers.any;
|
||||
import static org.mockito.Mockito.*;
|
||||
|
||||
@@ -206,4 +206,21 @@ public class BitmessageContextTest {
|
||||
.build();
|
||||
ctx.send(msg);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ensureChanIsJoined() {
|
||||
String chanAddress = "BM-2cW67GEKkHGonXKZLCzouLLxnLym3azS8r";
|
||||
BitmessageAddress chan = ctx.joinChan("general", chanAddress);
|
||||
assertNotNull(chan);
|
||||
assertEquals(chan.getAddress(), chanAddress);
|
||||
assertTrue(chan.isChan());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void ensureChanIsCreated() {
|
||||
BitmessageAddress chan = ctx.createChan("test");
|
||||
assertNotNull(chan);
|
||||
assertEquals(chan.getVersion(), Pubkey.LATEST_VERSION);
|
||||
assertTrue(chan.isChan());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,10 @@ import ch.dissem.bitmessage.entity.payload.Pubkey;
|
||||
import ch.dissem.bitmessage.entity.payload.V4Pubkey;
|
||||
import ch.dissem.bitmessage.entity.valueobject.PrivateKey;
|
||||
import ch.dissem.bitmessage.exception.DecryptionFailedException;
|
||||
import ch.dissem.bitmessage.utils.*;
|
||||
import ch.dissem.bitmessage.utils.Base58;
|
||||
import ch.dissem.bitmessage.utils.Bytes;
|
||||
import ch.dissem.bitmessage.utils.Strings;
|
||||
import ch.dissem.bitmessage.utils.TestUtils;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
Reference in New Issue
Block a user