### Question:
WeEventClient implements IWeEventClient { @Override public boolean open(String topic) throws BrokerException { validateParam(topic); HttpGet httpGet = new HttpGet(String.format("%s/open?topic=%s&groupId=%s", this.brokerRestfulUrl, encodeTopic(topic), this.groupId)); return this.httpClientHelper.invokeCGI(httpGet, new TypeReference<BaseResponse<Boolean>>() { }).getData(); } WeEventClient(String brokerUrl, String groupId, String userName, String password, int timeout); @Override boolean unSubscribe(String subscriptionId); @Override boolean open(String topic); @Override boolean close(String topic); @Override boolean exist(String topic); @Override TopicPage list(Integer pageIndex, Integer pageSize); @Override TopicInfo state(String topic); @Override WeEvent getEvent(String eventId); @Override SendResult publish(WeEvent weEvent); @Override CompletableFuture<SendResult> publishAsync(WeEvent weEvent); @Override String subscribe(String topic, String offset, Map<String, String> extension, @NonNull EventListener listener); @Override String subscribe(String[] topics, String offset, Map<String, String> extension, @NonNull EventListener listener); static SSLContext getSSLContext();  }### Answer:
@Test public void testOpen_topicOverMaxLen() { try { String topic = "topiclengthexceeding64-123456789012345678901234567890123456789012"; this.weEventClient.open(topic); Assert.fail(); } catch (BrokerException e) { Assert.assertEquals(e.getCode(), ErrorCode.TOPIC_EXCEED_MAX_LENGTH.getCode()); } }
@Test public void testOpen() throws Exception { boolean result = this.weEventClient.open(this.topicName); Assert.assertTrue(result); }
@Test public void testOpenChinese() throws Exception { try { this.weEventClient.open("中文"); Assert.fail(); } catch (BrokerException e) { Assert.assertEquals(e.getCode(), ErrorCode.TOPIC_CONTAIN_INVALID_CHAR.getCode()); } }