public TopicWithSchema createTopic(TopicWithSchema topicWithSchema) { if (endpoints.findTopics(topicWithSchema, topicWithSchema.isTrackingEnabled()).contains(topicWithSchema.getQualifiedName())) { return topicWithSchema; } assertThat(endpoints.topic().create(topicWithSchema).getStatus()).isEqualTo(CREATED.getStatusCode()); wait.untilTopicCreated(topicWithSchema); return topicWithSchema; }
public TopicWithSchema createTopic(TopicWithSchema topicWithSchema) { if (endpoints.findTopics(topicWithSchema, topicWithSchema.isTrackingEnabled()).contains(topicWithSchema.getQualifiedName())) { return topicWithSchema; } assertThat(endpoints.topic().create(topicWithSchema).getStatus()).isEqualTo(CREATED.getStatusCode()); wait.untilTopicCreated(topicWithSchema); return topicWithSchema; }
private void registerAvroSchema(boolean shouldRegister, TopicWithSchema topicWithSchema, String createdBy) { if (shouldRegister) { try { schemaService.registerSchema(topicWithSchema.getTopic(), topicWithSchema.getSchema(), true); } catch (Exception e) { logger.error("Rolling back topic {} creation due to schema registration error", topicWithSchema.getQualifiedName(), e); removeTopic(topicWithSchema.getTopic(), createdBy); throw e; } } }
private Topic convertToTopic() { return new Topic(this.getQualifiedName(), this.getDescription(), this.getOwner(), this.getRetentionTime(), this.isJsonToAvroDryRunEnabled(), this.getAck(), this.isTrackingEnabled(), this.wasMigratedFromJsonType(), this.isSchemaVersionAwareSerializationEnabled(), this.getContentType(), this.getMaxMessageSize(), this.getPublishingAuth(), this.isSubscribingRestricted(), this.getOfflineStorage()); }