Skip to content

Commit

Permalink
CIRCSTORE-540: removed unnecessary log and code
Browse files Browse the repository at this point in the history
  • Loading branch information
kapil-epam committed Dec 16, 2024
1 parent 15344f5 commit c70e263
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

public class ItemUpdateEventHandler implements AsyncRecordHandler<String, String> {
private final Context context;
private static final Logger log = getLogger(ItemUpdateEventHandler.class);
public ItemUpdateEventHandler(Context context) {
this.context = context;
}
Expand All @@ -28,7 +27,6 @@ public Future<String> handle(KafkaConsumerRecord<String, String> kafkaConsumerRe
JsonObject payload = new JsonObject(kafkaConsumerRecord.value());
CaseInsensitiveMap<String, String> headers =
new CaseInsensitiveMap<>(kafkaHeadersToMap(kafkaConsumerRecord.headers()));
log.info("ItemUpdateEventHandler :: handle() :: kafkaHeaders: {}", headers);
ItemUpdateProcessorForRequest itemUpdateProcessorForRequest =
new ItemUpdateProcessorForRequest(new RequestRepository(context, headers), new InventoryStorageClient(context.owner(), headers));

Expand Down
13 changes: 1 addition & 12 deletions src/test/java/org/folio/rest/api/EventConsumerVerticleTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -648,21 +648,10 @@ private void publishEvent(String topic, JsonObject eventPayload) {
var record = KafkaProducerRecord.create(topic, "test-key", eventPayload);
record.addHeader(OKAPI_TENANT_HEADER, TENANT_ID);
record.addHeader(OKAPI_URL_HEADER, "http://localhost:" + PROXY_PORT);
record.addHeader(OKAPI_HEADER_TOKEN, "123");
record.addHeader(OKAPI_HEADER_TOKEN, "RANDOM_TOKEN");
waitFor(producer.write(record));
}

private static String generateToken() {
final String payload = new JsonObject()
.put("user_id", randomId())
.put("tenant", TENANT_ID)
.put("sub", "admin")
.toString();

return format("1.%s.3", Base64.getEncoder()
.encodeToString(payload.getBytes()));
}

private static JsonObject buildUpdateEvent(JsonObject oldVersion, JsonObject newVersion) {
return new JsonObject()
.put("tenant", TENANT_ID)
Expand Down

0 comments on commit c70e263

Please sign in to comment.