").text(authorityItem.authority));
+ });
+ var $authorities = $("").text("Authorities:");
+ $authorities.append($authorityList);
+
+ $userInfoBody.append($authorities);
+ $userInfo.show();
+ }
+ });
+ }
+
+ function showTokenInformation() {
+ $loggedIn
+ .text("Token: " + getJwtToken())
+ .attr("title", "Token: " + getJwtToken())
+ .show();
+ }
+
+ function showResponse(statusCode, message) {
+ $response
+ .empty()
+ .text("status code: " + statusCode + "\n-------------------------\n" + message);
+ }
+
+ // REGISTER EVENT LISTENERS =============================================================
+ $("#loginForm").submit(function (event) {
+ event.preventDefault();
+
+ var $form = $(this);
+ var formData = {
+ username: $form.find('input[name="username"]').val(),
+ password: $form.find('input[name="password"]').val()
+ };
+
+ doLogin(formData);
+ });
+
+ $("#logoutButton").click(doLogout);
+
+ $("#exampleServiceBtn").click(function () {
+ $.ajax({
+ url: "/api/v1/evaluations/154",
+ type: "GET",
+ contentType: "application/json; charset=utf-8",
+ dataType: "json",
+ headers: createAuthorizationTokenHeader(),
+ success: function (data, textStatus, jqXHR) {
+ showResponse(jqXHR.status, JSON.stringify(data));
+ },
+ error: function (jqXHR, textStatus, errorThrown) {
+ showResponse(jqXHR.status, errorThrown);
+ }
+ });
+ });
+
+ $("#adminServiceBtn").click(function () {
+ $.ajax({
+ url: "/api/v1/batches/171",
+ type: "GET",
+ contentType: "application/json; charset=utf-8",
+ headers: createAuthorizationTokenHeader(),
+ success: function (data, textStatus, jqXHR) {
+ showResponse(jqXHR.status, data);
+ },
+ error: function (jqXHR, textStatus, errorThrown) {
+ showResponse(jqXHR.status, errorThrown);
+ }
+ });
+ });
+
+ $loggedIn.click(function () {
+ $loggedIn
+ .toggleClass("text-hidden")
+ .toggleClass("text-shown");
+ });
+
+ // INITIAL CALLS =============================================================
+ if (getJwtToken()) {
+ $login.hide();
+ $notLoggedIn.hide();
+ showTokenInformation();
+ showUserInformation();
+ }
+});
\ No newline at end of file
diff --git a/src/test/java/com/revature/InterviewEvaluationsApplicationTests.java b/src/test/java/com/revature/InterviewEvaluationsApplicationTests.java
deleted file mode 100644
index e2e449e..0000000
--- a/src/test/java/com/revature/InterviewEvaluationsApplicationTests.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package com.revature;
-
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
-
-@RunWith(SpringRunner.class)
-@SpringBootTest
-public class InterviewEvaluationsApplicationTests {
-
- @Test
- public void contextLoads() {
- }
-
-}
diff --git a/src/test/java/com/revature/spring/test/PersonEntityTest.java b/src/test/java/com/revature/spring/test/PersonEntityTest.java
deleted file mode 100644
index e69de29..0000000