@Before public void setUp() { Format format = new Format(0, null, new HyphenStyle(), Verbosity.HIGH); Persister persister = new Persister(format); Retrofit retrofit = new Retrofit.Builder() .baseUrl(server.url("/")) .addConverterFactory(SimpleXmlConverterFactory.create(persister)) .build(); service = retrofit.create(Service.class); }
/** * This is used to determine whether the format for the current * serialization is verbose or not. The verbosity dictates the * type of default annotations that are generated for an object. * * @return this is used to determine the verbosity to use */ private boolean isAttribute() { Verbosity verbosity = format.getVerbosity(); if(verbosity != null) { return verbosity == LOW; } return false; }
public void testTypeVerbose() throws Exception { Format format = new Format(Verbosity.LOW); Persister persister = new Persister(format); PrimitiveEntry entry = new PrimitiveEntry(); StringWriter writer = new StringWriter(); persister.write(entry, writer); validate(persister, entry); }
@Before public void setUp() { queue = Jus.newRequestQueue(); Format format = new Format(0, null, new HyphenStyle(), Verbosity.HIGH); Persister persister = new Persister(format); RetroProxy retroProxy = new RetroProxy.Builder() .baseUrl(server.url("/").toString()) .addConverterFactory(SimpleXmlConverterFactory.create(persister)) .requestQueue(queue) .build(); service = retroProxy.create(Service.class); }
private static Converter initConverter() { Format format = new Format(0, null, new HyphenStyle(), Verbosity.HIGH); Persister persister = new Persister(format); return new SimpleXMLConverter(persister); }