Search in sources :

Example 1 with Action

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);
}
Also used : Action(com.amazonaws.services.elasticloadbalancingv2.model.Action) Listener(com.amazonaws.services.elasticloadbalancingv2.model.Listener) DescribeListenersRequest(com.amazonaws.services.elasticloadbalancingv2.model.DescribeListenersRequest)

Example 2 with Action

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());
}
Also used : Action(com.developmentontheedge.be5.model.Action) Test(org.junit.Test) Be5ProjectTest(com.developmentontheedge.be5.test.Be5ProjectTest)

Example 3 with Action

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);
}
Also used : Action(com.developmentontheedge.be5.model.Action) Test(org.junit.Test) Be5ProjectTest(com.developmentontheedge.be5.test.Be5ProjectTest)

Example 4 with Action

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")));
}
Also used : Response(com.developmentontheedge.be5.api.Response) Action(com.developmentontheedge.be5.model.Action) Test(org.junit.Test) Be5ProjectTest(com.developmentontheedge.be5.test.Be5ProjectTest)

Example 5 with Action

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);
}
Also used : Response(com.developmentontheedge.be5.api.Response) Action(com.developmentontheedge.be5.model.Action) Test(org.junit.Test) Be5ProjectTest(com.developmentontheedge.be5.test.Be5ProjectTest)

Aggregations

Action (com.developmentontheedge.be5.model.Action)10 Be5ProjectTest (com.developmentontheedge.be5.test.Be5ProjectTest)7 Test (org.junit.Test)7 Response (com.developmentontheedge.be5.api.Response)4 Action (com.amazonaws.services.elasticloadbalancingv2.model.Action)2 Query (com.developmentontheedge.be5.metadata.model.Query)2 CreateListenerRequest (com.amazonaws.services.elasticloadbalancingv2.model.CreateListenerRequest)1 CreateListenerResult (com.amazonaws.services.elasticloadbalancingv2.model.CreateListenerResult)1 DescribeListenersRequest (com.amazonaws.services.elasticloadbalancingv2.model.DescribeListenersRequest)1 Listener (com.amazonaws.services.elasticloadbalancingv2.model.Listener)1 Operation (com.developmentontheedge.be5.metadata.model.Operation)1 TableOperationPresentation (com.developmentontheedge.be5.model.TableOperationPresentation)1 ForIntent (com.google.actions.api.ForIntent)1 TransactionDecision (com.google.actions.api.response.helperintent.transactions.v3.TransactionDecision)1 Action (com.google.api.services.actions_fulfillment.v2.model.Action)1 GooglePaymentOption (com.google.api.services.actions_fulfillment.v2.model.GooglePaymentOption)1 LineItemV3 (com.google.api.services.actions_fulfillment.v2.model.LineItemV3)1 Location (com.google.api.services.actions_fulfillment.v2.model.Location)1 MerchantPaymentMethod (com.google.api.services.actions_fulfillment.v2.model.MerchantPaymentMethod)1 MerchantPaymentOption (com.google.api.services.actions_fulfillment.v2.model.MerchantPaymentOption)1