Skip to content

Instantly share code, notes, and snippets.

@pluto-atom-4
pluto-atom-4 / ByteBufferOperation.java
Created January 9, 2017 15:28
study Jmeter TLS sampler
package internal.example.net.ssl;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import static java.nio.charset.StandardCharsets.UTF_8;
/**
* Created by pluto-atom-4 on 1/7/17.
*/
{
"__inputs": [
{
"name": "DS_SAMPLE",
"label": "sample",
"description": "",
"type": "datasource",
"pluginId": "influxdb",
"pluginName": "InfluxDB"
}
package internal.example.after_x;
import org.testng.ITestResult;
import org.testng.Reporter;
import org.testng.annotations.AfterMethod;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
import java.util.Collections;
import java.util.HashMap;
from .test_list import TextsToBeInspect
def pytest_assertrepr_compare(op, left, right):
def details(*args):
details = []
details.append('----')
for i in args:
details.append('%s: ' % i.context)
details.extend([' %s' % i for i in i.texts])
@pluto-atom-4
pluto-atom-4 / AwaitilityDSLTest.java
Last active May 27, 2025 13:47
Example Awaitility + AssertJ + Rest Assured
package internal.example.awaitility;
import org.awaitility.Awaitility;
import org.junit.Before;
import org.junit.Test;
import static io.restassured.RestAssured.get;
import static java.util.concurrent.TimeUnit.MILLISECONDS;
import static java.util.concurrent.TimeUnit.SECONDS;
import static org.assertj.core.api.Assertions.assertThat;
package pramp.string;
import java.util.*;
public class WordCountEngine {
static String[][] count(String document) {
Map<String, Integer> map = new HashMap<>();
String[] tokens = document.toLowerCase().replaceAll("[^a-z ]", "").split("\\s+");
import java.io.*;
import java.util.*;
class BracketMatch {
static int bracketMatch(String text) {
if (text == null || text.isEmpty()) {
throw new IllegalArgumentException("Provide a text");
}
if (!text.replaceAll("[()]", "").isEmpty()) {
@pluto-atom-4
pluto-atom-4 / NioTest.java
Created December 14, 2018 14:05
Exercising Java NIO2
import org.junit.Test;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.OpenOption;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.FileAttribute;
@pluto-atom-4
pluto-atom-4 / CSVtoDynamoDB.json
Last active January 30, 2019 14:09
AWS Data Pipeline sample CSV on S3 to DynamoDB
{
"objects": [
{
"myComment" : "Activity used to run the hive script to import CSV data",
"output": {
"ref": "DataNodeId_cnlSW"
},
"input": {
"ref": "DataNodeId_1ERqq"
},

Tips for json 2 POJO

  • Lombok

  • Jackson

  • Use ** @JsonDesrialize ** @Value ** @Builder