Skip to content

Commit

Permalink
Upgrade Jira version to 9.12.5 (LTS)
Browse files Browse the repository at this point in the history
  • Loading branch information
pathob committed Mar 19, 2024
1 parent ddf75e7 commit e705f91
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 25 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</developers>

<properties>
<jira.version>8.15.0</jira.version>
<jira.version>9.12.5</jira.version>
<jira.data.version>8.12.1</jira.data.version>
<!-- other properties -->
<atlassian.ajp.port>8209</atlassian.ajp.port>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.atlassian.jira.config.properties.ApplicationProperties;
import com.atlassian.jira.config.properties.LnFDefaultColorProvider;
import com.atlassian.jira.config.properties.LogoProvider;
import com.atlassian.jira.config.properties.UiSettingsStateManager;
import com.atlassian.jira.config.util.JiraHome;
import com.atlassian.jira.lookandfeel.LogoChoice;
import com.atlassian.jira.lookandfeel.LookAndFeelProperties;
Expand All @@ -20,12 +21,13 @@
import org.mockito.MockedStatic;
import org.mockito.junit.jupiter.MockitoExtension;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Map;

import static de.aservo.confapi.jira.model.util.SettingsColourSchemeBeanUtilTest.getDummyBaseColourScheme;
import static org.junit.jupiter.api.Assertions.*;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.Mockito.*;

@ExtendWith(MockitoExtension.class)
Expand Down Expand Up @@ -86,18 +88,19 @@ void testGetLogo() {
}

@Test
void testSetLogo() {
InputStream is = new ByteArrayInputStream("".getBytes());

try (MockedStatic<ComponentAccessor> componentAccessorMockedStatic = mockStatic(ComponentAccessor.class)) {
componentAccessorMockedStatic.when(() -> ComponentAccessor.getComponent(LnFDefaultColorProvider.class)).thenReturn(mock(LnFDefaultColorProvider.class));
componentAccessorMockedStatic.when(() -> ComponentAccessor.getComponent(LogoProvider.class)).thenReturn(mock(LogoProvider.class));
componentAccessorMockedStatic.when(() -> ComponentAccessor.getComponent(EventPublisher.class)).thenReturn(mock(EventPublisher.class));

settingsBrandingService.setLogo(is);
void testSetLogo() throws IOException {
try (InputStream is = getClass().getClassLoader().getResourceAsStream("images/plugin-icon.png")) {
try (MockedStatic<ComponentAccessor> componentAccessorMockedStatic = mockStatic(ComponentAccessor.class)) {
componentAccessorMockedStatic.when(() -> ComponentAccessor.getComponent(LnFDefaultColorProvider.class)).thenReturn(mock(LnFDefaultColorProvider.class));
componentAccessorMockedStatic.when(() -> ComponentAccessor.getComponent(LogoProvider.class)).thenReturn(mock(LogoProvider.class));
componentAccessorMockedStatic.when(() -> ComponentAccessor.getComponent(EventPublisher.class)).thenReturn(mock(EventPublisher.class));
componentAccessorMockedStatic.when(() -> ComponentAccessor.getComponent(UiSettingsStateManager.class)).thenReturn(mock(UiSettingsStateManager.class));

settingsBrandingService.setLogo(is);
}

verify(lookAndFeelProperties).setLogoChoice(LogoChoice.UPLOAD);
}

verify(lookAndFeelProperties).setLogoChoice(LogoChoice.UPLOAD);
}

//InternalServerErrorException -> FileNotFoundException is expected because no logofile is present in the filesystem at test time
Expand All @@ -109,17 +112,18 @@ void testGetFavicon() {
}

@Test
void testSetFavicon() {
final InputStream is = new ByteArrayInputStream("".getBytes());

try (MockedStatic<ComponentAccessor> componentAccessorMockedStatic = mockStatic(ComponentAccessor.class)) {
componentAccessorMockedStatic.when(() -> ComponentAccessor.getComponent(LnFDefaultColorProvider.class)).thenReturn(mock(LnFDefaultColorProvider.class));
componentAccessorMockedStatic.when(() -> ComponentAccessor.getComponent(LogoProvider.class)).thenReturn(mock(LogoProvider.class));
componentAccessorMockedStatic.when(() -> ComponentAccessor.getComponent(EventPublisher.class)).thenReturn(mock(EventPublisher.class));

settingsBrandingService.setFavicon(is);
void testSetFavicon() throws IOException {
try (InputStream is = getClass().getClassLoader().getResourceAsStream("images/plugin-icon.png")) {
try (MockedStatic<ComponentAccessor> componentAccessorMockedStatic = mockStatic(ComponentAccessor.class)) {
componentAccessorMockedStatic.when(() -> ComponentAccessor.getComponent(LnFDefaultColorProvider.class)).thenReturn(mock(LnFDefaultColorProvider.class));
componentAccessorMockedStatic.when(() -> ComponentAccessor.getComponent(LogoProvider.class)).thenReturn(mock(LogoProvider.class));
componentAccessorMockedStatic.when(() -> ComponentAccessor.getComponent(EventPublisher.class)).thenReturn(mock(EventPublisher.class));
componentAccessorMockedStatic.when(() -> ComponentAccessor.getComponent(UiSettingsStateManager.class)).thenReturn(mock(UiSettingsStateManager.class));

settingsBrandingService.setFavicon(is);
}

verify(lookAndFeelProperties).setFaviconChoice(LogoChoice.UPLOAD);
}

verify(lookAndFeelProperties).setFaviconChoice(LogoChoice.UPLOAD);
}
}

0 comments on commit e705f91

Please sign in to comment.