Skip to content

Commit 89adb5c

Browse files
committed
Code formatting
1 parent 478ede1 commit 89adb5c

File tree

5 files changed

+52
-33
lines changed

5 files changed

+52
-33
lines changed

app/src/main/java/io/apicurio/registry/storage/RegistryStorage.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ public interface RegistryStorage extends DynamicConfigStorage {
106106
Pair<ArtifactMetaDataDto, ArtifactVersionMetaDataDto> createArtifact(String groupId, String artifactId,
107107
String artifactType, EditableArtifactMetaDataDto artifactMetaData, String version,
108108
ContentWrapperDto versionContent, EditableVersionMetaDataDto versionMetaData,
109-
List<String> versionBranches, boolean dryRun) throws ArtifactAlreadyExistsException, RegistryStorageException;
109+
List<String> versionBranches, boolean dryRun)
110+
throws ArtifactAlreadyExistsException, RegistryStorageException;
110111

111112
/**
112113
* Deletes an artifact by its group and unique id. Returns list of artifact versions.

app/src/main/java/io/apicurio/registry/storage/impl/sql/AbstractSqlRegistryStorage.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -737,7 +737,8 @@ public void deleteArtifacts(String groupId) throws RegistryStorageException {
737737
@Override
738738
public ArtifactVersionMetaDataDto createArtifactVersion(String groupId, String artifactId, String version,
739739
String artifactType, ContentWrapperDto content, EditableVersionMetaDataDto metaData,
740-
List<String> branches, boolean dryRun) throws VersionAlreadyExistsException, RegistryStorageException {
740+
List<String> branches, boolean dryRun)
741+
throws VersionAlreadyExistsException, RegistryStorageException {
741742
log.debug("Creating new artifact version for {} {} (version {}).", groupId, artifactId, version);
742743

743744
String owner = securityIdentity.getPrincipal().getName();

app/src/test/java/io/apicurio/registry/noprofile/rest/v3/DryRunTest.java

+41-23
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,13 @@ public void testCreateArtifactDryRun() throws Exception {
5454
createRule.setConfig(ValidityLevel.FULL.name());
5555
clientV3.groups().byGroupId(groupId).rules().post(createRule);
5656

57-
// Dry run: valid artifact that should be created.
58-
CreateArtifact createArtifact = TestUtils.clientCreateArtifact("valid-artifact", ArtifactType.AVRO, SCHEMA_SIMPLE, ContentTypes.APPLICATION_JSON);
59-
CreateArtifactResponse car = clientV3.groups().byGroupId(groupId).artifacts().post(createArtifact, config -> {
60-
config.queryParameters.dryRun = true;
61-
});
57+
// Dry run: valid artifact that should be created.
58+
CreateArtifact createArtifact = TestUtils.clientCreateArtifact("valid-artifact", ArtifactType.AVRO,
59+
SCHEMA_SIMPLE, ContentTypes.APPLICATION_JSON);
60+
CreateArtifactResponse car = clientV3.groups().byGroupId(groupId).artifacts().post(createArtifact,
61+
config -> {
62+
config.queryParameters.dryRun = true;
63+
});
6264
Assertions.assertNotNull(car);
6365
Assertions.assertEquals(groupId, car.getArtifact().getGroupId());
6466
Assertions.assertEquals("valid-artifact", car.getArtifact().getArtifactId());
@@ -72,11 +74,14 @@ public void testCreateArtifactDryRun() throws Exception {
7274
Error error = Assertions.assertThrows(Error.class, () -> {
7375
clientV3.groups().byGroupId(groupId).artifacts().byArtifactId("valid-artifact").get();
7476
});
75-
Assertions.assertEquals("No artifact with ID 'valid-artifact' in group 'testCreateArtifactDryRun' was found.", error.getMessageEscaped());
77+
Assertions.assertEquals(
78+
"No artifact with ID 'valid-artifact' in group 'testCreateArtifactDryRun' was found.",
79+
error.getMessageEscaped());
7680

77-
// Dry run: invalid artifact that should NOT be created.
81+
// Dry run: invalid artifact that should NOT be created.
7882
error = Assertions.assertThrows(Error.class, () -> {
79-
CreateArtifact ca = TestUtils.clientCreateArtifact("invalid-artifact", ArtifactType.AVRO, INVALID_SCHEMA, ContentTypes.APPLICATION_JSON);
83+
CreateArtifact ca = TestUtils.clientCreateArtifact("invalid-artifact", ArtifactType.AVRO,
84+
INVALID_SCHEMA, ContentTypes.APPLICATION_JSON);
8085
clientV3.groups().byGroupId(groupId).artifacts().post(ca, config -> {
8186
config.queryParameters.dryRun = true;
8287
});
@@ -94,25 +99,32 @@ public void testCreateArtifactDryRun() throws Exception {
9499
error = Assertions.assertThrows(Error.class, () -> {
95100
clientV3.groups().byGroupId(groupId).artifacts().byArtifactId("invalid-artifact").get();
96101
});
97-
Assertions.assertEquals("No artifact with ID 'invalid-artifact' in group 'testCreateArtifactDryRun' was found.", error.getMessageEscaped());
102+
Assertions.assertEquals(
103+
"No artifact with ID 'invalid-artifact' in group 'testCreateArtifactDryRun' was found.",
104+
error.getMessageEscaped());
98105

99106
// Actually create an artifact in the group.
100-
createArtifact(groupId, "actual-artifact", ArtifactType.AVRO, SCHEMA_SIMPLE, ContentTypes.APPLICATION_JSON);
107+
createArtifact(groupId, "actual-artifact", ArtifactType.AVRO, SCHEMA_SIMPLE,
108+
ContentTypes.APPLICATION_JSON);
101109
results = clientV3.groups().byGroupId(groupId).artifacts().get();
102110
Assertions.assertEquals(1, results.getCount());
103111
Assertions.assertEquals(1, results.getArtifacts().size());
104112

105113
// DryRun: Try to create the *same* artifact (conflict)
106114
error = Assertions.assertThrows(Error.class, () -> {
107-
CreateArtifact ca = TestUtils.clientCreateArtifact("actual-artifact", ArtifactType.AVRO, SCHEMA_SIMPLE, ContentTypes.APPLICATION_JSON);
115+
CreateArtifact ca = TestUtils.clientCreateArtifact("actual-artifact", ArtifactType.AVRO,
116+
SCHEMA_SIMPLE, ContentTypes.APPLICATION_JSON);
108117
clientV3.groups().byGroupId(groupId).artifacts().post(ca, config -> {
109118
config.queryParameters.dryRun = true;
110119
});
111120
});
112-
Assertions.assertEquals("An artifact with ID 'actual-artifact' in group 'testCreateArtifactDryRun' already exists.", error.getMessageEscaped());
121+
Assertions.assertEquals(
122+
"An artifact with ID 'actual-artifact' in group 'testCreateArtifactDryRun' already exists.",
123+
error.getMessageEscaped());
113124

114125
// DryRun: Try to create the *same* artifact but with ifExists set (success)
115-
createArtifact = TestUtils.clientCreateArtifact("actual-artifact", ArtifactType.AVRO, SCHEMA_SIMPLE, ContentTypes.APPLICATION_JSON);
126+
createArtifact = TestUtils.clientCreateArtifact("actual-artifact", ArtifactType.AVRO, SCHEMA_SIMPLE,
127+
ContentTypes.APPLICATION_JSON);
116128
car = clientV3.groups().byGroupId(groupId).artifacts().post(createArtifact, config -> {
117129
config.queryParameters.dryRun = true;
118130
config.queryParameters.ifExists = IfArtifactExists.CREATE_VERSION;
@@ -127,7 +139,8 @@ public void testCreateArtifactDryRun() throws Exception {
127139
results = clientV3.groups().byGroupId(groupId).artifacts().get();
128140
Assertions.assertEquals(1, results.getCount());
129141
Assertions.assertEquals(1, results.getArtifacts().size());
130-
VersionSearchResults vresults = clientV3.groups().byGroupId(groupId).artifacts().byArtifactId("actual-artifact").versions().get();
142+
VersionSearchResults vresults = clientV3.groups().byGroupId(groupId).artifacts()
143+
.byArtifactId("actual-artifact").versions().get();
131144
Assertions.assertEquals(2, vresults.getCount());
132145
Assertions.assertEquals(2, vresults.getVersions().size());
133146
}
@@ -153,20 +166,24 @@ public void testCreateVersionDryRun() throws Exception {
153166

154167
// DryRun: try to create an invalid version
155168
Error error = Assertions.assertThrows(Error.class, () -> {
156-
CreateVersion createVersion = TestUtils.clientCreateVersion(INVALID_SCHEMA, ContentTypes.APPLICATION_JSON);
157-
clientV3.groups().byGroupId(groupId).artifacts().byArtifactId(artifactId).versions().post(createVersion, config -> {
158-
config.queryParameters.dryRun = true;
159-
});
169+
CreateVersion createVersion = TestUtils.clientCreateVersion(INVALID_SCHEMA,
170+
ContentTypes.APPLICATION_JSON);
171+
clientV3.groups().byGroupId(groupId).artifacts().byArtifactId(artifactId).versions()
172+
.post(createVersion, config -> {
173+
config.queryParameters.dryRun = true;
174+
});
160175
});
161176
Assertions.assertEquals("Syntax violation for Avro artifact.", error.getMessageEscaped());
162177

163178
// DryRun: try to create a valid version (appears to work)
164179
{
165-
CreateVersion createVersion = TestUtils.clientCreateVersion(SCHEMA_SIMPLE, ContentTypes.APPLICATION_JSON);
180+
CreateVersion createVersion = TestUtils.clientCreateVersion(SCHEMA_SIMPLE,
181+
ContentTypes.APPLICATION_JSON);
166182
createVersion.setName("DryRunVersion");
167-
VersionMetaData vmd = clientV3.groups().byGroupId(groupId).artifacts().byArtifactId(artifactId).versions().post(createVersion, config -> {
168-
config.queryParameters.dryRun = true;
169-
});
183+
VersionMetaData vmd = clientV3.groups().byGroupId(groupId).artifacts().byArtifactId(artifactId)
184+
.versions().post(createVersion, config -> {
185+
config.queryParameters.dryRun = true;
186+
});
170187
Assertions.assertNotNull(vmd);
171188
Assertions.assertEquals("DryRunVersion", vmd.getName());
172189
Assertions.assertEquals("2", vmd.getVersion());
@@ -176,7 +193,8 @@ public void testCreateVersionDryRun() throws Exception {
176193
ArtifactSearchResults results = clientV3.groups().byGroupId(groupId).artifacts().get();
177194
Assertions.assertEquals(1, results.getCount());
178195
Assertions.assertEquals(1, results.getArtifacts().size());
179-
VersionSearchResults vresults = clientV3.groups().byGroupId(groupId).artifacts().byArtifactId(artifactId).versions().get();
196+
VersionSearchResults vresults = clientV3.groups().byGroupId(groupId).artifacts()
197+
.byArtifactId(artifactId).versions().get();
180198
Assertions.assertEquals(1, vresults.getCount());
181199
Assertions.assertEquals(1, vresults.getVersions().size());
182200
}

app/src/test/java/io/apicurio/registry/noprofile/storage/RegistryStorageSmokeTest.java

+3-2
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ public void testArtifactsAndMeta() throws Exception {
9090
ContentWrapperDto versionContent1 = ContentWrapperDto.builder()
9191
.content(ContentHandle.create("content1")).contentType(ContentTypes.APPLICATION_JSON).build();
9292
EditableVersionMetaDataDto versionMetaData1 = EditableVersionMetaDataDto.builder().build();
93-
ArtifactVersionMetaDataDto vmdDto1_1 = getStorage().createArtifact(GROUP_ID, artifactId1,
94-
ArtifactType.JSON, artifactMetaData1, null, versionContent1, versionMetaData1, List.of(), false)
93+
ArtifactVersionMetaDataDto vmdDto1_1 = getStorage()
94+
.createArtifact(GROUP_ID, artifactId1, ArtifactType.JSON, artifactMetaData1, null,
95+
versionContent1, versionMetaData1, List.of(), false)
9596
.getRight();
9697
// Create version 2 (for artifact 1)
9798
ArtifactVersionMetaDataDto vmdDto1_2 = getStorage().createArtifactVersion(GROUP_ID, artifactId1, null,

app/src/test/java/io/apicurio/registry/storage/impl/readonly/ReadOnlyRegistryStorageTest.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,14 @@ public class ReadOnlyRegistryStorageTest {
4545
new State(false, s -> s.countActiveArtifactVersions(null, null))),
4646
entry("countTotalArtifactVersions0",
4747
new State(false, RegistryStorage::countTotalArtifactVersions)),
48-
entry("createArtifact8",
49-
new State(true,
50-
s -> s.createArtifact(null, null, null, null, null, null, null, null, false))),
48+
entry("createArtifact8", new State(true,
49+
s -> s.createArtifact(null, null, null, null, null, null, null, null, false))),
5150
entry("createArtifactRule4",
5251
new State(true, s -> s.createArtifactRule(null, null, null, null))),
5352
entry("createArtifactVersionComment4",
5453
new State(true, s -> s.createArtifactVersionComment(null, null, null, null))),
55-
entry("createArtifactVersion7",
56-
new State(true,
57-
s -> s.createArtifactVersion(null, null, null, null, null, null, null, false))),
54+
entry("createArtifactVersion7", new State(true,
55+
s -> s.createArtifactVersion(null, null, null, null, null, null, null, false))),
5856
entry("createBranch4", new State(true, s -> s.createBranch(null, null, null, null))),
5957
entry("createDownload1", new State(true, s -> s.createDownload(null))),
6058
entry("createGlobalRule2", new State(true, s -> s.createGlobalRule(null, null))),

0 commit comments

Comments
 (0)