### Question:
IdpIdaStatusMarshaller extends IdaStatusMarshaller<IdpIdaStatus> { @Override protected Optional<StatusDetail> getStatusDetail(IdpIdaStatus originalStatus) { if (REST_TO_STATUS_DETAIL.containsKey(originalStatus)) { StatusDetail statusDetail = this.samlObjectFactory.createStatusDetail(); StatusValue statusValue = this.samlObjectFactory.createStatusValue(REST_TO_STATUS_DETAIL.get(originalStatus)); statusDetail.getUnknownXMLObjects().add(statusValue); return of(statusDetail); } return empty(); } IdpIdaStatusMarshaller(OpenSamlXmlObjectFactory samlObjectFactory);   }### Answer:
@Test public void transform_shouldTransformAuthenticationPending() throws Exception { Status transformedStatus = marshaller.toSamlStatus(IdpIdaStatus.authenticationPending()); StatusValue actual = (StatusValue) transformedStatus.getStatusDetail().getOrderedChildren().get(0); assertThat(transformedStatus.getStatusCode().getValue()).isEqualTo(StatusCode.RESPONDER); assertThat(transformedStatus.getStatusCode().getStatusCode().getValue()).isEqualTo(StatusCode.NO_AUTHN_CONTEXT); assertThat(actual.getValue()).isEqualTo(StatusValue.PENDING); }
@Test public void shouldMarshallStatusDetailElementWhenInCancelStatus() { Status status = marshaller.toSamlStatus(IdpIdaStatus.authenticationCancelled()); assertThat(status.getStatusDetail()).isNotNull(); }
@Test public void shouldMarshallStatusDetailWithStatusValueContainingAuthnCancelInCaseOfAuthenticationCancelled() { Status status = marshaller.toSamlStatus(IdpIdaStatus.authenticationCancelled()); StatusValue actual = (StatusValue) status.getStatusDetail().getOrderedChildren().get(0); assertThat(actual.getNamespaces()).isEmpty(); assertThat(actual.getValue()).isEqualTo(StatusValue.CANCEL); }
@Test public void shouldMarshallStatusDetailWithStatusValueContainingUpliftFailed() { Status status = marshaller.toSamlStatus(IdpIdaStatus.upliftFailed()); StatusValue actual = (StatusValue) status.getStatusDetail().getOrderedChildren().get(0); assertThat(actual.getNamespaces()).isEmpty(); assertThat(actual.getValue()).isEqualTo(StatusValue.UPLIFT_FAILED); }
@Test public void shouldMarshallStatusDetailWithASingleStatusValueElementInCaseOfAuthenticationCancelled() { Status status = marshaller.toSamlStatus(IdpIdaStatus.authenticationCancelled()); assertThat(status.getStatusDetail().getOrderedChildren()).hasSize(1); }