Skip to content

Commit 46bba35

Browse files
committed
fix: management of undefined billing
1 parent 7273a3e commit 46bba35

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/main/java/io/github/isagroup/services/parsing/PricingManagerParser.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,10 @@ private static void setBasicAttributes(Map<String, Object> yamlConfigMap, Pricin
204204
}
205205

206206
pricingManager.setBilling(parsedBilling);
207+
}else{
208+
Map<String, Double> billingMap = new LinkedHashMap<>();
209+
billingMap.put("monthly", 1.0);
210+
pricingManager.setBilling(billingMap);
207211
}
208212

209213
}

src/test/java/io/github/isagroup/parsing/positive/PricingManagerParserTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ void givenAMapOfBillingShouldParseIt() {
4040

4141
@Test
4242
@DisplayName(value = "Given no 'billing' by default should set a 'monthly: 1'")
43-
@Disabled
4443
void givenNoBillingADefaultMonthlyValueShouldBeSet() {
4544

4645
PricingManager pricingManager = YamlUtils.retrieveManagerFromYaml(TEST_CASES + "billing/no-billing-set.yml");
@@ -51,7 +50,6 @@ void givenNoBillingADefaultMonthlyValueShouldBeSet() {
5150

5251
@Test
5352
@DisplayName(value = "Given a single entry in 'billing' map should parse it")
54-
@Disabled
5553
void givenBillingOneEntryShouldParse() {
5654

5755
PricingManager pricingManager = YamlUtils

0 commit comments

Comments
 (0)