33 lines
1.1 KiB
Java
33 lines
1.1 KiB
Java
package org.gcube.event.publisher;
|
|
|
|
import java.net.MalformedURLException;
|
|
import java.net.URL;
|
|
|
|
public class HTTPEventSenderTest {
|
|
|
|
public HTTPEventSenderTest() {
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
EventPublisher publisher = new AbstractEventPublisher() {
|
|
@Override
|
|
protected EventSender createEventSender() {
|
|
try {
|
|
return new HTTPWithOIDCAuthEventSender(
|
|
new URL("https://conductor.dev.d4science.org/api/workflow/"), "lr62_portal",
|
|
"6937125d-6d70-404a-9d63-908c1e6415c4",
|
|
new URL("https://accounts.dev.d4science.org/auth/realms/d4science/protocol/openid-connect/token"));
|
|
} catch (MalformedURLException e) {
|
|
e.printStackTrace();
|
|
return null;
|
|
}
|
|
}
|
|
};
|
|
|
|
System.out.println("Published: " + publisher.publish(new Event("startup", "portal", "gcube"), true));
|
|
EventStatus status = publisher.check("93675866-c209-4584-8576-ec641df63e9a");
|
|
System.out.println(status);
|
|
}
|
|
|
|
}
|