-
Notifications
You must be signed in to change notification settings - Fork 42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
332 comsngularkloadgenserializerprotobufserializer nullpointerexception #355
332 comsngularkloadgenserializerprotobufserializer nullpointerexception #355
Conversation
Added a trim statement to avoid problem when cast the schemas from classpath
Removed some unused test files
…rializer-nullpointerexception
Apparently the original project was renamed into cmak to avoid break the TOS of kafka having the kafka in the name of unofficial tool
…genserializerprotobufserializer-nullpointerexception # Conflicts: # pom.xml # src/main/java/com/sngular/kloadgen/sampler/SamplerUtil.java # src/test/resources/mappings/schema_registry_stub.json
final var importSchema = JMeterHelper.getParsedSchema(getSubjectName(importedClass, metadata), JMeterContextService.getContext().getProperties()); | ||
if (!ProtobufHelper.NOT_ACCEPTED_IMPORTS.contains(importedClass)) { | ||
schemaBuilder.addDependency(((ProtobufSchema) importSchema).toDescriptor().getFullName()); | ||
schemaBuilder.addSchema(convertDynamicSchema((ProtobufSchema) importSchema)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not an error, but I think it would be cleaner to create a variable to hold the value of importSchema because that way you avoid to do the cast several times.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
@@ -295,7 +326,7 @@ private static void extracted( | |||
msgDef.addField("repeated", "typemapnumber" + elementField.getName(), elementField.getName(), elementField.getTag()); | |||
|
|||
msgDef.addMessageDefinition( | |||
MessageDefinition.newBuilder("typemapnumber" + elementField.getName()).addField(OPTIONAL, "string", "key", 1).addField(OPTIONAL, realType, "value", 2).build()); | |||
MessageDefinition.newBuilder("typemapnumber" + elementField.getName()).addField(OPTIONAL, "string", "key", 1).addField(OPTIONAL, realType, "value", 2).build()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You use the value of "typemapnumber" several times, so it would be nice to create a variable with that value.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems good
src/main/java/com/sngular/kloadgen/processor/util/SchemaProcessorUtils.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me it's ok.
Protobuf Schemas import fixed