java - Adapters ignored when testing resources in Neo4j unmanaged extension -
i have implemented entityresource
class entity
model , entityadapter
adapter overriding xmladapter in neo4j managed extension. works when deploying server. model uses adapter marshal entity , resource responds accordingly.
however in test class (below) uses neo4j harness , neo4jrule entityadapter
ignored receive default marshaled version of entity
unwanted values.
@rule public neo4jrule neo4j = new neo4jrule() .withfixture( "create ({name:'test'})" ) .withextension( "/test", entityresource.class ); @test public void testread() { // given uri serveruri = neo4j.httpuri(); string uri = serveruri.tostring() + "test/entities/test"; http.response response = http.get( uri ); // should reply assertequals( response.tostring(), 200, response.status() ); system.out.println( response.tostring() ); }
the adapter must set correctly work in resource guess it's how test searches correct adapter. class declaration below anyway
@xmljavatypeadapter( entityadapter.class ) public class entity {
why isn't test using adapter when server , how fix it?
Comments
Post a Comment