Skip to content

Commit

Permalink
Minor code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
strangelookingnerd committed Nov 11, 2024
1 parent 93ad2f4 commit af67436
Show file tree
Hide file tree
Showing 11 changed files with 77 additions and 81 deletions.
1 change: 0 additions & 1 deletion .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
runs-on: ubuntu-latest
name: Coverage on Ubuntu
steps:
- uses: actions/checkout@v4
- name: Set up JDK 17 and Maven
uses: s4u/[email protected]
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class BuildStatusFolderIconTest {
* @throws Exception in case anything goes wrong
*/
@Test
void testGetAvailableJobs(JenkinsRule r) throws Exception {
void getAvailableJobs(JenkinsRule r) throws Exception {
Folder project = r.jenkins.createProject(Folder.class, "folder");

BuildStatusFolderIcon customIcon = new BuildStatusFolderIcon(null);
Expand All @@ -57,7 +57,7 @@ void testGetAvailableJobs(JenkinsRule r) throws Exception {
* @throws Exception in case anything goes wrong
*/
@Test
void testWithConfiguredJobs(JenkinsRule r) throws Exception {
void withConfiguredJobs(JenkinsRule r) throws Exception {
Folder project = r.jenkins.createProject(Folder.class, "folder");

try (MockedStatic<Stapler> stapler = mockStatic(Stapler.class)) {
Expand Down Expand Up @@ -116,7 +116,7 @@ void testWithConfiguredJobs(JenkinsRule r) throws Exception {
* @throws Exception in case anything goes wrong
*/
@Test
void testFolder(JenkinsRule r) throws Exception {
void folder(JenkinsRule r) throws Exception {
BuildStatusFolderIcon customIcon = new BuildStatusFolderIcon(null);
assertTrue(StringUtils.startsWith(customIcon.getDescription(), Messages.Folder_description()));

Expand All @@ -134,7 +134,7 @@ void testFolder(JenkinsRule r) throws Exception {
* @throws Exception in case anything goes wrong
*/
@Test
void testOrganizationFolder(JenkinsRule r) throws Exception {
void organizationFolder(JenkinsRule r) throws Exception {
BuildStatusFolderIcon customIcon = new BuildStatusFolderIcon(null);
assertTrue(StringUtils.startsWith(customIcon.getDescription(), Messages.Folder_description()));

Expand All @@ -150,7 +150,7 @@ void testOrganizationFolder(JenkinsRule r) throws Exception {
* Test behavior of {@link DescriptorImpl}.
*/
@Test
void testDescriptor(@SuppressWarnings("unused") JenkinsRule r) {
void descriptor(@SuppressWarnings("unused") JenkinsRule r) {
BuildStatusFolderIcon customIcon = new BuildStatusFolderIcon(null);
DescriptorImpl descriptor = customIcon.getDescriptor();
assertEquals(Messages.BuildStatusFolderIcon_description(), descriptor.getDisplayName());
Expand All @@ -163,7 +163,7 @@ void testDescriptor(@SuppressWarnings("unused") JenkinsRule r) {
* @throws Exception in case anything goes wrong
*/
@Test
void testFinishedBuildStatusIcon(JenkinsRule r) throws Exception {
void finishedBuildStatusIcon(JenkinsRule r) throws Exception {
BuildStatusFolderIcon customIcon = new BuildStatusFolderIcon(null);
Folder project = r.jenkins.createProject(Folder.class, "folder");
project.setIcon(customIcon);
Expand Down Expand Up @@ -219,7 +219,7 @@ void testFinishedBuildStatusIcon(JenkinsRule r) throws Exception {
* @throws Exception in case anything goes wrong
*/
@Test
void testRunningBuildStatusIcon(JenkinsRule r) throws Exception {
void runningBuildStatusIcon(JenkinsRule r) throws Exception {
BuildStatusFolderIcon customIcon = new BuildStatusFolderIcon(null);
Folder project = r.jenkins.createProject(Folder.class, "folder");
project.setIcon(customIcon);
Expand Down Expand Up @@ -256,7 +256,7 @@ void testRunningBuildStatusIcon(JenkinsRule r) throws Exception {
* @throws Exception in case anything goes wrong
*/
@Test
void testRunningNoPreviousBuildStatusIcon(JenkinsRule r) throws Exception {
void runningNoPreviousBuildStatusIcon(JenkinsRule r) throws Exception {
BuildStatusFolderIcon customIcon = new BuildStatusFolderIcon(null);
Folder project = r.jenkins.createProject(Folder.class, "folder");
project.setIcon(customIcon);
Expand Down Expand Up @@ -287,7 +287,7 @@ void testRunningNoPreviousBuildStatusIcon(JenkinsRule r) throws Exception {
* @throws Exception in case anything goes wrong
*/
@Test
void testDisabledBuildStatusIcon(JenkinsRule r) throws Exception {
void disabledBuildStatusIcon(JenkinsRule r) throws Exception {
BuildStatusFolderIcon customIcon = new BuildStatusFolderIcon(null);
Folder project = r.jenkins.createProject(Folder.class, "folder");
project.setIcon(customIcon);
Expand All @@ -314,7 +314,7 @@ void testDisabledBuildStatusIcon(JenkinsRule r) throws Exception {
* @throws Exception in case anything goes wrong
*/
@Test
void testNoBuildStatusIcon(JenkinsRule r) throws Exception {
void noBuildStatusIcon(JenkinsRule r) throws Exception {
BuildStatusFolderIcon customIcon = new BuildStatusFolderIcon(null);
Folder project = r.jenkins.createProject(Folder.class, "folder");
project.setIcon(customIcon);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class CustomFolderIconConfigurationTest {
* Test behavior of {@link CustomFolderIconConfiguration#getCategory()}.
*/
@Test
void testGetCategory(@SuppressWarnings("unused") JenkinsRule r) {
void getCategory(@SuppressWarnings("unused") JenkinsRule r) {
CustomFolderIconConfiguration descriptor = new CustomFolderIconConfiguration();
assertEquals(descriptor.getCategory(), GlobalConfigurationCategory.get(AppearanceCategory.class));
}
Expand All @@ -51,7 +51,7 @@ void testGetCategory(@SuppressWarnings("unused") JenkinsRule r) {
* Test behavior of {@link CustomFolderIconConfiguration#getRequiredGlobalConfigPagePermission()}.
*/
@Test
void testGetRequiredGlobalConfigPagePermission(@SuppressWarnings("unused") JenkinsRule r) {
void getRequiredGlobalConfigPagePermission(@SuppressWarnings("unused") JenkinsRule r) {
CustomFolderIconConfiguration descriptor = new CustomFolderIconConfiguration();
assertEquals(Jenkins.MANAGE, descriptor.getRequiredGlobalConfigPagePermission());
}
Expand All @@ -62,7 +62,7 @@ void testGetRequiredGlobalConfigPagePermission(@SuppressWarnings("unused") Jenki
* @throws Exception in case anything goes wrong
*/
@Test
void testGetDiskUsage(JenkinsRule r) throws Exception {
void getDiskUsage(JenkinsRule r) throws Exception {
CustomFolderIconConfiguration descriptor = new CustomFolderIconConfiguration();

FilePath file = createCustomIconFile(r);
Expand All @@ -77,7 +77,7 @@ void testGetDiskUsage(JenkinsRule r) throws Exception {
* @throws Exception in case anything goes wrong
*/
@Test
void testGetDiskUsageNoIcons(JenkinsRule r) throws Exception {
void getDiskUsageNoIcons(JenkinsRule r) throws Exception {
CustomFolderIconConfiguration descriptor = new CustomFolderIconConfiguration();

FilePath parent = r.jenkins
Expand All @@ -94,7 +94,7 @@ void testGetDiskUsageNoIcons(JenkinsRule r) throws Exception {
* Test behavior of {@link CustomFolderIconConfiguration#getDiskUsage()}}.
*/
@Test
void testGetDiskUsageNoRoot(@SuppressWarnings("unused") JenkinsRule r) {
void getDiskUsageNoRoot(@SuppressWarnings("unused") JenkinsRule r) {
CustomFolderIconConfiguration descriptor = new CustomFolderIconConfiguration();

String usage = descriptor.getDiskUsage();
Expand All @@ -105,7 +105,7 @@ void testGetDiskUsageNoRoot(@SuppressWarnings("unused") JenkinsRule r) {
* Test behavior of {@link CustomFolderIconConfiguration#getDiskUsage()}}.
*/
@Test
void testGetDiskUsageWithException(JenkinsRule r) throws Exception {
void getDiskUsageWithException(JenkinsRule r) throws Exception {
CustomFolderIconConfiguration descriptor = new CustomFolderIconConfiguration();

FilePath userContent = r.jenkins.getRootPath().child(CustomFolderIconConfiguration.USER_CONTENT_PATH);
Expand Down Expand Up @@ -136,7 +136,7 @@ void testGetDiskUsageWithException(JenkinsRule r) throws Exception {
* @throws Exception in case anything goes wrong
*/
@Test
void testDoCleanupNoItems(JenkinsRule r) throws Exception {
void doCleanupNoItems(JenkinsRule r) throws Exception {
CustomFolderIconConfiguration descriptor = new CustomFolderIconConfiguration();

try (MockedStatic<Stapler> stapler = mockStatic(Stapler.class)) {
Expand All @@ -156,7 +156,7 @@ void testDoCleanupNoItems(JenkinsRule r) throws Exception {
* @throws Exception in case anything goes wrong
*/
@Test
void testDoCleanupMissingIcon(JenkinsRule r) throws Exception {
void doCleanupMissingIcon(JenkinsRule r) throws Exception {
CustomFolderIconConfiguration descriptor = new CustomFolderIconConfiguration();
CustomFolderIcon customIcon = new CustomFolderIcon(DUMMY_PNG);

Expand Down Expand Up @@ -184,7 +184,7 @@ void testDoCleanupMissingIcon(JenkinsRule r) throws Exception {
* @throws Exception in case anything goes wrong
*/
@Test
void testDoCleanupOnlyUsedIcons(JenkinsRule r) throws Exception {
void doCleanupOnlyUsedIcons(JenkinsRule r) throws Exception {
CustomFolderIconConfiguration descriptor = new CustomFolderIconConfiguration();
CustomFolderIcon customIcon = new CustomFolderIcon(DUMMY_PNG);

Expand All @@ -211,7 +211,7 @@ void testDoCleanupOnlyUsedIcons(JenkinsRule r) throws Exception {
* @throws Exception in case anything goes wrong
*/
@Test
void testDoCleanupUsedAndUnusedIcons(JenkinsRule r) throws Exception {
void doCleanupUsedAndUnusedIcons(JenkinsRule r) throws Exception {
FilePath dummy = createCustomIconFile(r);
FilePath unused = createCustomIconFile(r);

Expand Down Expand Up @@ -240,7 +240,7 @@ void testDoCleanupUsedAndUnusedIcons(JenkinsRule r) throws Exception {
* @throws Exception in case anything goes wrong
*/
@Test
void testDoCleanupNoRoot(JenkinsRule r) throws Exception {
void doCleanupNoRoot(JenkinsRule r) throws Exception {
CustomFolderIconConfiguration descriptor = new CustomFolderIconConfiguration();

try (MockedStatic<Stapler> stapler = mockStatic(Stapler.class)) {
Expand All @@ -265,7 +265,7 @@ void testDoCleanupNoRoot(JenkinsRule r) throws Exception {
* @throws Exception in case anything goes wrong
*/
@Test
void testDoCleanupFileNotDeleted(JenkinsRule r) throws Exception {
void doCleanupFileNotDeleted(JenkinsRule r) throws Exception {
CustomFolderIconConfiguration descriptor = new CustomFolderIconConfiguration();

try (MockedStatic<Stapler> stapler = mockStatic(Stapler.class)) {
Expand Down Expand Up @@ -306,7 +306,7 @@ void testDoCleanupFileNotDeleted(JenkinsRule r) throws Exception {
* @throws Exception in case anything goes wrong
*/
@Test
void testDoCleanupFileNotDeletedWithException(JenkinsRule r) throws Exception {
void doCleanupFileNotDeletedWithException(JenkinsRule r) throws Exception {
CustomFolderIconConfiguration descriptor = new CustomFolderIconConfiguration();

try (MockedStatic<Stapler> stapler = mockStatic(Stapler.class)) {
Expand Down Expand Up @@ -345,10 +345,10 @@ public void run() {
* Test behavior of {@link CustomFolderIconConfiguration#doCleanup(StaplerRequest2)} if a file can not be deleted due to an exception.
*
* @throws Exception in case anything goes wrong
* @implNote Sometimes {@link #testDoCleanupFileNotDeletedWithException(JenkinsRule)} does not work.
* @implNote Sometimes {@link #doCleanupFileNotDeletedWithException(JenkinsRule)} does not work.
*/
@Test
void testDoCleanupFileNotDeletedWithMockedException(JenkinsRule r) throws Exception {
void doCleanupFileNotDeletedWithMockedException(JenkinsRule r) throws Exception {
CustomFolderIconConfiguration descriptor = new CustomFolderIconConfiguration();

try (MockedStatic<Stapler> stapler = mockStatic(Stapler.class)) {
Expand Down
Loading

0 comments on commit af67436

Please sign in to comment.