コード例 #1
0
  @Test
  public void createForProcessOverviewShouldAddCorrectAuthorizations() throws Exception {
    doReturn("clave")
        .when(formMappingKeyGenerator)
        .generateKey(PROCESS_DEFINITION_ID, null, FormMappingType.PROCESS_OVERVIEW.getId());

    formMappingService.create(
        PROCESS_DEFINITION_ID,
        null,
        FormMappingType.PROCESS_OVERVIEW.getId(),
        SFormMapping.TARGET_URL,
        null);

    verify(pageMappingService)
        .create(
            "clave",
            null,
            EXTERNAL,
            Arrays.asList(
                IS_ADMIN,
                IS_PROCESS_OWNER,
                IS_PROCESS_INITIATOR,
                IS_TASK_PERFORMER,
                IS_INVOLVED_IN_PROCESS_INSTANCE));
  }
コード例 #2
0
  @Test
  public void createWithInternalPageShouldCallPageMapping_create() throws Exception {
    doReturn("theKey").when(formMappingKeyGenerator).generateKey(PROCESS_DEFINITION_ID, "step1", 2);

    formMappingService.create(
        PROCESS_DEFINITION_ID, "step1", 2, SFormMapping.TARGET_INTERNAL, null);

    verify(pageMappingService).create(eq("theKey"), isNull(Long.class), anyList());
  }
コード例 #3
0
  @Test
  public void createFormMappingWithUndefinedTargetShouldNotAddPageMapping() throws Exception {
    doReturn("mockedKey")
        .when(formMappingKeyGenerator)
        .generateKey(PROCESS_DEFINITION_ID, "someHumanTask", 84);

    formMappingService.create(
        PROCESS_DEFINITION_ID, "someHumanTask", 84, SFormMapping.TARGET_UNDEFINED, null);

    verifyZeroInteractions(pageMappingService);
  }
コード例 #4
0
  @Test
  public void createLegacyFormShouldNotAddCorrectAuthorizations() throws Exception {
    doReturn("keye")
        .when(formMappingKeyGenerator)
        .generateKey(PROCESS_DEFINITION_ID, null, FormMappingType.PROCESS_START.getId());

    formMappingService.create(
        PROCESS_DEFINITION_ID,
        null,
        FormMappingType.PROCESS_START.getId(),
        SFormMapping.TARGET_LEGACY,
        null);

    verify(pageMappingService).create("keye", null, LEGACY, null);
  }
コード例 #5
0
  @Test
  public void createForProcessStartShouldAddCorrectAuthorizations() throws Exception {
    doReturn("keye")
        .when(formMappingKeyGenerator)
        .generateKey(PROCESS_DEFINITION_ID, null, FormMappingType.PROCESS_START.getId());

    formMappingService.create(
        PROCESS_DEFINITION_ID,
        null,
        FormMappingType.PROCESS_START.getId(),
        SFormMapping.TARGET_URL,
        null);

    verify(pageMappingService)
        .create(
            "keye", null, EXTERNAL, Arrays.asList(IS_ADMIN, IS_PROCESS_OWNER, IS_ACTOR_INITIATOR));
  }
コード例 #6
0
  @Test
  public void createForTaskShouldAddCorrectAuthorizations() throws Exception {
    doReturn("clef")
        .when(formMappingKeyGenerator)
        .generateKey(PROCESS_DEFINITION_ID, "task", FormMappingType.TASK.getId());

    formMappingService.create(
        PROCESS_DEFINITION_ID,
        "task",
        FormMappingType.TASK.getId(),
        SFormMapping.TARGET_INTERNAL,
        null);

    verify(pageMappingService)
        .create(
            "clef", null, Arrays.asList(IS_ADMIN, IS_PROCESS_OWNER, IS_TASK_AVAILABLE_FOR_USER));
  }
コード例 #7
0
 @Test(expected = IllegalArgumentException.class)
 public void testCreateWithNullTarget() throws Exception {
   formMappingService.create(1654L, "step1", 1, null, null);
 }