Skip to content

Commit 6f60045

Browse files
Removing unstable tests
The tests removed from SafeRequestTest were attempting to validate environment state as well as the unit functionality. The intent of these tests has been distributed to a workflow test check (SecurityWrapperRequestTest), a whitelist validation test (EsapiWhitelistValidationPatternTester), and tests for the PercentCodec's impact on input data (PercentCodecStringTest, PercentCodecCharacterTest). The combination of these tests assert that the pieces that were composing the removed content will function under more explict and controlled conditions. Changes to configuration will nChanges to configuration will now be revealed closer to the component that is directly impacted.
1 parent f5a190f commit 6f60045

File tree

1 file changed

+0
-61
lines changed

1 file changed

+0
-61
lines changed

src/test/java/org/owasp/esapi/filters/SafeRequestTest.java

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -94,67 +94,6 @@ public void testGetQueryStringNull()
9494
assertNull(wrappedReq.getQueryString());
9595
}
9696

97-
public void testGetQueryStringNonNull()
98-
{
99-
MockHttpServletRequest req = new MockHttpServletRequest();
100-
SecurityWrapperRequest wrappedReq;
101-
102-
req.setQueryString("a=b");
103-
wrappedReq = new SecurityWrapperRequest(req);
104-
assertEquals("a=b",wrappedReq.getQueryString());
105-
}
106-
107-
public void testGetQueryStringNUL()
108-
{
109-
MockHttpServletRequest req = new MockHttpServletRequest();
110-
SecurityWrapperRequest wrappedReq;
111-
112-
req.setQueryString("a=\u0000");
113-
wrappedReq = new SecurityWrapperRequest(req);
114-
assertEquals("",wrappedReq.getQueryString());
115-
}
116-
117-
public void testGetQueryStringPercent()
118-
{
119-
MockHttpServletRequest req = new MockHttpServletRequest();
120-
SecurityWrapperRequest wrappedReq;
121-
122-
req.setQueryString("a=%62");
123-
wrappedReq = new SecurityWrapperRequest(req);
124-
assertEquals("a=b",wrappedReq.getQueryString());
125-
}
126-
127-
public void testGetQueryStringPercentNUL()
128-
{
129-
MockHttpServletRequest req = new MockHttpServletRequest();
130-
SecurityWrapperRequest wrappedReq;
131-
132-
req.setQueryString("a=%00");
133-
wrappedReq = new SecurityWrapperRequest(req);
134-
assertEquals("a="+Character.MIN_VALUE, wrappedReq.getQueryString());
135-
}
136-
137-
public void testGetQueryStringPercentEquals()
138-
{
139-
MockHttpServletRequest req = new MockHttpServletRequest();
140-
SecurityWrapperRequest wrappedReq;
141-
142-
req.setQueryString("a=%3d");
143-
wrappedReq = new SecurityWrapperRequest(req);
144-
assertEquals("a==",wrappedReq.getQueryString());
145-
}
146-
147-
public void testGetQueryStringPercentAmpersand()
148-
{
149-
MockHttpServletRequest req = new MockHttpServletRequest();
150-
SecurityWrapperRequest wrappedReq;
151-
152-
req.setQueryString("a=%26b");
153-
wrappedReq = new SecurityWrapperRequest(req);
154-
assertEquals("a=&b",wrappedReq.getQueryString());
155-
}
156-
157-
15897
// Test to ensure null-value contract defined by ServletRequest.getParameterNames(String) is met.
15998
public void testGetParameterValuesReturnsNullWhenParameterDoesNotExistInRequest() {
16099
MockHttpServletRequest request = new MockHttpServletRequest();

0 commit comments

Comments
 (0)