SdkJsonProtocolFactory implements SdkJsonMarshallerFactory { @Override public StructuredJsonGenerator createGenerator() { return getSdkFactory().createWriter(getContentType()); } SdkJsonProtocolFactory(JsonClientMetadata metadata); @Override StructuredJsonGenerator createGenerator(); @Override String getContentType(); ProtocolRequestMarshaller<T> createProtocolMarshaller(OperationInfo operationInfo, T origRequest); HttpResponseHandler<AmazonWebServiceResponse<T>> createResponseHandler(
            JsonOperationMetadata operationMetadata,
            Unmarshaller<T, JsonUnmarshallerContext> responseUnmarshaller); HttpResponseHandler<AmazonServiceException> createErrorResponseHandler(
            JsonErrorResponseMetadata errorResponsMetadata);  }
@Test public void ionBinaryEnabledGeneratorWritesIonBinary() { StructuredJsonGenerator generator = protocolFactory(IonEnabled.YES, IonBinaryEnabled.YES).createGenerator(); generator.writeValue(true); byte[] actual = generator.getBytes(); byte[] expected = bytes(0xE0, 0x01, 0x00, 0xEA, 0x11); assertArrayEquals(expected, actual); }
@Test public void ionBinaryDisabledGeneratorWritesIonText() throws Exception { StructuredJsonGenerator generator = protocolFactory(IonEnabled.YES, IonBinaryEnabled.NO).createGenerator(); generator.writeValue(true); byte[] actual = generator.getBytes(); byte[] expected = "true".getBytes("UTF-8"); assertArrayEquals(expected, actual); }