Mock api to test dynamic routing
This commit is contained in:
@@ -67,13 +67,13 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.datatype</groupId>
|
||||
<artifactId>jackson-datatype-jsr310</artifactId>
|
||||
<version>2.13.0</version>
|
||||
<version>2.13.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.2.20</version>
|
||||
<version>42.3.6</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
|
||||
@@ -23,13 +23,13 @@
|
||||
<groupId>org.liquibase</groupId>
|
||||
<artifactId>liquibase-core</artifactId>
|
||||
<scope>runtime</scope>
|
||||
<version>4.3.5</version>
|
||||
<version>4.14.0</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.postgresql</groupId>
|
||||
<artifactId>postgresql</artifactId>
|
||||
<version>42.2.20</version>
|
||||
<version>42.3.6</version>
|
||||
</dependency>
|
||||
|
||||
</dependencies>
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
package com.navi.medici.controller;
|
||||
|
||||
import com.navi.medici.context.LitmusContext;
|
||||
import com.navi.medici.litmus.DefaultLitmus;
|
||||
import com.navi.medici.litmus.Litmus;
|
||||
import com.navi.medici.variants.Variant;
|
||||
import java.util.Random;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.log4j.Log4j2;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -31,4 +34,20 @@ public class MockController {
|
||||
log.info("response ===> {}", result.toString());
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping("/dynamic/mock")
|
||||
public String testDynamicRouting(@RequestParam("experiment") String experiment) {
|
||||
var context = LitmusContext.builder()
|
||||
.userId(" " +new Random().nextInt())
|
||||
.addProperty("pincode", "560034")
|
||||
.build();
|
||||
|
||||
var result = litmus.isEnabled(experiment, context);
|
||||
|
||||
var variant = litmus.getVariant(experiment, context);
|
||||
log.info("result ----> {}", result);
|
||||
|
||||
return "result ==> " + result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
server.port=11000
|
||||
|
||||
management.server.port=4001
|
||||
management.server.port=4002
|
||||
management.endpoints.web.exposure.include=prometheus,health,info,metric,heapdump,threaddump
|
||||
Reference in New Issue
Block a user