Skip to content

Commit 3ba62f4

Browse files
committed
hotfix: tests
1 parent 2f25100 commit 3ba62f4

1 file changed

Lines changed: 0 additions & 44 deletions

File tree

src/test/java/io/github/isagroup/PricingEvaluatorUtilTests.java

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
import java.util.Map;
66

77
import org.junit.jupiter.api.BeforeEach;
8-
import org.junit.jupiter.api.DisplayName;
98
import org.junit.jupiter.api.Test;
10-
import org.springframework.expression.spel.SpelEvaluationException;
119

1210
import io.github.isagroup.services.jwt.PricingJwtUtils;
1311

@@ -132,46 +130,4 @@ void tokenUserContextTest() {
132130
"UserContext havePetsDashboard value is not the same after token codification");
133131

134132
}
135-
136-
private class NoExpressionsInFeatures extends PricingContext {
137-
138-
@Override
139-
public String getConfigFilePath() {
140-
return "pricing/feature-inoperative-no-expression.yaml";
141-
}
142-
143-
@Override
144-
public String getJwtSecret() {
145-
return "Testing";
146-
}
147-
148-
@Override
149-
public Map<String, Object> getUserContext() {
150-
Map<String, Object> map = new HashMap<>();
151-
map.put("pets", 1);
152-
return map;
153-
}
154-
155-
@Override
156-
public String getUserPlan() {
157-
return "BASIC";
158-
}
159-
160-
}
161-
162-
@Test
163-
@DisplayName("Given a feature with no 'expression' should be disabled in the pricing token")
164-
void givenAFeatureWithNoExpressionShouldNotThrowWhenComputingUserToken() {
165-
166-
PricingContext context = new NoExpressionsInFeatures();
167-
PricingEvaluatorUtil pricingEvaluatorUtil = new PricingEvaluatorUtil(context);
168-
PricingJwtUtils pricingJwtUtils = new PricingJwtUtils(context);
169-
assertDoesNotThrow(() -> pricingEvaluatorUtil.generateUserToken());
170-
171-
Map<String, Map<String, Object>> featureStatuses = pricingJwtUtils
172-
.getFeaturesFromJwtToken(pricingEvaluatorUtil.generateUserToken());
173-
assertFalse((boolean) featureStatuses.get("support").get("eval"));
174-
175-
}
176-
177133
}

0 commit comments

Comments
 (0)