use of nl.basjes.parse.useragent.calculate.FieldCalculator in project yauaa by nielsbasjes.
the class TestConcatenation method testFieldConcatenationNonExistent.
@Test
void testFieldConcatenationNonExistent() {
FieldCalculator fc;
MutableUserAgent userAgent = createUserAgent();
fc = new ConcatNONDuplicatedCalculator("Combined2", "One", "NonExistent");
fc.calculate(userAgent);
assertEquals("One Unknown", userAgent.getValue("Combined2"));
fc = new ConcatNONDuplicatedCalculator("Combined3", "NonExistent", "Two");
fc.calculate(userAgent);
assertEquals("Unknown Two", userAgent.getValue("Combined3"));
fc = new ConcatNONDuplicatedCalculator("Combined4", "NonExistent1", "NonExistent2");
fc.calculate(userAgent);
assertEquals("Unknown", userAgent.getValue("Combined4"));
}
Aggregations