65
65
import static org .openlmis .requisition .validate .RequisitionTemplateDtoValidator .TOTAL_RECEIVED_QUANTITY ;
66
66
import static org .openlmis .requisition .validate .RequisitionTemplateDtoValidator .TOTAL_STOCKOUT_DAYS ;
67
67
68
+ import com .google .common .collect .Sets ;
68
69
import java .util .Optional ;
69
70
import java .util .Random ;
70
71
import java .util .UUID ;
71
72
72
73
import org .apache .commons .lang .RandomStringUtils ;
73
- import org .javers .common .collections .Sets ;
74
74
import org .junit .Test ;
75
75
import org .junit .runner .RunWith ;
76
76
import org .mockito .InjectMocks ;
@@ -186,7 +186,7 @@ public void shouldNotRejectWhenConsumptionsInTemplateAndStockoutDaysInTemplate()
186
186
.withIndicator ("X" )
187
187
.withColumnDefinition (new AvailableRequisitionColumnDataBuilder ()
188
188
.withName (TOTAL_STOCKOUT_DAYS )
189
- .withSources (Sets .asSet (USER_INPUT ))
189
+ .withSources (Sets .newHashSet (USER_INPUT ))
190
190
.withoutOptions ()
191
191
.build ())
192
192
.withSource (USER_INPUT )
@@ -223,7 +223,7 @@ public void shouldNotRejectWhenConsumptionsAndConsumedQuantityAreInTemplate() {
223
223
.withIndicator ("X" )
224
224
.withColumnDefinition (new AvailableRequisitionColumnDataBuilder ()
225
225
.withName (TOTAL_STOCKOUT_DAYS )
226
- .withSources (Sets .asSet (USER_INPUT ))
226
+ .withSources (Sets .newHashSet (USER_INPUT ))
227
227
.withoutOptions ()
228
228
.build ())
229
229
.withSource (USER_INPUT )
@@ -289,7 +289,7 @@ public void shouldNotRejectWhenAverageConsumptionIsDisplayedAndStockoutDaysIsDis
289
289
.withNotDisplayed ()
290
290
.withColumnDefinition (new AvailableRequisitionColumnDataBuilder ()
291
291
.withName (TOTAL_STOCKOUT_DAYS )
292
- .withSources (Sets .asSet (STOCK_CARDS ))
292
+ .withSources (Sets .newHashSet (STOCK_CARDS ))
293
293
.withOptions (singleton (option ))
294
294
.build ())
295
295
.withSource (STOCK_CARDS )
@@ -599,15 +599,15 @@ private RequisitionTemplateDataBuilder baseTemplateBuilder() {
599
599
return new RequisitionTemplateDataBuilder ()
600
600
.withRequiredColumns ()
601
601
.withColumn (TOTAL_CONSUMED_QUANTITY , "C" , USER_INPUT ,
602
- Sets .asSet (USER_INPUT , CALCULATED ))
602
+ Sets .newHashSet (USER_INPUT , CALCULATED ))
603
603
.withColumn (STOCK_ON_HAND , "E" , USER_INPUT ,
604
- Sets .asSet (USER_INPUT , CALCULATED ))
604
+ Sets .newHashSet (USER_INPUT , CALCULATED ))
605
605
.withColumn (BEGINNING_BALANCE , "A" , USER_INPUT ,
606
- Sets .asSet (USER_INPUT ))
606
+ Sets .newHashSet (USER_INPUT ))
607
607
.withColumn (COLUMN_NAME , "T" , USER_INPUT ,
608
- Sets .asSet (USER_INPUT ))
608
+ Sets .newHashSet (USER_INPUT ))
609
609
.withColumn (ADDITIONAL_QUANTITY_REQUIRED , "Z" , USER_INPUT ,
610
- Sets .asSet (USER_INPUT ), false )
610
+ Sets .newHashSet (USER_INPUT ), false )
611
611
.withAssignment (UUID .randomUUID (), UUID .randomUUID (), new Random ().nextBoolean ());
612
612
}
613
613
@@ -621,11 +621,11 @@ private RequisitionTemplateDto generateTemplate() {
621
621
private RequisitionTemplateDto getTemplatePopulatedByStock () {
622
622
RequisitionTemplate template = baseTemplateBuilder ()
623
623
.withColumn (TOTAL_RECEIVED_QUANTITY , "B" , USER_INPUT ,
624
- Sets .asSet (USER_INPUT ))
624
+ Sets .newHashSet (USER_INPUT ))
625
625
.withColumn (TOTAL_LOSSES_AND_ADJUSTMENTS , "D" , STOCK_CARDS ,
626
- Sets .asSet (STOCK_CARDS ))
626
+ Sets .newHashSet (STOCK_CARDS ))
627
627
.withColumn (TOTAL_STOCKOUT_DAYS , "X" , STOCK_CARDS ,
628
- Sets .asSet (STOCK_CARDS ))
628
+ Sets .newHashSet (STOCK_CARDS ))
629
629
.withPopulateStockOnHandFromStockCards ()
630
630
.build ();
631
631
@@ -651,11 +651,11 @@ private RequisitionTemplateDto getTemplatePopulatedByStock() {
651
651
private RequisitionTemplateDto addAdjustedConsumptionToColumnsMapAndGetRequisitionTemplate () {
652
652
RequisitionTemplate template = baseTemplateBuilder ()
653
653
.withColumn (TOTAL_CONSUMED_QUANTITY , "X" , USER_INPUT ,
654
- Sets .asSet (USER_INPUT ))
654
+ Sets .newHashSet (USER_INPUT ))
655
655
.withColumn (ADJUSTED_CONSUMPTION , "N" , CALCULATED ,
656
- Sets .asSet (CALCULATED ))
656
+ Sets .newHashSet (CALCULATED ))
657
657
.withColumn (AVERAGE_CONSUMPTION , "P" , CALCULATED ,
658
- Sets .asSet (CALCULATED ))
658
+ Sets .newHashSet (CALCULATED ))
659
659
.build ();
660
660
661
661
@@ -676,11 +676,11 @@ private RequisitionTemplateDto mockMessageAndGetRequisitionTemplate(String messa
676
676
private RequisitionTemplateDto getRequisitionTemplateForTestAdjustedAndAverageConsumptionField () {
677
677
RequisitionTemplate template = baseTemplateBuilder ()
678
678
.withColumn (TOTAL_STOCKOUT_DAYS , "X" , USER_INPUT ,
679
- Sets .asSet (USER_INPUT ))
679
+ Sets .newHashSet (USER_INPUT ))
680
680
.withColumn (ADJUSTED_CONSUMPTION , "N" , CALCULATED ,
681
- Sets .asSet (CALCULATED ))
681
+ Sets .newHashSet (CALCULATED ))
682
682
.withColumn (AVERAGE_CONSUMPTION , "P" , CALCULATED ,
683
- Sets .asSet (CALCULATED ))
683
+ Sets .newHashSet (CALCULATED ))
684
684
.build ();
685
685
686
686
RequisitionTemplateDto dto = buildDto (template );
0 commit comments