Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .java-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
21.0.4
4 changes: 1 addition & 3 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,12 @@

## Release 4.2 [unreleased]
Brief summary of what's in this release:
Removed the calls to Notification Service and the configuration to talk to it since we are no longer sending success emails

### 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.

---

Expand Down
27 changes: 0 additions & 27 deletions src/main/java/org/kpmp/stateManager/NotificationHandler.java

This file was deleted.

6 changes: 1 addition & 5 deletions src/main/java/org/kpmp/stateManager/StateService.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,17 @@ public class StateService {
private String uploadFailedState;
@Value("${package.state.upload.succeeded}")
private String uploadSucceededState;
private NotificationHandler notificationHandler;
private StateDisplayRepository stateDisplayRepo;

@Autowired
public StateService(CustomStateRepository stateRepository, NotificationHandler notificationHandler,
StateDisplayRepository stateDisplayRepo) {
public StateService(CustomStateRepository stateRepository, StateDisplayRepository stateDisplayRepo) {
this.stateRepository = stateRepository;
this.notificationHandler = notificationHandler;
this.stateDisplayRepo = stateDisplayRepo;
}

@CacheEvict(value = "states", allEntries = true)
public String setState(State state, String origin) {
State savedState = stateRepository.save(state);
notificationHandler.sendNotification(state.getPackageId(), state.getState(), origin, state.getCodicil());
return savedState.getId();
}

Expand Down
3 changes: 0 additions & 3 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ spring.main.banner-mode=off
state.service.host=http://localhost:3060
state.service.endpoint=/v1/state/host

notification.service.host=http://eridanus-spring:3040
notification.endpoint=/v2/notifications/package

data-manager.service.host=http://data-manager-service:5000
data-manager.service.endpoint=/v1/dlu

Expand Down
58 changes: 0 additions & 58 deletions src/test/java/org/kpmp/stateManager/NotificationHandlerTest.java

This file was deleted.

5 changes: 1 addition & 4 deletions src/test/java/org/kpmp/stateManager/StateServiceTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,12 @@ public class StateServiceTest {
private CustomStateRepository stateRepository;
private StateService service;
@Mock
private NotificationHandler notificationHandler;
@Mock
private StateDisplayRepository stateDisplayRepo;

@BeforeEach
public void setUp() throws Exception {
MockitoAnnotations.openMocks(this);
service = new StateService(stateRepository, notificationHandler, stateDisplayRepo);
service = new StateService(stateRepository, stateDisplayRepo);
ReflectionTestUtils.setField(service, "uploadFailedState", "UPLOAD_FAILED");
ReflectionTestUtils.setField(service, "uploadSucceededState", "UPLOAD_SUCCEEDED");
}
Expand All @@ -56,7 +54,6 @@ public void testSetState() {

assertEquals("id", stateId);
verify(stateRepository).save(state);
verify(notificationHandler).sendNotification("packageId", "state", "origin", "codicil");
}

@Test
Expand Down
Loading