use of com.google.api.services.actions_fulfillment.v2.model.Action in project datarouter by hotpads.
the class ElbService method getTargetGroupsArn.
public List<String> getTargetGroupsArn(String loadBalancerArn) {
var request = new DescribeListenersRequest().withLoadBalancerArn(loadBalancerArn);
int randomSleepMs = RandomTool.getRandomIntBetweenTwoNumbers(0, 3_000);
return RetryableTool.tryNTimesWithBackoffAndRandomInitialDelayUnchecked(() -> amazonElasticLoadBalancing.get().describeListeners(request).getListeners().stream().map(Listener::getDefaultActions).flatMap(List::stream).map(Action::getTargetGroupArn).filter(// remove action that have no tg (like redirect)
Objects::nonNull).distinct().collect(Collectors.toList()), NUM_ATTEMPTS, randomSleepMs, true);
}
use of com.google.api.services.actions_fulfillment.v2.model.Action in project be5 by DevelopmentOnTheEdge.
the class MenuTest method testGenerateSimpleMenu.
@Test
public void testGenerateSimpleMenu() {
initUserWithRoles("User");
Menu menu = (Menu) component;
Menu.MenuResponse menuResponse = menu.generateSimpleMenu(injector, EntityType.TABLE);
assertEquals("testtable", menuResponse.root.get(1).getTitle());
assertEquals(new Action("call", "table/testtable/All records"), menuResponse.root.get(1).getAction());
assertNull(menuResponse.root.get(1).getChildren());
}
use of com.google.api.services.actions_fulfillment.v2.model.Action in project be5 by DevelopmentOnTheEdge.
the class MenuTest method testGenerateSimpleMenuAdmin.
@Test
public void testGenerateSimpleMenuAdmin() {
initUserWithRoles(RoleType.ROLE_ADMINISTRATOR, RoleType.ROLE_SYSTEM_DEVELOPER);
Menu menu = (Menu) component;
Menu.MenuResponse menuResponse = menu.generateSimpleMenu(injector, EntityType.TABLE);
assertEquals("Добавить", menuResponse.root.get(1).getOperations().get(0).title);
assertEquals(new Action("call", "form/dateTime/All records/Insert"), menuResponse.root.get(1).getOperations().get(0).action);
initUserWithRoles(RoleType.ROLE_GUEST);
}
use of com.google.api.services.actions_fulfillment.v2.model.Action in project be5 by DevelopmentOnTheEdge.
the class MenuTest method testDefaultAction.
@Test
public void testDefaultAction() {
Response response = mock(Response.class);
component.generate(getMockRequest("defaultAction"), response, injector);
verify(response).sendAsRawJson(eq(new Action("call", "table/testtable/All records")));
}
use of com.google.api.services.actions_fulfillment.v2.model.Action in project be5 by DevelopmentOnTheEdge.
the class MenuTest method testDefaultActionUser.
@Test
public void testDefaultActionUser() {
initUserWithRoles("User");
Response response = mock(Response.class);
component.generate(getMockRequest("defaultAction"), response, injector);
verify(response).sendAsRawJson(eq(new Action("call", "table/testtUser/testtUser")));
initUserWithRoles(RoleType.ROLE_GUEST);
}
Aggregations