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 util | |
import org.junit.jupiter.api.Test | |
import strikt.api.Assertion | |
import strikt.api.expectThat | |
import strikt.assertions.contentEquals | |
import strikt.assertions.isEqualTo | |
import java.beans.Introspector | |
import java.util.* | |
import kotlin.reflect.KProperty1 |
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
import kotlin.annotation.AnnotationTarget.CLASS | |
@Target(CLASS) | |
annotation class JsonValidated |
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
import java.io.IOException; | |
public class IgnoreExtraWrappedRootJsonParser extends JsonParserDelegate { | |
private final String rootName; | |
public IgnoreExtraWrappedRootJsonParser(JsonParser delegate, JavaType rootType) { | |
super(delegate); | |
JsonRootName jsonRootName = rootType.getRawClass().getAnnotation(JsonRootName.class); | |
rootName = jsonRootName == null ? null : "/" + jsonRootName.value(); |
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
public class DatadogApiKeyPrefixEncoder extends EncoderBase<ILoggingEvent> { | |
private static final byte[] EMPTY = new byte[0]; | |
private final byte[] apiKey; | |
@SuppressFBWarnings({"EI_EXPOSE_REP2", "WEM_WEAK_EXCEPTION_MESSAGING"}) | |
public DatadogApiKeyPrefixEncoder(byte[] apiKey) { | |
if (apiKey == null || apiKey.length == 0) { | |
throw new IllegalArgumentException("DataDog API key must not be empty."); |
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
FROM centos:7 | |
RUN cd /tmp && \ | |
curl "https://download.java.net/java/GA/jdk10/10.0.1/fb4372174a714e6b8c52526dc134031e/10/openjdk-10.0.1_linux-x64_bin.tar.gz" -o "openjdk-10_bin.tar.gz" -s && \ | |
tar xzf openjdk-10_bin.tar.gz && \ | |
mv jdk-10.0.1 /usr/local/jdk-10 && \ | |
rm /usr/local/jdk-10/lib/src.zip && \ | |
alternatives --install /usr/bin/java java /usr/local/jdk-10/bin/java 1 && \ | |
alternatives --install /usr/bin/javac javac /usr/local/jdk-10/bin/javac 1 && \ | |
alternatives --install /usr/bin/keytool keytool /usr/local/jdk-10/bin/keytool 1 && \ |
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
@Target(PARAMETER) | |
@Retention(RUNTIME) | |
@BindingAnnotation | |
public @interface Disabled {} |
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
public class PublishingInMemoryFeatureStore extends InMemoryFeatureStore { | |
@Override | |
public <T extends VersionedData> void upsert(VersionedDataKind<T> kind, T item) { | |
String key = item.getKey(); | |
T current = get(kind, key); | |
super.upsert(kind, item); | |
T updated = get(kind, key); | |
if (!Objects.equals(current, updated)) { | |
// do publish |
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
import com.google.inject.BindingAnnotation; | |
import java.lang.annotation.Retention; | |
import java.lang.annotation.Target; | |
import static java.lang.annotation.ElementType.PARAMETER; | |
import static java.lang.annotation.RetentionPolicy.RUNTIME; | |
@Target(PARAMETER) | |
@Retention(RUNTIME) | |
@BindingAnnotation |
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
import com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper; | |
import com.amazonaws.services.dynamodbv2.datamodeling.IDynamoDBMapper; | |
import com.amazonaws.services.dynamodbv2.model.AttributeDefinition; | |
import com.amazonaws.services.dynamodbv2.model.CreateTableRequest; | |
import com.amazonaws.services.dynamodbv2.model.GlobalSecondaryIndex; | |
import com.amazonaws.services.dynamodbv2.model.KeySchemaElement; | |
import java.util.Map; | |
import static com.google.common.base.CaseFormat.*; | |
import static java.lang.System.out; |
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
webhookListenerCache: | |
Type: AWS::ElastiCache::CacheCluster | |
Properties: | |
ClusterName: ${self:custom.stage}-shopify-wh-listen | |
CacheNodeType: cache.t2.medium | |
CacheSubnetGroupName: ${self:custom.stage} | |
Engine: Redis | |
EngineVersion: 3.2.4 | |
NumCacheNodes: 1 | |
VpcSecurityGroupIds: ${self:custom.vpc.securityGroupIds} |
NewerOlder