-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cover exceptions begin convering JsonUtil Added test for describeTo Added test for toLocalDate Added assertDoesNotThrow for functions to handle exception Added test for uhCasAttributes default constructor Added toString test for Membership class (type) Added test for person class subject constructor (type) Added test for group class isMember (type) Added tests for GroupingsServiceResultException class constructor, getGsr and setGsr (type) Added test for GroupingMember Added test for GroupingsUpdatedAttributesResult (groupings) Added test for GroupingGroupsMembers (groupings) Added test for GroupingSyncDestination (groupings) Added test for hasUHAttributes (wrapper -> SubjectTest) Added test for getBoolean (Wrapper -> ResultsTest) Added test for isTimeUpdated (Wrapper -> UpdatedTimestampResult) Create AttributeAssignValueResultTest and add tests Refactor construction to constructor Added more tests for AssignAttributesResultsTest Added nullResultCode (wrapper -> UpdatedTimestampResult) Added null test for ParentGroupingPath (service → PathFilter) Begin covering MemberService Cover some test in GroupingAssignmentServiceTest, and MemberServiceTest Remove unused functions Cover JavaVersionChecker Implement AsyncJobsManagerTest and cover (Service) FIx import Implement ExecutorServiceTest and add tests Add addAdminTest Implement addOwnershipsTest Implement removeAdminTest Implement removeOwnershipsTest and addIncludeMembersTest Implemented addExcludeMembersTest, removeIncludeMembersTest, removeIncludeMemberTest, removeExcludeMembersTest, removeExcludeMemberTest, optInTest, and optOutTest Removed getGroupingTest Increase Unit test code coverage cover exceptions begin convering JsonUtil Fixed conflict Removed unused import
- Loading branch information
1 parent
1373ced
commit 4a730a8
Showing
39 changed files
with
1,237 additions
and
67 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
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
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
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
18 changes: 18 additions & 0 deletions
18
src/test/java/edu/hawaii/its/api/exception/InvalidGroupPathExceptionTest.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,18 @@ | ||
package edu.hawaii.its.api.exception; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class InvalidGroupPathExceptionTest { | ||
|
||
@Test | ||
public void construction() { | ||
InvalidGroupPathException exception = new InvalidGroupPathException("fail"); | ||
assertNotNull(exception); | ||
assertEquals("404 NOT_FOUND \"fail\"", exception.getMessage()); | ||
|
||
} | ||
|
||
} |
17 changes: 17 additions & 0 deletions
17
src/test/java/edu/hawaii/its/api/exception/JavaVersionExceptionTest.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,17 @@ | ||
package edu.hawaii.its.api.exception; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class JavaVersionExceptionTest { | ||
|
||
@Test | ||
public void construction() { | ||
JavaVersionException exception = new JavaVersionException("fail"); | ||
assertNotNull(exception); | ||
assertEquals("fail", exception.getMessage()); | ||
|
||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
src/test/java/edu/hawaii/its/api/exception/JavaVersionFailureAnalyzerTest.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,17 @@ | ||
package edu.hawaii.its.api.exception; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class JavaVersionFailureAnalyzerTest { | ||
|
||
@Test | ||
public void analyze() { | ||
JavaVersionFailureAnalyzer javaVersionFailureAnalyzer = new JavaVersionFailureAnalyzer(); | ||
Throwable throwable = new Throwable(); | ||
JavaVersionException exception = new JavaVersionException(""); | ||
assertNotNull(javaVersionFailureAnalyzer.analyze(throwable, exception)); | ||
|
||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
src/test/java/edu/hawaii/its/api/exception/PasswordFoundAnalyzerTest.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,18 @@ | ||
package edu.hawaii.its.api.exception; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class PasswordFoundAnalyzerTest { | ||
|
||
@Test | ||
public void analyze() { | ||
PasswordFoundAnalyzer passwordFoundAnalyzer = new PasswordFoundAnalyzer(); | ||
Throwable throwable = new Throwable(); | ||
PasswordFoundException exception = new PasswordFoundException(""); | ||
assertNotNull(passwordFoundAnalyzer.analyze(throwable, exception)); | ||
|
||
} | ||
|
||
} |
16 changes: 16 additions & 0 deletions
16
src/test/java/edu/hawaii/its/api/exception/PasswordFoundExceptionTest.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,16 @@ | ||
package edu.hawaii.its.api.exception; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
import org.junit.jupiter.api.Test; | ||
public class PasswordFoundExceptionTest { | ||
|
||
@Test | ||
public void construction() { | ||
PasswordFoundException exception = new PasswordFoundException("location"); | ||
assertNotNull(exception); | ||
assertEquals("location", exception.getMessage()); | ||
|
||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
src/test/java/edu/hawaii/its/api/exception/PatternFoundExceptionTest.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,16 @@ | ||
package edu.hawaii.its.api.exception; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
import org.junit.jupiter.api.Test; | ||
public class PatternFoundExceptionTest { | ||
|
||
@Test | ||
public void construction() { | ||
PatternFoundException exception = new PatternFoundException("fail"); | ||
assertNotNull(exception); | ||
assertEquals("fail", exception.getMessage()); | ||
|
||
} | ||
} |
9 changes: 4 additions & 5 deletions
9
src/test/java/edu/hawaii/its/api/exception/UhMemberNotFoundExceptionTest.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 |
---|---|---|
@@ -1,17 +1,16 @@ | ||
package edu.hawaii.its.api.exception; | ||
|
||
import static org.hamcrest.CoreMatchers.equalTo; | ||
import static org.hamcrest.MatcherAssert.assertThat; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
public class UhMemberNotFoundExceptionTest { | ||
|
||
@Test | ||
public void construction() { | ||
UhMemberNotFoundException ex = new UhMemberNotFoundException("fail"); | ||
assertNotNull(ex); | ||
assertThat(ex.getMessage(), equalTo("404 NOT_FOUND \"fail\"")); | ||
UhMemberNotFoundException exception = new UhMemberNotFoundException("fail"); | ||
assertNotNull(exception); | ||
assertEquals("404 NOT_FOUND \"fail\"", exception.getMessage()); | ||
} | ||
} |
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
49 changes: 49 additions & 0 deletions
49
src/test/java/edu/hawaii/its/api/groupings/GroupingMemberTest.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,49 @@ | ||
package edu.hawaii.its.api.groupings; | ||
|
||
import edu.hawaii.its.api.wrapper.Subject; | ||
import edu.internet2.middleware.grouperClient.ws.beans.WsSubject; | ||
import org.junit.jupiter.api.BeforeAll; | ||
import org.junit.jupiter.api.Test; | ||
import edu.hawaii.its.api.util.JsonUtil; | ||
|
||
import java.io.FileInputStream; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
import java.util.Properties; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.junit.jupiter.api.Assertions.assertNotNull; | ||
|
||
public class GroupingMemberTest { | ||
private static Properties properties; | ||
|
||
@BeforeAll | ||
public static void beforeAll() throws Exception { | ||
Path path = Paths.get("src/test/resources"); | ||
Path file = path.resolve("grouper.test.properties"); | ||
properties = new Properties(); | ||
properties.load(new FileInputStream(file.toFile())); | ||
} | ||
|
||
@Test | ||
public void construction() { | ||
String json = properties.getProperty("ws.subject.success.uid"); | ||
WsSubject wsSubject = JsonUtil.asObject(json, WsSubject.class); | ||
Subject subject = new Subject(wsSubject); | ||
GroupingGroupMember groupingGroupMember = new GroupingGroupMember(subject); | ||
GroupingMember groupingMember = new GroupingMember(groupingGroupMember, "Include"); | ||
assertNotNull(groupingMember); | ||
|
||
assertEquals("Testf-iwt-a TestIAM-staff", groupingMember.getName()); | ||
assertEquals("99997010", groupingMember.getUhUuid()); | ||
assertEquals("testiwta", groupingMember.getUid()); | ||
assertEquals("Include", groupingMember.getWhereListed()); | ||
|
||
groupingMember = new GroupingMember(); | ||
assertNotNull(groupingMember); | ||
assertNotNull(groupingMember.getName()); | ||
assertNotNull(groupingMember.getUhUuid()); | ||
assertNotNull(groupingMember.getUid()); | ||
assertNotNull(groupingMember.getWhereListed()); | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
src/test/java/edu/hawaii/its/api/groupings/GroupingSyncDestinationTest.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,24 @@ | ||
package edu.hawaii.its.api.groupings; | ||
|
||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class GroupingSyncDestinationTest { | ||
|
||
@Test | ||
public void test() { | ||
GroupingSyncDestination dest = new GroupingSyncDestination(); | ||
dest.setDescription("description"); | ||
dest.setName("name"); | ||
dest.setHidden(false); | ||
dest.setSynced(true); | ||
dest.setTooltip("tooltip"); | ||
|
||
assertEquals("description", dest.getDescription()); | ||
assertEquals("name", dest.getName()); | ||
assertEquals(false, dest.getHidden()); | ||
assertEquals(true, dest.getSynced()); | ||
assertEquals("tooltip", dest.getTooltip()); | ||
} | ||
} |
Oops, something went wrong.