Skip to content

Commit

Permalink
SAK-40766 Unit tests for LTI (sakaiproject#6137)
Browse files Browse the repository at this point in the history
* SAK-40766
Minor javadoc cleanup

* SAK-40766
Building out unit tests for BasicLTIUtil

* SAK-40766
Codacy cleanup

* SAK-40766
Codacy cleanup
  • Loading branch information
maurercw authored and ern committed Oct 16, 2018
1 parent c1ac548 commit 7d5d42d
Show file tree
Hide file tree
Showing 8 changed files with 551 additions and 12 deletions.
9 changes: 9 additions & 0 deletions basiclti/tsugi-util/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@
<artifactId>nimbus-jose-jwt</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>
<!--
<dependency>
<groupId>org.bouncycastle</groupId>
Expand All @@ -83,5 +87,10 @@
<directory>src/main/resources</directory>
</resource>
</resources>
<testResources>
<testResource>
<directory>src/test/resources</directory>
</testResource>
</testResources>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ public static String adaptToCustomPropertyName(final String propertyName) {
* Add the necessary fields and sign.
*
* @deprecated See:
* {@link BasicLTIUtil#signProperties(Map, String, String, String, String, String, String, String, String, String)}
* {@link BasicLTIUtil#signProperties(Map, String, String, String, String, String, String, String, String, String, Map)}
*
* @param postProp
* @param url
Expand Down Expand Up @@ -362,7 +362,7 @@ public static Map<String, String> signProperties(
* Check if the properties are properly signed
*
* @deprecated See:
* {@link BasicLTIUtil#checkProperties(Map, String, String, String, String, String, String, String, String, String)}
* {@link BasicLTIUtil#checkProperties(Map, String, String, String, String)}
*
* @param postProp
* @param url
Expand Down Expand Up @@ -427,7 +427,7 @@ public static boolean checkProperties(
/**
* Create the HTML to render a POST form and then automatically submit it.
*
* @deprecated Moved to {@link #postLaunchHTML(Map, String, boolean)}
* @deprecated Moved to {@link #postLaunchHTML(Map, String, String, boolean, Map)}
* @param cleanProperties
* @param endpoint
* The LTI launch url.
Expand All @@ -447,7 +447,7 @@ public static String postLaunchHTML(final Properties cleanProperties,
/**
* Create the HTML to render a POST form and then automatically submit it.
*
* @deprecated Moved to {@link #postLaunchHTML(Map, String, boolean)}
* @deprecated Moved to {@link #postLaunchHTML(Map, String, String, boolean, boolean, Map)}
* @param cleanProperties
* @param endpoint
* The LTI launch url.
Expand Down Expand Up @@ -637,7 +637,7 @@ public static String postLaunchHTML(
* @param method
* @param url
* @param oauth_consumer_key
* @param oauth_consumer_secret
* @param oauth_secret
*/
public static String getOAuthURL(String method, String url,
String oauth_consumer_key, String oauth_secret)
Expand All @@ -650,7 +650,7 @@ public static String getOAuthURL(String method, String url,
* @param method
* @param url
* @param oauth_consumer_key
* @param oauth_consumer_secret
* @param oauth_secret
* @param signature
*/
public static String getOAuthURL(String method, String url,
Expand Down Expand Up @@ -681,7 +681,7 @@ public static String getOAuthURL(String method, String url,
* @param method
* @param url
* @param oauth_consumer_key
* @param oauth_consumer_secret
* @param oauth_secret
* HttpURLConnection connection = sendOAuthURL('GET', url, oauth_consumer_key, oauth_secret)
* int responseCode = connection.getResponseCode();
* String data = readHttpResponse(connection)
Expand Down Expand Up @@ -956,7 +956,6 @@ public static String htmlspecialchars(String input) {
retval = retval.replace("\"", "&quot;");
retval = retval.replace("<", "&lt;");
retval = retval.replace(">", "&gt;");
retval = retval.replace(">", "&gt;");
retval = retval.replace("=", "&#61;");
return retval;
}
Expand All @@ -965,7 +964,7 @@ public static String htmlspecialchars(String input) {
* Simple utility method deal with a request that has the wrong URL when behind
* a proxy.
*
* @param request
* @param servletUrl
* @param extUrl
* The url that the external world sees us as responding to. This needs to be
* up to but not including the last slash like and not include any path information
Expand Down
Loading

0 comments on commit 7d5d42d

Please sign in to comment.