forked from I-TECH-UW/OpenELIS-Global-2
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
send-Notififcation-to-configured-sources
- Loading branch information
1 parent
ec425b9
commit 6efdf69
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
src/test/java/org/openelisglobal/TestNotificationServiceTest/NotificationServiceTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package org.openelisglobal.TestNotificationServiceTest; | ||
|
||
import org.junit.Before; | ||
import org.junit.Test; | ||
import org.junit.runner.RunWith; | ||
import org.openelisglobal.BaseTestConfig; | ||
import org.openelisglobal.BaseWebContextSensitiveTest; | ||
import org.openelisglobal.analysis.valueholder.Analysis; | ||
import org.openelisglobal.notification.service.TestNotificationServiceImpl; | ||
import org.openelisglobal.result.valueholder.Result; | ||
import org.openelisglobal.notification.valueholder.NotificationConfigOption; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.test.context.ActiveProfiles; | ||
import org.springframework.test.context.ContextConfiguration; | ||
import org.springframework.test.context.TestPropertySource; | ||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; | ||
|
||
@RunWith(SpringJUnit4ClassRunner.class) | ||
@ContextConfiguration(classes = { BaseTestConfig.class }) | ||
@TestPropertySource("classpath:common.properties") | ||
@ActiveProfiles("test") | ||
public class NotificationServiceTest extends BaseWebContextSensitiveTest { | ||
|
||
@Autowired | ||
private TestNotificationServiceImpl testNotificationService; | ||
|
||
@Before | ||
public void init() throws Exception { | ||
super.setUp(); | ||
} | ||
|
||
@Test | ||
public void testCreateAndSendNotificationsToConfiguredSources() { | ||
Result result = new Result(); | ||
result.setId("sampleResultId"); | ||
result.setValue("sampleValue"); | ||
|
||
Analysis analysis = new Analysis(); | ||
analysis.setId("sampleAnalysisId"); | ||
result.setAnalysis(analysis); | ||
|
||
result.setResultType("sampleResultType"); | ||
result.setSortOrder("1"); | ||
|
||
testNotificationService.createAndSendNotificationsToConfiguredSources( | ||
NotificationConfigOption.NotificationNature.RESULT_VALIDATION, result); | ||
|
||
// Add more assertions as needed | ||
} | ||
} |