- // Try it again for coverage
- SecurityInfoC<HttpURLConnection> siClone = SecurityInfoC.instance(new PropAccess(), HttpURLConnection.class);
- assertThat(siClone, is(si));
- }
-
- @Test
- public void setTest() throws MalformedURLException, CadiException {
- SecurityInfoC<HttpURLConnectionStub> si = SecurityInfoC.instance(new PropAccess(), HttpURLConnectionStub.class);
- SecuritySetter<HttpURLConnectionStub> ss = new SecuritySetterStub<HttpURLConnectionStub>();
- assertThat(si.set(ss), is(si));
- assertThat(si.defSS.getID(), is("Example ID"));
- try {
- si.defSS.setSecurity(new HttpURLConnectionStub());
- fail("Should have thrown an exception");
- } catch (CadiException e) {
- assertTrue(e instanceof CadiException);
- assertThat(e.getMessage(), is("Example exception"));
- }
- assertThat(si.defSS.setLastResponse(0), is(0));
- assertThat(si.defSS.setLastResponse(1), is(1));
- assertThat(si.defSS.setLastResponse(-1), is(-1));
- }
+ @Test
+ public void setTest() throws MalformedURLException, CadiException {
+ SecurityInfoC<HttpURLConnectionStub> si = SecurityInfoC.instance(new PropAccess(), HttpURLConnectionStub.class);
+ SecuritySetter<HttpURLConnectionStub> ss = new SecuritySetterStub<HttpURLConnectionStub>();
+ assertThat(si.set(ss), is(si));
+ assertThat(si.defSS.getID(), is("Example ID"));
+ try {
+ si.defSS.setSecurity(new HttpURLConnectionStub());
+ fail("Should have thrown an exception");
+ } catch (CadiException e) {
+ assertTrue(e instanceof CadiException);
+ assertThat(e.getMessage(), is("Example exception"));
+ }
+ assertThat(si.defSS.setLastResponse(0), is(0));
+ assertThat(si.defSS.setLastResponse(1), is(1));
+ assertThat(si.defSS.setLastResponse(-1), is(-1));
+ }