Skip to content

Commit

Permalink
Fix Codacy checstyle errors detected
Browse files Browse the repository at this point in the history
  • Loading branch information
GraciMndzSNG committed Oct 16, 2023
1 parent e7d178c commit 8086f0b
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Properties;

import com.sngular.kloadgen.common.SchemaRegistryEnum;
Expand All @@ -21,11 +20,11 @@
import org.apache.jmeter.threads.JMeterContextService;

public final class ExtractorFactory {
private static final AvroExtractor avroExtractor = new AvroExtractor();
private static final AvroExtractor Avroextractor = new AvroExtractor();

private static final JsonExtractor jsonExtractor = new JsonExtractor();
private static final JsonExtractor Jsonextractor = new JsonExtractor();

private static final ProtobuffExtractor protobuffExtractor = new ProtobuffExtractor();
private static final ProtobuffExtractor Protobuffextractor = new ProtobuffExtractor();

private ExtractorFactory() {
}
Expand All @@ -36,13 +35,12 @@ public static ExtractorRegistry getExtractor(final String schemaType) {
final ExtractorRegistry response;
switch (SchemaTypeEnum.valueOf(schemaType.toUpperCase())) {
case JSON:
response = jsonExtractor;
break;
case AVRO:
response = avroExtractor;
response = Jsonextractor;
break; case AVRO:
response = Avroextractor;
break;
case PROTOBUF:
response = protobuffExtractor;
response = Protobuffextractor;
break;
default:
throw new KLoadGenException(String.format("Schema type not supported %s", schemaType));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public final List<FieldValueMapping> processSchema(final Object schema, SchemaRe
return schemaRegistryMap.get(registryEnum).processSchema(schema);
}

public final ParsedSchema processSchema(String fileContent) {
public final ParsedSchema processSchema(final String fileContent) {
return new AvroSchema(fileContent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public final List<FieldValueMapping> processSchema(final Object schemaReceived,
return schemaRegistryMap.get(registryEnum).processSchema(schemaReceived);
}

public final ParsedSchema processSchema(String fileContent) {
public final ParsedSchema processSchema(final String fileContent) {
return new JsonSchema(fileContent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public final List<FieldValueMapping> processSchema(final Object schemaReceived,
return schemaRegistryMap.get(registryEnum).processSchema(schemaReceived);
}

public final ParsedSchema processSchema(String fileContent) {
public final ParsedSchema processSchema(final String fileContent) {
return new ProtobufSchema(fileContent);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.sngular.kloadgen.model.FieldValueMapping;
import com.sngular.kloadgen.util.PropsKeysHelper;
import io.confluent.kafka.schemaregistry.ParsedSchema;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFileChooser;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import com.sngular.kloadgen.randomtool.random.RandomObject;
import com.sngular.kloadgen.randomtool.random.RandomSequence;
import org.apache.commons.lang3.RandomUtils;

import static com.sngular.kloadgen.randomtool.util.ValueUtils.replaceValuesContext;

public class ProtoBufGeneratorTool {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ private Boolean enrichedValueFlag() {
}

private void fillSamplerResult(final ProducerRecord<Object, Object> producerRecord, final SampleResult sampleResult) {
String result = "key: " + producerRecord.key() +
final String result = "key: " +
producerRecord.key() +
", payload: " + producerRecord.value();
sampleResult.setSamplerData(result);
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/com/sngular/kloadgen/util/JMeterHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import java.util.Properties;

import com.sngular.kloadgen.exception.KLoadGenException;
import com.sngular.kloadgen.schemaregistry.SchemaRegistryAdapter;
import com.sngular.kloadgen.schemaregistry.SchemaRegistryManagerFactory;
import com.sngular.kloadgen.schemaregistry.adapter.impl.BaseParsedSchema;
Expand Down

0 comments on commit 8086f0b

Please sign in to comment.