-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new Operations class, `InfoOperations`. Setting will return a String representation of the updated text.
- Loading branch information
Richard Adams
committed
Oct 9, 2016
1 parent
8c865f2
commit 0813d55
Showing
6 changed files
with
110 additions
and
23 deletions.
There are no files selected for viewing
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
12 changes: 12 additions & 0 deletions
12
src/main/java/com/researchspace/dataverse/api/v1/InfoOperations.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,12 @@ | ||
package com.researchspace.dataverse.api.v1; | ||
|
||
import com.researchspace.dataverse.entities.DataverseResponse; | ||
import com.researchspace.dataverse.entities.DvMessage; | ||
|
||
public interface InfoOperations { | ||
|
||
DvMessage getDatasetPublishPopupCustomText () ; | ||
|
||
DataverseResponse<Object> setDatasetPublishPopupCustomText (String text) ; | ||
|
||
} |
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
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
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
37 changes: 37 additions & 0 deletions
37
src/test/java/com/researchspace/dataverse/http/InfoOperationsTest.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,37 @@ | ||
package com.researchspace.dataverse.http; | ||
|
||
import static org.junit.Assert.*; | ||
|
||
import org.apache.commons.lang.StringUtils; | ||
import org.junit.After; | ||
import org.junit.Before; | ||
import org.junit.Test; | ||
|
||
import com.researchspace.dataverse.entities.DataverseResponse; | ||
import com.researchspace.dataverse.entities.DvMessage; | ||
|
||
public class InfoOperationsTest extends AbstractIntegrationTest { | ||
|
||
private static final String NEW_TEXT = "Do you want to publish"; | ||
|
||
@Before | ||
public void setUp() throws Exception { | ||
super.setUp(); | ||
} | ||
|
||
@After | ||
public void tearDown() throws Exception { | ||
} | ||
|
||
@Test | ||
public void testGetSetDatasetPublishPopupCustomText() { | ||
DvMessage originalText = infoOps.getDatasetPublishPopupCustomText(); | ||
assertTrue("Message text was empty", !StringUtils.isEmpty(originalText.getMessage())); | ||
DataverseResponse<Object> response = infoOps.setDatasetPublishPopupCustomText(NEW_TEXT); | ||
assertTrue("New text was not set", response.getData().toString().contains(NEW_TEXT)); | ||
response = infoOps.setDatasetPublishPopupCustomText(originalText.getMessage()); | ||
assertTrue("Originl text was not restored", response.getData().toString().contains(originalText.getMessage())); | ||
} | ||
|
||
|
||
} |