Skip to content

Commit 5400e0b

Browse files
committed
fix tests
1 parent 086ef37 commit 5400e0b

File tree

4 files changed

+30
-30
lines changed

4 files changed

+30
-30
lines changed

iabgpp-encoder/src/test/java/com/iab/gpp/encoder/GppModelTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -615,29 +615,29 @@ public void testDecodeUspv1AndTcfEuV2AndTcfCaV1() {
615615
Assertions.assertEquals(413, tcfCaV1Section.getVendorListVersion());
616616
Assertions.assertEquals(true, tcfCaV1Section.getUseNonStandardStacks());
617617
Assertions.assertTrue(tcfCaV1Section.getSpecialFeatureExpressConsent().intStream().anyMatch(x -> x== 7));
618-
Assertions.assertEquals(Set.of(6, 7, 8, 9, 10, 11),
618+
Assertions.assertEquals(Set.of(7, 8, 9, 10, 11, 12),
619619
tcfCaV1Section.getSpecialFeatureExpressConsent());
620620
Assertions
621621
.assertEquals(
622-
Set.of(0, 1, 2, 3, 4, 5, 12, 13, 14, 15, 16, 17),
622+
Set.of(1, 2, 3, 4, 5, 6, 13, 14, 15, 16, 17, 18),
623623
tcfCaV1Section.getPurposesExpressConsent());
624624
Assertions
625625
.assertEquals(
626-
Set.of(6, 7, 8, 9, 10, 11, 18, 19, 20, 21, 22, 23),
626+
Set.of(7, 8, 9, 10, 11, 12, 19, 20, 21, 22, 23, 24),
627627
tcfCaV1Section.getPurposesImpliedConsent());
628628
Assertions.assertEquals(Set.of(12, 24, 48), tcfCaV1Section.getVendorExpressConsent());
629629
Assertions.assertEquals(Set.of(18, 30), tcfCaV1Section.getVendorImpliedConsent());
630630
Assertions
631631
.assertEquals(
632-
Set.of(0, 1, 2, 6, 7, 8, 12, 13, 14, 18, 19, 20),
632+
Set.of(1, 2, 3, 7, 8, 9, 13, 14, 15, 19, 20, 21),
633633
tcfCaV1Section.getPubPurposesExpressConsent());
634634
Assertions
635635
.assertEquals(
636-
Set.of(3, 4, 5, 9, 10, 11, 15, 16, 17, 21, 22, 23),
636+
Set.of(4, 5, 6, 10, 11, 12, 16, 17, 18, 22, 23, 24),
637637
tcfCaV1Section.getPubPurposesImpliedConsent());
638638
Assertions.assertEquals(3, tcfCaV1Section.getNumCustomPurposes());
639-
Assertions.assertEquals(Set.of(1), tcfCaV1Section.getCustomPurposesExpressConsent());
640-
Assertions.assertEquals(Set.of(0,2), tcfCaV1Section.getCustomPurposesImpliedConsent());
639+
Assertions.assertEquals(Set.of(2), tcfCaV1Section.getCustomPurposesExpressConsent());
640+
Assertions.assertEquals(Set.of(1, 3), tcfCaV1Section.getCustomPurposesImpliedConsent());
641641
Assertions.assertEquals(utcDateTime, tcfCaV1Section.getCreated());
642642
Assertions.assertEquals(utcDateTime, tcfCaV1Section.getLastUpdated());
643643

@@ -768,7 +768,7 @@ public void testConsistency() {
768768
GppModel decodedModel = new GppModel(fromObjectModel.encode());
769769

770770
Assertions.assertEquals(
771-
Set.of(0, 1, 2, 3, 4, 5, 6, 7, 8, 9),
771+
Set.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
772772
decodedModel.getFieldValue(TcfEuV2.NAME, TcfEuV2Field.PURPOSE_CONSENTS));
773773
Assertions.assertEquals(Set.of(21, 32, 81, 128, 173, 210, 238, 755),
774774
decodedModel.getFieldValue(TcfEuV2.NAME, TcfEuV2Field.VENDOR_CONSENTS));

iabgpp-encoder/src/test/java/com/iab/gpp/encoder/datatype/encoder/FixedBitfieldEncoderTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public void testDecode2() {
9999

100100
@Test
101101
public void testDecode3() {
102-
Assertions.assertEquals(Set.of(0), FixedBitfieldEncoder.decode(BitString.of("1")));
102+
Assertions.assertEquals(Set.of(1), FixedBitfieldEncoder.decode(BitString.of("1")));
103103
}
104104

105105
@Test
@@ -109,17 +109,17 @@ public void testDecode4() {
109109

110110
@Test
111111
public void testDecode5() {
112-
Assertions.assertEquals(Set.of(1), FixedBitfieldEncoder.decode(BitString.of("01")));
112+
Assertions.assertEquals(Set.of(2), FixedBitfieldEncoder.decode(BitString.of("01")));
113113
}
114114

115115
@Test
116116
public void testDecode6() {
117-
Assertions.assertEquals(Set.of(0), FixedBitfieldEncoder.decode(BitString.of("10")));
117+
Assertions.assertEquals(Set.of(1), FixedBitfieldEncoder.decode(BitString.of("10")));
118118
}
119119

120120
@Test
121121
public void testDecode7() {
122-
Assertions.assertEquals(Set.of(0, 1), FixedBitfieldEncoder.decode(BitString.of("11")));
122+
Assertions.assertEquals(Set.of(1, 2), FixedBitfieldEncoder.decode(BitString.of("11")));
123123
}
124124

125125
@Test

iabgpp-encoder/src/test/java/com/iab/gpp/encoder/section/TcfCaV1Test.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -128,25 +128,25 @@ public void testDecode2() {
128128
Assertions.assertEquals(2, tcfCaV1.getCmpVersion());
129129
Assertions.assertEquals(413, tcfCaV1.getVendorListVersion());
130130
Assertions.assertEquals(true, tcfCaV1.getUseNonStandardStacks());
131-
Assertions.assertEquals(Set.of(6, 7, 8, 9, 10, 11),
131+
Assertions.assertEquals(Set.of(7, 8, 9, 10, 11, 12),
132132
tcfCaV1.getSpecialFeatureExpressConsent());
133-
Assertions.assertEquals(Set.of(0, 1, 2, 3, 4, 5, 12, 13, 14, 15, 16, 17),
133+
Assertions.assertEquals(Set.of(1, 2, 3, 4, 5, 6, 13, 14, 15, 16, 17, 18),
134134
tcfCaV1.getPurposesExpressConsent());
135-
Assertions.assertEquals(Set.of(6, 7, 8, 9, 10, 11, 18, 19, 20, 21, 22, 23),
135+
Assertions.assertEquals(Set.of(7, 8, 9, 10, 11, 12, 19, 20, 21, 22, 23, 24),
136136
tcfCaV1.getPurposesImpliedConsent());
137137
Assertions.assertEquals(Set.of(12, 24, 48), tcfCaV1.getVendorExpressConsent());
138138
Assertions.assertEquals(Set.of(18, 30), tcfCaV1.getVendorImpliedConsent());
139139
Assertions
140140
.assertEquals(
141-
Set.of(0, 1, 2, 6, 7, 8, 12, 13, 14, 18, 19, 20),
141+
Set.of(1, 2, 3, 7, 8, 9, 13, 14, 15, 19, 20, 21),
142142
tcfCaV1.getPubPurposesExpressConsent());
143143
Assertions
144144
.assertEquals(
145-
Set.of(3, 4, 5, 9, 10, 11, 15, 16, 17, 21, 22, 23),
145+
Set.of(4, 5, 6, 10, 11, 12, 16, 17, 18, 22, 23, 24),
146146
tcfCaV1.getPubPurposesImpliedConsent());
147147
Assertions.assertEquals(3, tcfCaV1.getNumCustomPurposes());
148-
Assertions.assertEquals(Set.of(1), tcfCaV1.getCustomPurposesExpressConsent());
149-
Assertions.assertEquals(Set.of(0, 2), tcfCaV1.getCustomPurposesImpliedConsent());
148+
Assertions.assertEquals(Set.of(2), tcfCaV1.getCustomPurposesExpressConsent());
149+
Assertions.assertEquals(Set.of(1, 3), tcfCaV1.getCustomPurposesImpliedConsent());
150150
Assertions.assertEquals(ZonedDateTime.of(2022, 1, 1, 0, 0, 0, 0, ZoneId.of("UTC")), tcfCaV1.getCreated());
151151
Assertions.assertEquals(ZonedDateTime.of(2022, 1, 1, 0, 0, 0, 0, ZoneId.of("UTC")), tcfCaV1.getLastUpdated());
152152

iabgpp-encoder/src/test/java/com/iab/gpp/encoder/section/TcfEuV2Test.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,14 @@ public void testDecode4() {
260260
Assertions.assertEquals(false, tcfEuV2.getFieldValue("UseNonStandardStacks"));
261261

262262
Assertions.assertEquals(
263-
Set.of(0),
263+
Set.of(1),
264264
tcfEuV2.getFieldValue("SpecialFeatureOptins"));
265265
Assertions
266266
.assertEquals(
267-
Set.of(0, 1, 2, 3, 4, 5, 6, 7, 8, 9),
267+
Set.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
268268
tcfEuV2.getFieldValue("PurposeConsents"));
269269
Assertions.assertEquals(
270-
Set.of(1, 5, 6, 7, 8, 9),
270+
Set.of(2, 6, 7, 8, 9, 10),
271271
tcfEuV2.getFieldValue("PurposeLegitimateInterests"));
272272

273273
Assertions.assertEquals(false, tcfEuV2.getFieldValue("PurposeOneTreatment"));
@@ -294,14 +294,14 @@ public void testDecode5() {
294294
Assertions.assertEquals(false, tcfEuV2.getFieldValue("UseNonStandardStacks"));
295295

296296
Assertions.assertEquals(
297-
Set.of(0),
297+
Set.of(1),
298298
tcfEuV2.getFieldValue("SpecialFeatureOptins"));
299299
Assertions
300300
.assertEquals(
301-
Set.of(0, 1, 2, 3, 4, 5, 6, 7, 8, 9),
301+
Set.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
302302
tcfEuV2.getFieldValue("PurposeConsents"));
303303
Assertions.assertEquals(
304-
Set.of(1, 5, 6, 7, 8, 9),
304+
Set.of(2, 6, 7, 8, 9, 10),
305305
tcfEuV2.getFieldValue("PurposeLegitimateInterests"));
306306

307307
Assertions.assertEquals(false, tcfEuV2.getFieldValue("PurposeOneTreatment"));
@@ -331,10 +331,10 @@ public void testDecode6() {
331331
tcfEuV2.getFieldValue("SpecialFeatureOptins"));
332332
Assertions
333333
.assertEquals(
334-
Set.of(0, 1, 2, 3, 4, 5, 6, 7, 8, 9),
334+
Set.of(1, 2, 3, 4, 5, 6, 7, 8, 9, 10),
335335
tcfEuV2.getFieldValue("PurposeConsents"));
336336
Assertions.assertEquals(
337-
Set.of(1, 2, 3, 4, 5, 6, 7, 8, 9),
337+
Set.of(2, 3, 4, 5, 6, 7, 8, 9, 10),
338338
tcfEuV2.getFieldValue("PurposeLegitimateInterests"));
339339

340340
Assertions.assertEquals(false, tcfEuV2.getFieldValue("PurposeOneTreatment"));
@@ -364,13 +364,13 @@ public void testDecode7() throws DecodingException {
364364
Assertions.assertEquals(false, tcfEuV2.getFieldValue("UseNonStandardStacks"));
365365

366366
Assertions.assertEquals(
367-
Set.of(0),
367+
Set.of(1),
368368
tcfEuV2.getFieldValue("SpecialFeatureOptins"));
369369
Assertions.assertEquals(
370-
Set.of(0),
370+
Set.of(1),
371371
tcfEuV2.getFieldValue("PurposeConsents"));
372372
Assertions.assertEquals(
373-
Set.of(1, 6, 8, 9),
373+
Set.of(2, 7, 9, 10),
374374
tcfEuV2.getFieldValue("PurposeLegitimateInterests"));
375375

376376
Assertions.assertEquals(false, tcfEuV2.getFieldValue("PurposeOneTreatment"));

0 commit comments

Comments
 (0)