use of org.jnosql.artemis.ConfigurationUnit in project jnosql-artemis by eclipse.
the class DefaultConfigurationReaderTest method shouldReturnErrorWhenClassDoesNotMatch.
@Test
public void shouldReturnErrorWhenClassDoesNotMatch() {
Assertions.assertThrows(ConfigurationException.class, () -> {
ConfigurationUnit annotation = mock(ConfigurationUnit.class);
when(annotation.fileName()).thenReturn("invalid-class.json");
when(annotation.name()).thenReturn("name");
configurationReader.read(annotation, MockConfiguration.class);
});
}
use of org.jnosql.artemis.ConfigurationUnit in project jnosql-artemis by eclipse.
the class DefaultConfigurationReaderTest method shouldReturnErrorWhenUnitNameIsNotFind.
@Test
public void shouldReturnErrorWhenUnitNameIsNotFind() {
Assertions.assertThrows(ConfigurationException.class, () -> {
ConfigurationUnit annotation = mock(ConfigurationUnit.class);
when(annotation.fileName()).thenReturn("jnosql.json");
when(annotation.name()).thenReturn("unknown");
configurationReader.read(annotation, MockConfiguration.class);
});
}
use of org.jnosql.artemis.ConfigurationUnit in project jnosql-artemis by eclipse.
the class DefaultConfigurationReaderTest method shouldReturnErrorWhenClassIsNotFound.
@Test
public void shouldReturnErrorWhenClassIsNotFound() {
Assertions.assertThrows(ConfigurationException.class, () -> {
ConfigurationUnit annotation = mock(ConfigurationUnit.class);
when(annotation.fileName()).thenReturn("invalid-class.json");
when(annotation.name()).thenReturn("name-1");
configurationReader.read(annotation, MockConfiguration.class);
});
}
use of org.jnosql.artemis.ConfigurationUnit in project jnosql-artemis by eclipse.
the class DefaultConfigurationReaderTest method shouldReturnAnErrorWhenTheFileIsInvalid.
@Test
public void shouldReturnAnErrorWhenTheFileIsInvalid() {
Assertions.assertThrows(ConfigurationException.class, () -> {
ConfigurationUnit annotation = mock(ConfigurationUnit.class);
when(annotation.fileName()).thenReturn("invalid");
configurationReader.read(annotation, MockConfiguration.class);
});
}
use of org.jnosql.artemis.ConfigurationUnit in project jnosql-artemis by eclipse.
the class DefaultJSONConfigurationreaderTest method shouldReturnErrorWhenFileIsInvalid.
@Test
public void shouldReturnErrorWhenFileIsInvalid() {
Assertions.assertThrows(ConfigurationException.class, () -> {
ConfigurationUnit annotation = mock(ConfigurationUnit.class);
when(annotation.fileName()).thenReturn("invalid.json");
configurationReader.read(annotation, MockConfiguration.class);
});
}
Aggregations