|
51 | 51 | import java.util.zip.ZipEntry;
|
52 | 52 | import java.util.zip.ZipInputStream;
|
53 | 53 |
|
| 54 | +@SuppressWarnings("PMD.SystemPrintln") |
54 | 55 | public class ScrMetadataIT {
|
55 | 56 |
|
56 | 57 | private static final Set<String> PROPERTIES_TO_IGNORE;
|
@@ -114,26 +115,24 @@ public void test() throws Exception {
|
114 | 115 | private List<String> compareDescriptors(Descriptor current, Descriptor latestRelease) {
|
115 | 116 | List<String> problems = new ArrayList<>();
|
116 | 117 |
|
117 |
| - current.properties.stream().filter(cp -> !PROPERTIES_TO_IGNORE.contains(cp.name)). |
118 |
| - filter(cp -> !COMPONENT_PROPERTIES_TO_IGNORE.contains(current.name + ":" + cp.name)).forEach(cp -> { |
| 118 | + current.properties.stream().filter(cp -> !PROPERTIES_TO_IGNORE.contains(cp.name)) |
| 119 | + .filter(cp -> !COMPONENT_PROPERTIES_TO_IGNORE.contains(current.name + ":" + cp.name)).forEach(cp -> { |
119 | 120 | Optional<Property> fromLatest = latestRelease.properties.stream().filter(p -> p.name.equals(cp.name)).findFirst();
|
120 | 121 | if (fromLatest.isPresent()) {
|
121 | 122 | Property lp = fromLatest.get();
|
122 | 123 | if (!StringUtils.equals(cp.value, lp.value)) {
|
123 | 124 | problems.add(String.format("Property %s on component %s has different values (was: {%s}, is: {%s})", cp.name, current.name, lp.value, cp.value));
|
124 | 125 | }
|
125 |
| - if (!COMPONENT_PROPERTIES_TO_IGNORE_FOR_TYPE_CHANGE.contains(current.name + ":" + cp.name)) { |
126 |
| - if (!StringUtils.equals(cp.type, lp.type)) { |
127 |
| - problems.add(String.format("Property %s on component %s has different types (was: {%s}, is: {%s})", cp.name, current.name, lp.type, cp.type)); |
128 |
| - } |
| 126 | + if (!COMPONENT_PROPERTIES_TO_IGNORE_FOR_TYPE_CHANGE.contains(current.name + ":" + cp.name) && !StringUtils.equals(cp.type, lp.type)) { |
| 127 | + problems.add(String.format("Property %s on component %s has different types (was: {%s}, is: {%s})", cp.name, current.name, lp.type, cp.type)); |
129 | 128 | }
|
130 | 129 | } else {
|
131 | 130 | System.out.printf("Property %s on component %s is only in current. Assuming OK.\n", cp.name, current.name);
|
132 | 131 | }
|
133 | 132 | });
|
134 | 133 |
|
135 |
| - latestRelease.properties.stream().filter(lp -> !PROPERTIES_TO_IGNORE.contains(lp.name)). |
136 |
| - filter(lp -> !COMPONENT_PROPERTIES_TO_IGNORE.contains(latestRelease.name + ":" + lp.name)).forEach(lp -> { |
| 134 | + latestRelease.properties.stream().filter(lp -> !PROPERTIES_TO_IGNORE.contains(lp.name)) |
| 135 | + .filter(lp -> !COMPONENT_PROPERTIES_TO_IGNORE.contains(latestRelease.name + ":" + lp.name)).forEach(lp -> { |
137 | 136 | Optional<Property> fromCurrent = current.properties.stream().filter(p -> p.name.equals(lp.name)).findFirst();
|
138 | 137 | if (!fromCurrent.isPresent()) {
|
139 | 138 | problems.add(String.format("Property %s on component %s has been removed.", lp.name, latestRelease.name));
|
@@ -334,6 +333,11 @@ private class InputStreamFacade extends InputStream {
|
334 | 333 | this.zis = zis;
|
335 | 334 | }
|
336 | 335 |
|
| 336 | + @Override |
| 337 | + public int read() throws IOException { |
| 338 | + return zis.read(); |
| 339 | + } |
| 340 | + |
337 | 341 | @Override
|
338 | 342 | public int read(@NotNull byte[] b) throws IOException {
|
339 | 343 | return zis.read(b);
|
@@ -374,10 +378,6 @@ public boolean markSupported() {
|
374 | 378 | return zis.markSupported();
|
375 | 379 | }
|
376 | 380 |
|
377 |
| - @Override |
378 |
| - public int read() throws IOException { |
379 |
| - return zis.read(); |
380 |
| - } |
381 | 381 | }
|
382 | 382 |
|
383 | 383 |
|
|
0 commit comments