AxiomValueGatherer { void addValue(Assertion assertion, Value<?> value, URI context) { addValues(assertion, Collections.singleton(value), context); } AxiomValueGatherer(NamedResource subject, URI subjectContext);   }
@Test void testAddValue() throws Exception { final Value<String> val = addValue(); final AxiomValueDescriptor desc = getAxiomValueDescriptor(); final List<Value<?>> values = desc.getAssertionValues(DATA_ASSERTION); assertNotNull(values); assertEquals(1, values.size()); assertTrue(values.contains(val)); assertEquals(CONTEXT, desc.getAssertionContext(DATA_ASSERTION)); }
@Test void addValueSetsAssertionContextWhenItIsDefaultAndSubjectContextIsDifferent() throws Exception { this.sut = new AxiomValueGatherer(SUBJECT, CONTEXT); final Value<String> value = new Value<>("test value"); sut.addValue(DATA_ASSERTION, value, null); final AxiomValueDescriptor result = getAxiomValueDescriptor(); assertEquals(CONTEXT, result.getSubjectContext()); assertTrue(result.containsAssertion(DATA_ASSERTION)); assertNull(result.getAssertionContext(DATA_ASSERTION)); }