コード例 #1
0
  private void noProblems() throws Exception {
    resetMocks();
    ctrlFieldManager.expectAndReturn(mockFieldManager.isOrderableField("customfield_1"), true);

    replayMocks();

    List amendments = flCheck.preview();
    assertEquals(0, amendments.size());

    verifyMocks();
  }
コード例 #2
0
  protected void setUp() throws Exception {
    super.setUp();
    CoreTransactionUtil.setUseTransactions(false);
    setUpMocks();

    ctrlFieldManager.expectAndReturn(mockFieldManager.isOrderableField("customfield_1"), true);
    ctrlFieldManager.expectAndReturn(mockFieldManager.isOrderableField("customfield_2"), false);
    ctrlFieldManager.expectAndReturn(mockFieldManager.isOrderableField("customfield_3"), false);

    replayMocks();

    UtilsForTests.getTestEntity(
        "FieldLayoutItem", EasyMap.build("id", new Long(1001), "fieldidentifier", "customfield_1"));
    UtilsForTests.getTestEntity(
        "FieldLayoutItem", EasyMap.build("id", new Long(1002), "fieldidentifier", "customfield_2"));
    UtilsForTests.getTestEntity(
        "FieldLayoutItem", EasyMap.build("id", new Long(1003), "fieldidentifier", "customfield_3"));

    flCheck = new FieldLayoutCheck(ofBizDelegator, 1);
    flCheck.setFieldManager(mockFieldManager);
  }