This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ mvn clean install | |
[INFO] Scanning for projects... | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] Reactor Build Order: | |
[INFO] | |
[INFO] owasp-repositories-example [pom] | |
[INFO] child [jar] | |
[INFO] | |
[INFO] -------------< io.github.srdo:owasp-repositories-example >-------------- | |
[INFO] Building owasp-repositories-example 1.0-SNAPSHOT [1/2] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Licensed to the Apache Software Foundation (ASF) under one | |
# or more contributor license agreements. See the NOTICE file | |
# distributed with this work for additional information | |
# regarding copyright ownership. The ASF licenses this file | |
# to you under the Apache License, Version 2.0 (the | |
# "License"); you may not use this file except in compliance | |
# with the License. You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Properties props = new Properties(); | |
props.put("bootstrap.servers", "localhost:9092"); | |
props.put("group.id", "consumer-test"); | |
props.put("enable.auto.commit", "false"); | |
props.put(ConsumerConfig.MAX_POLL_RECORDS_CONFIG, 1); | |
props.put("key.deserializer", "org.apache.kafka.common.serialization.StringDeserializer"); | |
props.put("value.deserializer", "org.apache.kafka.common.serialization.StringDeserializer"); | |
KafkaConsumer<String, String> consumer = new KafkaConsumer<>(props); | |
Set<TopicPartition> assignedPartitions = Collections.singleton(new TopicPartition(TOPIC, 0)); | |
consumer.assign(assignedPartitions); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.mycompany.scratch; | |
public class NewClass2 { | |
public static class BrokenClass { | |
public static final BrokenClass instance = new BrokenClass(); | |
private BrokenClass() { | |
throw new RuntimeException("Broken"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.schneiderelectric.test2; | |
import com.fasterxml.jackson.annotation.JsonProperty; | |
import com.fasterxml.jackson.databind.ObjectMapper; | |
import java.io.ByteArrayOutputStream; | |
import java.io.ObjectOutputStream; | |
import java.io.Serializable; | |
import java.nio.charset.StandardCharsets; | |
import java.time.Instant; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set<String> myStrings = new HashSet<>(); | |
myStrings.add("abc"); | |
myStrings.add("def"); | |
Collection<String> otherStrings = new ArrayList<>(); | |
otherStrings.add("def"); | |
assertThat("Expected unequal sets", otherStrings, not(containsInAnyOrder(myStrings))); | |
otherStrings.add("abc"); | |
assertThat("Expected equal sets", otherStrings, containsInAnyOrder(myStrings)); | |
//Fails on the second assert, prints the missing entry in the assertion error |