Skip to content

Commit 82f3a1d

Browse files
andreaTPjsenko
authored andcommitted
lombok
1 parent 3506285 commit 82f3a1d

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

operator/model/src/test/java/io/apicurio/registry/operator/api/v1/SerDeTest.java

+18
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package io.apicurio.registry.operator.api.v1;
22

3+
import com.fasterxml.jackson.core.type.TypeReference;
34
import com.fasterxml.jackson.databind.ObjectMapper;
45
import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
56
import org.junit.jupiter.api.Test;
@@ -22,4 +23,21 @@ public void basicReadOfCRs() throws Exception {
2223
assertEquals("test", registry.getMetadata().getName());
2324
assertEquals("test-namespace", registry.getMetadata().getNamespace());
2425
}
26+
27+
@Test
28+
public void basicReadOfMultipleCRs() throws Exception {
29+
// Arrange
30+
var resource = getClass().getResourceAsStream("/demo-crs.yaml");
31+
32+
// Act
33+
var registries = MAPPER
34+
.readValues(MAPPER.createParser(resource), new TypeReference<ApicurioRegistry3>() {
35+
}).readAll();
36+
37+
// Assert
38+
assertEquals("test1", registries.get(0).getMetadata().getName());
39+
assertEquals("test-namespace1", registries.get(0).getMetadata().getNamespace());
40+
assertEquals("test2", registries.get(1).getMetadata().getName());
41+
assertEquals("test-namespace2", registries.get(1).getMetadata().getNamespace());
42+
}
2543
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: registry.apicur.io/v1
2+
kind: ApicurioRegistry3
3+
metadata:
4+
name: test1
5+
namespace: test-namespace1
6+
spec:
7+
{ }
8+
---
9+
apiVersion: registry.apicur.io/v1
10+
kind: ApicurioRegistry3
11+
metadata:
12+
name: test2
13+
namespace: test-namespace2
14+
spec:
15+
{ }

0 commit comments

Comments
 (0)