use of org.junitpioneer.jupiter.ClearSystemProperty in project ekam by testvagrant.
the class DataSetsNegativeTests method shouldThrowException.
@Test
@ClearSystemProperty(key = "datasets.env")
@SetSystemProperty(key = "datasets.dir", value = "blahblahblah")
public void shouldThrowException() {
ListDataClient dataClient = new ListDataClient();
Exception exception = assertThrows(RuntimeException.class, () -> dataClient.getList("package_managers"));
String exceptionMessage = exception.getMessage();
Assertions.assertTrue(exceptionMessage.contains("'package_managers' key not found in data_sets") && exceptionMessage.contains(String.format("Files searched under directory: '%s/%s'", ResourcePaths.TEST_RESOURCES, "blahblahblah")));
}
use of org.junitpioneer.jupiter.ClearSystemProperty in project geode-benchmarks by apache.
the class ClientServerTopologyWithSniProxyTest method configWithNoSsl.
@ParameterizedTest
@EnumSource(SniProxyImplementation.class)
@ClearSystemProperty(key = WITH_SNI_PROXY_PROPERTY)
public void configWithNoSsl(final SniProxyImplementation sniProxyImplementation) {
System.setProperty(WITH_SNI_PROXY_PROPERTY, sniProxyImplementation.name());
final TestConfig testConfig = new TestConfig();
ClientServerTopologyWithSniProxy.configure(testConfig);
assertThat(testConfig.getJvmArgs().get(CLIENT.name())).contains("-DwithSsl=true");
}
use of org.junitpioneer.jupiter.ClearSystemProperty in project kogito-runtimes by kiegroup.
the class QuarkusTopicDiscoveryTest method verifyTopicsWithPropertiesAndChannels.
@Test
@ClearSystemProperty(key = "mp.messaging.outgoing.processedtravellers.connector")
@ClearSystemProperty(key = "mp.messaging.outgoing.processedtravellers.url")
@ClearSystemProperty(key = "mp.messaging.outgoing.processedtravellers.topic")
@ClearSystemProperty(key = "mp.messaging.incoming.kogito_incoming_stream.connector")
@ClearSystemProperty(key = "mp.messaging.incoming.kogito_incoming_stream.topic")
void verifyTopicsWithPropertiesAndChannels() {
final TopicDiscovery discovery = new QuarkusTopicDiscovery();
final List<Topic> topics = discovery.getTopics(Collections.emptyList());
assertThat(topics).isEmpty();
}
use of org.junitpioneer.jupiter.ClearSystemProperty in project kogito-runtimes by kiegroup.
the class QuarkusTopicDiscoveryTest method verifyTopicsWithNoPropertiesSet.
@Test
@ClearSystemProperty(key = "mp.messaging.outgoing.processedtravellers.connector")
@ClearSystemProperty(key = "mp.messaging.outgoing.processedtravellers.url")
@ClearSystemProperty(key = "mp.messaging.outgoing.processedtravellers.topic")
@ClearSystemProperty(key = "mp.messaging.incoming.kogito_incoming_stream.connector")
@ClearSystemProperty(key = "mp.messaging.incoming.kogito_incoming_stream.topic")
void verifyTopicsWithNoPropertiesSet() {
final List<Topic> expectedTopics = new ArrayList<>();
expectedTopics.add(AbstractTopicDiscovery.DEFAULT_OUTGOING_CHANNEL);
expectedTopics.add(AbstractTopicDiscovery.DEFAULT_INCOMING_CHANNEL);
final List<CloudEventMeta> eventsMeta = new ArrayList<>();
eventsMeta.add(new CloudEventMeta("event1", "", EventKind.CONSUMED));
eventsMeta.add(new CloudEventMeta("event2", "", EventKind.PRODUCED));
final TopicDiscovery discovery = new QuarkusTopicDiscovery();
final List<Topic> topics = discovery.getTopics(eventsMeta);
assertThat(topics).hasSize(2);
expectedTopics.forEach(e -> assertThat(topics.stream().anyMatch(t -> t.getName().equals(e.getName()) && t.getType() == e.getType())).isTrue());
}
Aggregations