### Question:
InputEntityDecorators { public static Decorator defaultRelationshipType( final String defaultType ) { return defaultType == null ? NO_DECORATOR : relationship -> new RelationshipTypeDecorator( relationship, defaultType ); } private  InputEntityDecorators(); static Decorator additiveLabels( final String[] labelNamesToAdd ); static Decorator defaultRelationshipType( final String defaultType ); static Decorator decorators( final Decorator... decorators ); static final Decorator NO_DECORATOR; }### Answer:
@Test public void shouldProvideDefaultRelationshipType() throws Exception { String defaultType = "TYPE"; InputEntityVisitor relationship = defaultRelationshipType( defaultType ).apply( entity ); relationship( relationship, "source", 1, 0, NO_PROPERTIES, null, "start", "end", null, null ); assertEquals( defaultType, entity.stringType ); }
@Test public void shouldNotOverrideAlreadySetRelationshipType() throws Exception { String defaultType = "TYPE"; InputEntityVisitor relationship = defaultRelationshipType( defaultType ).apply( entity ); String customType = "CUSTOM_TYPE"; relationship( relationship, "source", 1, 0, NO_PROPERTIES, null, "start", "end", customType, null ); assertEquals( customType, entity.stringType ); }
@Test public void shouldNotOverrideAlreadySetRelationshipTypeId() throws Exception { String defaultType = "TYPE"; Decorator decorator = defaultRelationshipType( defaultType ); InputEntityVisitor relationship = decorator.apply( entity ); int typeId = 5; relationship( relationship, "source", 1, 0, NO_PROPERTIES, null, "start", "end", null, typeId ); assertTrue( entity.hasIntType ); assertEquals( typeId, entity.intType ); }