Corrected bean setup for checkForHttps case tests.

pull/685/merge
John Brooks 2014-10-03 23:22:00 -04:00 committed by Justin Richer
parent acc4cf16bd
commit 3e3613f471
1 changed files with 10 additions and 4 deletions

View File

@ -60,6 +60,7 @@ public class ConfigurationPropertiesBeanTest {
// issuer is http // issuer is http
// leave as default, which is unset/false // leave as default, which is unset/false
try { try {
bean.setIssuer("http://localhost:8080/openid-connect-server/");
bean.checkForHttps(); bean.checkForHttps();
} }
catch (HttpsUrlRequiredException e) { catch (HttpsUrlRequiredException e) {
@ -73,6 +74,7 @@ public class ConfigurationPropertiesBeanTest {
// issuer is http // issuer is http
// set to false // set to false
try { try {
bean.setIssuer("http://localhost:8080/openid-connect-server/");
bean.setForceHttps(false); bean.setForceHttps(false);
bean.checkForHttps(); bean.checkForHttps();
} }
@ -86,6 +88,7 @@ public class ConfigurationPropertiesBeanTest {
ConfigurationPropertiesBean bean = new ConfigurationPropertiesBean(); ConfigurationPropertiesBean bean = new ConfigurationPropertiesBean();
// issuer is http // issuer is http
// set to true // set to true
bean.setIssuer("http://localhost:8080/openid-connect-server/");
bean.setForceHttps(true); bean.setForceHttps(true);
bean.checkForHttps(); bean.checkForHttps();
} }
@ -96,6 +99,7 @@ public class ConfigurationPropertiesBeanTest {
// issuer is https // issuer is https
// leave as default, which is unset/false // leave as default, which is unset/false
try { try {
bean.setIssuer("https://localhost:8080/openid-connect-server/");
bean.checkForHttps(); bean.checkForHttps();
} }
catch (HttpsUrlRequiredException e) { catch (HttpsUrlRequiredException e) {
@ -109,8 +113,9 @@ public class ConfigurationPropertiesBeanTest {
// issuer is https // issuer is https
// set to false // set to false
try { try {
bean.setForceHttps(false); bean.setIssuer("https://localhost:8080/openid-connect-server/");
bean.checkForHttps(); bean.setForceHttps(false);
bean.checkForHttps();
} }
catch (HttpsUrlRequiredException e) { catch (HttpsUrlRequiredException e) {
fail("Unexpected HttpsUrlRequiredException for https issuer with forceHttps=false, message:" + e.getError()); fail("Unexpected HttpsUrlRequiredException for https issuer with forceHttps=false, message:" + e.getError());
@ -123,8 +128,9 @@ public class ConfigurationPropertiesBeanTest {
// issuer is https // issuer is https
// set to true // set to true
try { try {
bean.setForceHttps(true); bean.setIssuer("https://localhost:8080/openid-connect-server/");
bean.checkForHttps(); bean.setForceHttps(true);
bean.checkForHttps();
} }
catch (HttpsUrlRequiredException e) { catch (HttpsUrlRequiredException e) {
fail("Unexpected HttpsUrlRequiredException for https issuer with forceHttps=true, message:" + e.getError()); fail("Unexpected HttpsUrlRequiredException for https issuer with forceHttps=true, message:" + e.getError());