@@ -833,6 +833,64 @@ void asHtmlFacetSendsFormatHtml() {
833833 assertThat (client .captured .get (0 ).uri ().toString ()).contains ("format=html" );
834834 }
835835
836+ @ Test
837+ void csvFacetUniversalAndShapingParamsReachTheWire () {
838+ CapturingClient client = okWith ("optionSymbol,strike\n AAPL250117C00150000,150" );
839+ OptionsResource options = resourceWith (client );
840+
841+ options
842+ .asCsv ()
843+ .dateFormat (DateFormat .TIMESTAMP )
844+ .mode (Mode .DELAYED )
845+ .limit (50 )
846+ .offset (10 )
847+ .columns ("optionSymbol" , "strike" )
848+ .human (true ) // output-shaping — CSV-only
849+ .headers (true ) // output-shaping — CSV-only
850+ .chain (OptionsChainRequest .of ("AAPL" ));
851+
852+ String url =
853+ java .net .URLDecoder .decode (
854+ client .captured .get (0 ).uri ().toString (), java .nio .charset .StandardCharsets .UTF_8 );
855+ assertThat (url )
856+ .contains ("format=csv" )
857+ .contains ("dateformat=timestamp" )
858+ .contains ("mode=delayed" )
859+ .contains ("limit=50" )
860+ .contains ("offset=10" )
861+ .contains ("columns=optionSymbol,strike" )
862+ .contains ("human=true" )
863+ .contains ("headers=true" );
864+ }
865+
866+ @ Test
867+ void csvFacetCoversEveryEndpoint () {
868+ CapturingClient client = okWith ("a,b\n 1,2" );
869+ OptionsCsvResource csv = resourceWith (client ).asCsv ();
870+
871+ assertThat (csv .chain (OptionsChainRequest .of ("AAPL" )).csv ()).contains ("a,b" );
872+ assertThat (csv .quote (OptionsQuoteRequest .of ("AAPL250117C00150000" )).csv ()).contains ("a,b" );
873+ assertThat (csv .strikes (OptionsStrikesRequest .of ("AAPL" )).csv ()).contains ("a,b" );
874+ assertThat (csv .expirations (OptionsExpirationsRequest .of ("AAPL" )).csv ()).contains ("a,b" );
875+
876+ Map <String , CsvResponse > fanout =
877+ csv .quotes (
878+ OptionsQuotesRequest .builder ("AAPL250117C00150000" , "AAPL250117P00150000" ).build ());
879+ assertThat (fanout ).hasSize (2 );
880+ assertThat (fanout .values ()).allSatisfy (r -> assertThat (r .csv ()).contains ("a,b" ));
881+ }
882+
883+ @ Test
884+ void htmlFacetCoversEveryEndpoint () {
885+ CapturingClient client = okWith ("<html>x</html>" );
886+ OptionsHtmlResource html = resourceWith (client ).asHtml ();
887+
888+ assertThat (html .chain (OptionsChainRequest .of ("AAPL" )).html ()).contains ("<html>" );
889+ assertThat (html .quote (OptionsQuoteRequest .of ("AAPL250117C00150000" )).html ()).contains ("<html>" );
890+ assertThat (html .strikes (OptionsStrikesRequest .of ("AAPL" )).html ()).contains ("<html>" );
891+ assertThat (html .expirations (OptionsExpirationsRequest .of ("AAPL" )).html ()).contains ("<html>" );
892+ }
893+
836894 // ---------- response metadata (§13.5 / §16) ----------
837895
838896 @ Test
0 commit comments