Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import com.networknt.aws.lambda.handler.Handler;
import com.networknt.aws.lambda.handler.chain.Chain;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.util.SetSystemProperty;

@SetSystemProperty(key = "light_4j_config_password", value = "light")
public class CacheExplorerHandlerTest {
@Test
public void testGetCacheJwk() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import com.networknt.aws.lambda.LightLambdaExchange;
import com.networknt.aws.lambda.app.LambdaApp;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.util.SetSystemProperty;

@SetSystemProperty(key = "light_4j_config_password", value = "light")
class HealthCheckHandlerTest {
@Test
void testHealthCheck() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import com.networknt.aws.lambda.LightLambdaExchange;
import com.networknt.aws.lambda.app.LambdaApp;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.util.SetSystemProperty;

@SetSystemProperty(key = "light_4j_config_password", value = "light")
public class LoggerHandlerTest {
@Test
void testGetLogger() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import com.networknt.aws.lambda.LightLambdaExchange;
import com.networknt.aws.lambda.app.LambdaApp;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.util.SetSystemProperty;

@SetSystemProperty(key = "light_4j_config_password", value = "light")
public class ServerInfoHandlerTest {
@Test
public void testServerInfo() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@

import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.util.SetSystemProperty;

@SetSystemProperty(key = "light_4j_config_password", value = "light")
public class HandlerTest {
@Test
public void testInitHandler() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import com.networknt.aws.lambda.utility.HeaderKey;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.util.SetSystemProperty;

@SetSystemProperty(key = "light_4j_config_password", value = "light")
public class AuditMiddlewareTest {
@Test
public void testAuditMiddleware() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@
import com.networknt.cors.CorsConfig;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.util.SetSystemProperty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.Map;

import static com.networknt.cors.CorsHeaders.ORIGIN;

@SetSystemProperty(key = "light_4j_config_password", value = "light")
public class CorsMiddlewareTest {
private static final Logger LOG = LoggerFactory.getLogger(CorsMiddlewareTest.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import com.networknt.utility.MapUtil;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.util.SetSystemProperty;

@SetSystemProperty(key = "light_4j_config_password", value = "light")
public class ResponseHeaderMiddlewareTest {
@Test
void testResponseHeaderRemoveUpdate() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
import com.networknt.aws.lambda.utility.HeaderKey;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.util.SetSystemProperty;

@SetSystemProperty(key = "light_4j_config_password", value = "light")
public class APMMetricsMiddlewareTest {
@Test
public void testAPMMetricsMiddleware() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
import com.networknt.status.Status;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.util.SetSystemProperty;

@SetSystemProperty(key = "light_4j_config_password", value = "light")
public class ApiKeyMiddlewareTest {
/**
* Test with a path that is in the apikey pathPrefixAuths definition. We are expecting return OK.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@
import org.apache.commons.codec.binary.Base64;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.util.SetSystemProperty;

import static java.nio.charset.StandardCharsets.UTF_8;

@SetSystemProperty(key = "light_4j_config_password", value = "light")
public class BasicAnonymousBearerTest {

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import org.apache.commons.codec.binary.Base64;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.util.SetSystemProperty;
import ch.qos.logback.classic.Logger;
import ch.qos.logback.classic.spi.ILoggingEvent;
import ch.qos.logback.core.read.ListAppender;
Expand All @@ -29,6 +30,7 @@
import static com.networknt.aws.lambda.handler.middleware.audit.AuditMiddleware.AUDIT_ATTACHMENT_KEY;
import static java.nio.charset.StandardCharsets.UTF_8;

@SetSystemProperty(key = "light_4j_config_password", value = "light")
public class BasicAuthMiddlewareTest {

private static String encodeCredentialsFullFormat(String username, String password, String separator) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
import com.networknt.status.Status;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.util.SetSystemProperty;

@SetSystemProperty(key = "light_4j_config_password", value = "light")
public class BasicBearerNoUserTest {
/**
* Test with Bearer header and wrong path. Expect 401 status code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
import com.networknt.aws.lambda.app.LambdaApp;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.util.SetSystemProperty;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.HashMap;
import java.util.Map;

@SetSystemProperty(key = "light_4j_config_password", value = "light")
public class ResponseTransformerMiddlewareTest {
private static final Logger LOG = LoggerFactory.getLogger(ResponseTransformerMiddlewareTest.class);
LightLambdaExchange exchange;
Expand Down
Loading