Skip to content

Commit

Permalink
cosmetic: cleanup code
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanseifert committed Jul 1, 2024
1 parent 1ce2929 commit 12f19a2
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class AemConfigurationInjectResourceDetectionStrategyTest {
private ConfigurationInjectResourceDetectionStrategyMultiplexer strategyMultiplexer;

@BeforeEach
void setUp() throws Exception {
void setUp() {
context.registerInjectActivateService(AemConfigurationInjectResourceDetectionStrategy.class);
strategyMultiplexer = context.getService(ConfigurationInjectResourceDetectionStrategyMultiplexer.class);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class AbsoluteParentContextPathStrategyLegacyVersionHistoryTenantTest extends Ab

@Override
@BeforeEach
void setUp() throws Exception {
void setUp() {
context.registerAdapter(ResourceResolver.class, Tenant.class, tenant);

level1 = context.create().page("/content/versionhistory/tenant1/user1/region1").adaptTo(Resource.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AbsoluteParentContextPathStrategyLegacyVersionHistoryTest extends Absolute

@Override
@BeforeEach
void setUp() throws Exception {
void setUp() {
level1 = context.create().page("/content/versionhistory/user1/region1").adaptTo(Resource.class);
level2 = context.create().page("/content/versionhistory/user1/region1/site1").adaptTo(Resource.class);
level3 = context.create().page("/content/versionhistory/user1/region1/site1/en").adaptTo(Resource.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class AbsoluteParentContextPathStrategyTest {
protected Resource level4;

@BeforeEach
void setUp() throws Exception {
void setUp() {
level1 = context.create().page("/content/region1").adaptTo(Resource.class);
level2 = context.create().page("/content/region1/site1").adaptTo(Resource.class);
level3 = context.create().page("/content/region1/site1/en").adaptTo(Resource.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class AbsoluteParentContextPathStrategyVersionHistoryTest extends AbsoluteParent

@Override
@BeforeEach
void setUp() throws Exception {
void setUp() {
level1 = context.create().page("/tmp/versionhistory/user1/version1/region1").adaptTo(Resource.class);
level2 = context.create().page("/tmp/versionhistory/user1/version1/region1/site1").adaptTo(Resource.class);
level3 = context.create().page("/tmp/versionhistory/user1/version1/region1/site1/en").adaptTo(Resource.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ public void execute(@NotNull AemContext ctx) {
private Page contentPage;

@BeforeEach
void setUp() throws Exception {
void setUp() {
context.create().resource("/conf");
contentPage = context.create().page("/content/test/site1", "/apps/app1/templates/template1",
ImmutableValueMap.of("sling:configRef", "/conf/test/site1"));
}

@Test
void testSimpleConfig() throws Exception {
void testSimpleConfig() {
context.registerInjectActivateService(new PagePersistenceStrategy(), "enabled", true);

// write config
Expand All @@ -111,7 +111,7 @@ void testSimpleConfig() throws Exception {
}

@Test
void testSimpleConfig_Disabled() throws Exception {
void testSimpleConfig_Disabled() {
context.registerInjectActivateService(new PagePersistenceStrategy(), "enabled", false);

// write config
Expand All @@ -130,7 +130,7 @@ void testSimpleConfig_Disabled() throws Exception {
}

@Test
void testListConfig() throws Exception {
void testListConfig() {
context.registerInjectActivateService(new PagePersistenceStrategy(), "enabled", true);

// write config
Expand Down Expand Up @@ -163,7 +163,7 @@ void testListConfig() throws Exception {
}

@Test
void testListConfig_Nested() throws Exception {
void testListConfig_Nested() {
context.registerInjectActivateService(new PagePersistenceStrategy(), "enabled", true);

// write config
Expand Down Expand Up @@ -239,7 +239,7 @@ void testListConfig_Nested() throws Exception {
}

@Test
void testNestedConfig() throws Exception {
void testNestedConfig() {
context.registerInjectActivateService(new PagePersistenceStrategy(), "enabled", true);

// write config
Expand Down Expand Up @@ -278,7 +278,7 @@ void testNestedConfig() throws Exception {
}

@Test
void testDeeplyNestedConfig_WCON60() throws Exception {
void testDeeplyNestedConfig_WCON60() {
context.registerInjectActivateService(new PagePersistenceStrategy(), "enabled", true);

// write config
Expand All @@ -305,7 +305,7 @@ void testDeeplyNestedConfig_WCON60() throws Exception {
}

@Test
void testSimpleConfig_ResourceType() throws Exception {
void testSimpleConfig_ResourceType() {
context.registerInjectActivateService(new PagePersistenceStrategy(), "enabled", true,
"resourceType", "app1/components/page/config");

Expand All @@ -322,7 +322,7 @@ void testSimpleConfig_ResourceType() throws Exception {
}

@Test
void testListConfig_ResourceType() throws Exception {
void testListConfig_ResourceType() {
context.registerInjectActivateService(new PagePersistenceStrategy(), "enabled", true,
"resourceType", "app1/components/page/config");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class PagePersistenceStrategyTestWithToolsConfigPage extends PagePersistenceStrategyTest {

@BeforeEach
void registerAdditionalPersictenceStrategy() throws Exception {
void registerAdditionalPersictenceStrategy() {
context.registerInjectActivateService(new ToolsConfigPagePersistenceStrategy(),
"enabled", true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ToolsConfigPagePersistenceStrategyTest {
private Page contentPage;

@BeforeEach
void setUp() throws Exception {
void setUp() {
context.registerInjectActivateService(new AbsoluteParentContextPathStrategy(),
"levels", new int[] { 1, 3 },
"contextPathRegex", "^/content(/.+)$",
Expand All @@ -91,7 +91,7 @@ void setUp() throws Exception {
}

@Test
void testSimpleConfig() throws Exception {
void testSimpleConfig() {
// write config
writeConfiguration(context, contentPage.getPath(), SimpleConfig.class.getName(),
"stringParam", "value1",
Expand Down Expand Up @@ -127,7 +127,7 @@ void testSimpleConfig() throws Exception {
}

@Test
void testListConfig() throws Exception {
void testListConfig() {
// write config
writeConfigurationCollection(context, contentPage.getPath(), ListConfig.class.getName(), List.of(
ImmutableValueMap.of("stringParam", "value1", "intParam", 123),
Expand Down Expand Up @@ -164,7 +164,7 @@ void testListConfig() throws Exception {
}

@Test
void testListConfig_Nested() throws Exception {
void testListConfig_Nested() {
context.registerInjectActivateService(new PagePersistenceStrategy(), "enabled", true);

// write config
Expand Down Expand Up @@ -246,7 +246,7 @@ void testListConfig_Nested() throws Exception {
}

@Test
void testNestedConfig() throws Exception {
void testNestedConfig() {
// write config
writeConfiguration(context, contentPage.getPath(), NestedConfig.class.getName(),
"stringParam", "value1");
Expand Down Expand Up @@ -290,7 +290,7 @@ void testNestedConfig() throws Exception {
}

@Test
void testSimpleConfigWithCQLastModified() throws Exception {
void testSimpleConfigWithCQLastModified() {
context.create().page("/content/region2");
context.create().page("/content/region2/site2");
context.create().page("/content/region2/site2/en");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
class ToolsConfigPagePersistenceStrategyWithPageTest extends ToolsConfigPagePersistenceStrategyTest {

@BeforeEach
void registerAdditionalPersictenceStrategy() throws Exception {
void registerAdditionalPersictenceStrategy() {
context.registerInjectActivateService(new PagePersistenceStrategy(),
"enabled", true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static void registerConfigurations(AemContext context, Class<?>... config
context.registerService(ConfigurationMetadataProvider.class, metadataProvider);
}

private static class DummyConfigurationMetadataProvider implements ConfigurationMetadataProvider {
private static final class DummyConfigurationMetadataProvider implements ConfigurationMetadataProvider {

private final Map<String, ConfigurationMetadata> metadata = new HashMap<>();

Expand Down

0 comments on commit 12f19a2

Please sign in to comment.