Skip to content

Commit

Permalink
Merge pull request #20 from KPMP/develop
Browse files Browse the repository at this point in the history
Release v4.1
  • Loading branch information
rlreamy authored Oct 15, 2024
2 parents f7bb2fb + 287b976 commit 8c8f0b1
Show file tree
Hide file tree
Showing 12 changed files with 76 additions and 57 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-gradle-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
build-gradle-project:
env:
IMAGE_TAG: 1.3
IMAGE_TAG: 4.1
runs-on: ubuntu-latest
steps:
- name: Get branch names
Expand All @@ -21,12 +21,12 @@ jobs:
uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
with:
gradle-version: 7.4
gradle-version: 8.5

- name: Login to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM alpine
FROM alpine:3.20.0

RUN apk update && \
apk upgrade
RUN apk add openjdk8
RUN apk add openjdk21

VOLUME /tmp
ARG DEPENDENCY=target/dependency
Expand Down
29 changes: 16 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ buildscript {
mavenCentral()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:2.6.4")
classpath("org.springframework.boot:spring-boot-gradle-plugin:3.2.5")
}
}

plugins {
id 'com.palantir.docker' version '0.22.1'
id 'java'
id 'com.palantir.docker' version '0.35.0'
id 'org.springframework.boot' version '3.2.5'
}

group = 'kingstonduo'
version = "latest"
version = "4.1"

apply plugin: 'java'
apply plugin: 'eclipse'
Expand All @@ -27,8 +29,7 @@ eclipse {


jar {
baseName='eridanus-data'
version= '1.3'
archivesBaseName='eridanus-data'
}

repositories {
Expand All @@ -41,16 +42,18 @@ processResources {
}
}

sourceCompatibility = 1.8
targetCompatibility = 1.8
sourceCompatibility = '21'
targetCompatibility = '21'

dependencies {
implementation("org.springframework.boot:spring-boot-starter-data-mongodb")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.sun.mail:javax.mail:1.6.2")
testImplementation("org.mockito:mockito-core")
testImplementation("org.springframework.boot:spring-boot-starter-test")
testImplementation 'junit:junit:4.12'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.mockito:mockito-core'
testImplementation('org.mockito:mockito-junit-jupiter:3.12.4')
testImplementation 'org.springframework:spring-test:5.2.25.RELEASE'
}

springBoot {
Expand Down Expand Up @@ -79,15 +82,15 @@ def getCurrentGitBranch() {
} catch (e) {
}
if (gitBranch == "develop" || gitBranch == "master"){
return jar.version
return project.version
}else{
return gitBranch
}
}
}

docker {
name "kingstonduo/${jar.baseName}:" + getCurrentGitBranch()
name "kingstonduo/eridanus-data:" + getCurrentGitBranch()
copySpec.from(tasks.unpack.outputs).into("dependency")
buildArgs(['DEPENDENCY': "dependency"])
}
}
15 changes: 15 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Changelog

## Release 4.1 [unreleased]
Brief summary of what's in this release:
- upgrade to Java 21


### Breaking changes

Breaking changes include any database updates needed, if we need to edit any files on system (like .env or certs, etc). Things that are outside of the code itself that need changed for the system to work.


### Non-breaking changes

Just a place to keep track of things that have changed in the code that we may want to pay special attention to when smoke testing, etc.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.kpmp.eridanus.notifications;

import javax.mail.MessagingException;
import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down
4 changes: 1 addition & 3 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
libra.data.version=${jar.baseName}-${jar.version}

server.port=3040
server.port=3040

spring.main.banner-mode=off
spring.data.mongodb.uri=mongodb://mongodb:27017/dataLake
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package org.kpmp.eridanus.notifications;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import javax.mail.MessagingException;
import javax.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletRequest;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

Expand All @@ -20,14 +20,15 @@ public class NotificationControllerTest {
private PackageNotificationEventService packageEventService;
private NotificationController controller;

@Before
@BeforeEach
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
MockitoAnnotations.openMocks(this);
controller = new NotificationController(packageEventService);
}

@After
@AfterEach
public void tearDown() throws Exception {
MockitoAnnotations.openMocks(this).close();
controller = null;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package org.kpmp.eridanus.notifications;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.verify;
Expand All @@ -13,9 +13,9 @@

import javax.mail.MessagingException;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
Expand All @@ -29,17 +29,18 @@ public class PackageNotificationEventServiceTest {
@Mock
private PackageRepository packageRepository;

@Before
@BeforeEach
public void setUp() throws Exception {
MockitoAnnotations.initMocks(this);
MockitoAnnotations.openMocks(this);
service = new PackageNotificationEventService(emailer, packageRepository);
ReflectionTestUtils.setField(service, "toAddresses", Arrays.asList("[email protected]"));
ReflectionTestUtils.setField(service, "uploadSuccess", "success");
ReflectionTestUtils.setField(service, "uploadFail", "fail");
}

@After
@AfterEach
public void tearDown() throws Exception {
MockitoAnnotations.openMocks(this).close();
service = null;
}

Expand Down
13 changes: 7 additions & 6 deletions src/test/java/org/kpmp/eridanus/notifications/PackageTest.java
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
package org.kpmp.eridanus.notifications;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

import java.util.Date;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;


public class PackageTest {

private Package pkg;

@Before
@BeforeEach
public void setUp() throws Exception {
pkg = new Package();
}

@After
@AfterEach
public void tearDown() throws Exception {
pkg = null;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
package org.kpmp.eridanus.notifications;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class StateChangeEventTest extends StateChangeEvent {

private StateChangeEvent event;

@Before
@BeforeEach
public void setUp() throws Exception {
event = new StateChangeEvent();
}

@After
@AfterEach
public void tearDown() throws Exception {
event = null;
}
Expand Down
12 changes: 6 additions & 6 deletions src/test/java/org/kpmp/eridanus/notifications/UserTest.java
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
package org.kpmp.eridanus.notifications;

import static org.junit.Assert.assertEquals;
import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;

public class UserTest {

private User user;

@Before
@BeforeEach
public void setUp() throws Exception {
user = new User();
}

@After
@AfterEach
public void tearDown() throws Exception {
user = null;
}
Expand Down

0 comments on commit 8c8f0b1

Please sign in to comment.