test_class.declarator: groupId = WeEvent.DEFAULT_GROUP_ID
test_class.modifier: private
test_class.original_string: private String groupId = WeEvent.DEFAULT_GROUP_ID;
test_class.type: String
test_class.var_name: groupId
test_class.declarator: topicName = "com.weevent.test"
test_class.modifier: private
test_class.original_string: private String topicName = "com.weevent.test";
test_class.type: String
test_class.var_name: topicName
test_class.declarator: contractContext
test_class.modifier: private
test_class.original_string: private ContractContext contractContext;
test_class.type: ContractContext
test_class.var_name: contractContext
test_class.declarator: iProducer
test_class.modifier: private
test_class.original_string: private IProducer iProducer;
test_class.type: IProducer
test_class.var_name: iProducer
test_class.declarator: fiscoConfig
test_class.modifier: private
test_class.original_string: private FiscoConfig fiscoConfig;
test_class.type: FiscoConfig
test_class.var_name: fiscoConfig
test_class.declarator: fiscoBcosDelegate
test_class.modifier: private
test_class.original_string: private FiscoBcosDelegate fiscoBcosDelegate;
test_class.type: FiscoBcosDelegate
test_class.var_name: fiscoBcosDelegate
test_class.declarator: transactionTimeout = 30000
test_class.modifier: private
test_class.original_string: private long transactionTimeout = 30000;
test_class.type: long
test_class.var_name: transactionTimeout
test_class.file: weevent-core/src/test/java/com/webank/weevent/core/fisco/FiscoBcosBroker4ProducerTest.java
test_class.identifier: FiscoBcosBroker4ProducerTest
test_class.superclass: extends JUnitTestBase
test_case.body: @Test
      public void testPublishTopicContainChineseChar() {
          try {
              byte[] bytes = "".getBytes();
              this.iProducer.publish(new WeEvent("中国", bytes), this.groupId);
          } catch (BrokerException e) {
              Assert.assertEquals(ErrorCode.TOPIC_CONTAIN_INVALID_CHAR.getCode(), e.getCode());
          }
      }
test_case.class_method_signature: FiscoBcosBroker4ProducerTest.testPublishTopicContainChineseChar()
test_case.full_signature: @Test public void testPublishTopicContainChineseChar()
test_case.identifier: testPublishTopicContainChineseChar
test_case.invocations: getBytes publish assertEquals getCode getCode
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testPublishTopicContainChineseChar()
focal_class.file: weevent-core/src/main/java/com/webank/weevent/core/fisco/FiscoBcosBroker4Producer.java
focal_class.identifier: FiscoBcosBroker4Producer
focal_class.interfaces: implements IProducer
focal_class.class_method_signature: FiscoBcosBroker4Producer.FiscoBcosBroker4Producer(FiscoBcosDelegate fiscoBcosDelegate)
focal_class.full_signature: public  FiscoBcosBroker4Producer(FiscoBcosDelegate fiscoBcosDelegate)
focal_class.identifier: FiscoBcosBroker4Producer
focal_class.modifiers: public
focal_class.parameters: (FiscoBcosDelegate fiscoBcosDelegate)
focal_class.signature:  FiscoBcosBroker4Producer(FiscoBcosDelegate fiscoBcosDelegate)
focal_class.class_method_signature: FiscoBcosBroker4Producer.startProducer()
focal_class.full_signature: @Override public boolean startProducer()
focal_class.identifier: startProducer
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean startProducer()
focal_class.class_method_signature: FiscoBcosBroker4Producer.shutdownProducer()
focal_class.full_signature: @Override public boolean shutdownProducer()
focal_class.identifier: shutdownProducer
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: boolean
focal_class.signature: boolean shutdownProducer()
focal_class.class_method_signature: FiscoBcosBroker4Producer.publish(WeEvent event, String groupIdStr)
focal_class.full_signature: @Override public CompletableFuture<SendResult> publish(WeEvent event, String groupIdStr)
focal_class.identifier: publish
focal_class.modifiers: @Override public
focal_class.parameters: (WeEvent event, String groupIdStr)
focal_class.return: CompletableFuture<SendResult>
focal_class.signature: CompletableFuture<SendResult> publish(WeEvent event, String groupIdStr)
focal_class.superclass: extends FiscoBcosTopicAdmin
focal_method.body: @Override
      public CompletableFuture<SendResult> publish(WeEvent event, String groupIdStr) throws BrokerException {
          log.debug("publish {} groupId: {}", event, groupIdStr);
  
          String groupId = selectGroupId(groupIdStr);
          this.validateGroupId(groupId);
          ParamCheckUtils.validateEvent(event);
  
          // publishEvent support async operator in callback
          if (event.getExtensions().containsKey(WeEvent.WeEvent_SIGN)) {
              return fiscoBcosDelegate.sendRawTransaction(event.getTopic(),
                      Long.parseLong(groupId),
                      new String(event.getContent(), StandardCharsets.UTF_8));
          } else {
              if (event.getExtensions().containsKey(WeEvent.WeEvent_EPHEMERAL)) {
                  log.info("ephemeral event");
                  return fiscoBcosDelegate.sendAMOP(event.getTopic(), Long.parseLong(groupId), JsonHelper.object2Json(event));
              } else {
                  return fiscoBcosDelegate.publishEvent(event.getTopic(),
                          Long.parseLong(groupId),
                          new String(event.getContent(), StandardCharsets.UTF_8),
                          JsonHelper.object2Json(event.getExtensions()));
              }
          }
      }
focal_method.class_method_signature: FiscoBcosBroker4Producer.publish(WeEvent event, String groupIdStr)
focal_method.full_signature: @Override public CompletableFuture<SendResult> publish(WeEvent event, String groupIdStr)
focal_method.identifier: publish
focal_method.invocations: debug selectGroupId validateGroupId validateEvent containsKey getExtensions sendRawTransaction getTopic parseLong getContent containsKey getExtensions info sendAMOP getTopic parseLong object2Json publishEvent getTopic parseLong getContent object2Json getExtensions
focal_method.modifiers: @Override public
focal_method.parameters: (WeEvent event, String groupIdStr)
focal_method.return: CompletableFuture<SendResult>
focal_method.signature: CompletableFuture<SendResult> publish(WeEvent event, String groupIdStr)