- @Mock
- SecuritySetter<HttpURLConnection> ssMock;
-
- private static final String princName = "name";
-
- @Before
- public void setup() {
- MockitoAnnotations.initMocks(this);
- when(princMock.getName()).thenReturn(princName);
- siMock.defSS = ssMock;
- }
+ @Mock
+ SecuritySetter<HttpURLConnection> ssMock;
+
+ private static final String princName = "name";
+
+ @Before
+ public void setup() {
+ MockitoAnnotations.initMocks(this);
+ when(princMock.getName()).thenReturn(princName);
+ siMock.defSS = ssMock;
+ }
- @Test
- public void test() throws IOException, CadiException {
- HTransferSS transfer = new HTransferSS(princMock, "string1");
- assertThat(transfer.setLastResponse(0), is(0));
-
- transfer = new HTransferSS(princMock, "string1", siMock);
- transfer.setSecurity(hucsMock);
- assertThat(transfer.getID(), is(princName));
+ @Test
+ public void test() throws IOException, CadiException {
+ HTransferSS transfer = new HTransferSS(princMock, "string1");
+ assertThat(transfer.setLastResponse(0), is(0));
+
+ transfer = new HTransferSS(princMock, "string1", siMock);
+ transfer.setSecurity(hucsMock);
+ assertThat(transfer.getID(), is(princName));
- transfer = new HTransferSS(null, "string1", siMock);
- transfer.setSecurity(hucsMock);
- assertThat(transfer.getID(), is(""));
- }
+ transfer = new HTransferSS(null, "string1", siMock);
+ transfer.setSecurity(hucsMock);
+ assertThat(transfer.getID(), is(""));
+ }
- @Test(expected = CadiException.class)
- public void testThrows() throws CadiException {
- HTransferSS transfer = new HTransferSS(princMock, "string1", siMockNoDefSS);
- transfer.setSecurity(hucMock);
- }
+ @Test(expected = CadiException.class)
+ public void testThrows() throws CadiException {
+ HTransferSS transfer = new HTransferSS(princMock, "string1", siMockNoDefSS);
+ transfer.setSecurity(hucMock);
+ }