@Test void whenRequestTypePrivateThenProviderNameIsRequesterId() { Mockito.when(eidasRequest.getSectorType()).thenReturn(EidasRequestSectorType.PRIVATE); Mockito.when(eidasRequest.getRequesterId()).thenReturn("private_SP"); RequestSession requestSession = new RequestSession("relayState", eidasRequest); Assertions.assertEquals("private_SP", requestSession.getReqProviderName()); }
private static String getReqProviderName(EidasRequest eidasRequest) { if (eidasRequest.getSectorType() == EidasRequestSectorType.PRIVATE) { if (eidasRequest.getRequesterId() != null) { return eidasRequest.getRequesterId(); } if (eidasRequest.getProviderName() != null) { return eidasRequest.getProviderName(); } } return null; }
RequestSession { private static String getReqProviderName(EidasRequest eidasRequest) { if (eidasRequest.getSectorType() == EidasRequestSectorType.PRIVATE) { if (eidasRequest.getRequesterId() != null) { return eidasRequest.getRequesterId(); } if (eidasRequest.getProviderName() != null) { return eidasRequest.getProviderName(); } } return null; } }
RequestSession { private static String getReqProviderName(EidasRequest eidasRequest) { if (eidasRequest.getSectorType() == EidasRequestSectorType.PRIVATE) { if (eidasRequest.getRequesterId() != null) { return eidasRequest.getRequesterId(); } if (eidasRequest.getProviderName() != null) { return eidasRequest.getProviderName(); } } return null; } RequestSession(String relayState,
                 String reqId,
                 String reqDestination,
                 String reqProviderName,
                 String reqProviderEntityId);  RequestSession(String reqId,
                        String reqDestination,
                        String reqProviderName,
                        String reqProviderEntityId);  RequestSession(String relayState, EidasRequest eidasRequest);  RequestSession(EidasRequest eidasRequest); }
RequestSession { private static String getReqProviderName(EidasRequest eidasRequest) { if (eidasRequest.getSectorType() == EidasRequestSectorType.PRIVATE) { if (eidasRequest.getRequesterId() != null) { return eidasRequest.getRequesterId(); } if (eidasRequest.getProviderName() != null) { return eidasRequest.getProviderName(); } } return null; } RequestSession(String relayState,
                 String reqId,
                 String reqDestination,
                 String reqProviderName,
                 String reqProviderEntityId);  RequestSession(String reqId,
                        String reqDestination,
                        String reqProviderName,
                        String reqProviderEntityId);  RequestSession(String relayState, EidasRequest eidasRequest);  RequestSession(EidasRequest eidasRequest); Optional<String> getRelayState(); }
RequestSession { private static String getReqProviderName(EidasRequest eidasRequest) { if (eidasRequest.getSectorType() == EidasRequestSectorType.PRIVATE) { if (eidasRequest.getRequesterId() != null) { return eidasRequest.getRequesterId(); } if (eidasRequest.getProviderName() != null) { return eidasRequest.getProviderName(); } } return null; } RequestSession(String relayState,
                 String reqId,
                 String reqDestination,
                 String reqProviderName,
                 String reqProviderEntityId);  RequestSession(String reqId,
                        String reqDestination,
                        String reqProviderName,
                        String reqProviderEntityId);  RequestSession(String relayState, EidasRequest eidasRequest);  RequestSession(EidasRequest eidasRequest); Optional<String> getRelayState();  }