### Question:
AuthRequestService { public Request processRequest(String encodedSamlRequest, String realm, String developer) { if (encodedSamlRequest == null) { return null; } SamlRequest request = samlDecoder.decode(encodedSamlRequest); return new Request(realm, developer, request); }  Request processRequest(String encodedSamlRequest, String realm, String developer);  }### Answer:
@Test public void testHappy() { SamlRequest request = Mockito.mock(SamlRequest.class); Mockito.when(request.getId()).thenReturn("id"); Mockito.when(request.getIdpDestination()).thenReturn("http: Mockito.when(samlDecoder.decode("samlRequest")).thenReturn(request); Request processed = authService.processRequest("samlRequest", "myrealm", null); Mockito.verify(samlDecoder).decode("samlRequest"); assertEquals("id", processed.getRequestId()); assertEquals("myrealm", processed.getRealm()); assertEquals(null, authService.processRequest(null, null, null)); }
@Test public void testForceAuthn() { SamlRequest request = Mockito.mock(SamlRequest.class); Mockito.when(request.getId()).thenReturn("id"); Mockito.when(request.getIdpDestination()).thenReturn("http: Mockito.when(request.isForceAuthn()).thenReturn(true); Mockito.when(samlDecoder.decode("samlRequest")).thenReturn(request); Request processed = authService.processRequest("samlRequest", "myrealm", null); Mockito.verify(samlDecoder).decode("samlRequest"); assertEquals("id", processed.getRequestId()); assertEquals("myrealm", processed.getRealm()); assertEquals(true, processed.isForceAuthn()); assertEquals(null, authService.processRequest(null, null, null)); }