use of nl.basjes.parse.useragent.analyze.InvalidParserConfigurationException in project yauaa by nielsbasjes.
the class TestAnnotationBadUsages method testNullInitAnalyzer.
@Test
void testNullInitAnalyzer() {
UserAgentAnnotationAnalyzer<String> userAgentAnalyzer = new UserAgentAnnotationAnalyzer<>();
InvalidParserConfigurationException exception = assertThrows(InvalidParserConfigurationException.class, () -> userAgentAnalyzer.initialize(null));
assertEquals("[Initialize] The mapper instance is null.", exception.getMessage());
}
use of nl.basjes.parse.useragent.analyze.InvalidParserConfigurationException in project yauaa by nielsbasjes.
the class TestAnnotationSystem method testInaccessibleSetter.
@Test
void testInaccessibleSetter() {
InvalidParserConfigurationException exception = assertThrows(InvalidParserConfigurationException.class, InaccessibleSetterMapper::new);
assertEquals("Method annotated with YauaaField is not public: inaccessibleSetter", exception.getMessage());
}
use of nl.basjes.parse.useragent.analyze.InvalidParserConfigurationException in project yauaa by nielsbasjes.
the class TestAnnotationSystem method testImpossibleField.
@Test
void testImpossibleField() {
InvalidParserConfigurationException exception = assertThrows(InvalidParserConfigurationException.class, ImpossibleFieldMapper::new);
assertEquals("We cannot provide these fields:[NielsBasjes]", exception.getMessage());
}
use of nl.basjes.parse.useragent.analyze.InvalidParserConfigurationException in project yauaa by nielsbasjes.
the class TestAnnotationSystem method testNonVoidSetter.
@Test
void testNonVoidSetter() {
InvalidParserConfigurationException exception = assertThrows(InvalidParserConfigurationException.class, WrongReturnType::new);
assertTrue(exception.getMessage().contains("the method [nonVoidSetter] has been annotated with YauaaField but it has the wrong method signature. " + "It must look like [ public void nonVoidSetter(TestRecord record, String value) ]"));
}
use of nl.basjes.parse.useragent.analyze.InvalidParserConfigurationException in project yauaa by nielsbasjes.
the class TestAnnotationSystem method testInaccessibleSetterClass.
@Test
void testInaccessibleSetterClass() {
PrivateTestRecord record = new PrivateTestRecord("Bla bla bla");
InvalidParserConfigurationException exception = assertThrows(InvalidParserConfigurationException.class, () -> new InaccessibleSetterMapperClass().enrich(record));
assertEquals("The class nl.basjes.parse.useragent.annotate.TestAnnotationSystem.PrivateTestRecord is not public.", exception.getMessage());
}
Aggregations