Package no.kommune.bergen.soa.svarut.domain

Examples of no.kommune.bergen.soa.svarut.domain.PrintReceipt


  public void print() throws Exception {
    Forsendelse forsendelse = createForsendelse();
    String aPrintId = "123";
    EasyMock.expect(mockPrintServiceProvider.sendToPrint((InputStream) EasyMock.anyObject(), EasyMock.eq(forsendelse))).andReturn(aPrintId);
    EasyMock.replay(mockPrintServiceProvider);
    PrintReceipt printReceipt = printFacade.print(forsendelse);
    Assert.assertEquals(aPrintId, printReceipt.getPrintId());
    EasyMock.verify(mockPrintServiceProvider);
  }
View Full Code Here


  }

  @Test
  public void sendPrintForsendelse() {
    Forsendelse forsendelse = newForsendelseEmailAdrOmitted();
    PrintReceipt printReceipt = newPrintReceipt( "MY-PRINT-ID" );
    expect( printFacade.print( eq( forsendelse ) ) ).andReturn( printReceipt );
    forsendelsesArkiv.setPrinted( eq( forsendelse.getId() ), eq( printReceipt ) );
    replay( printFacade );
    replay( forsendelsesArkiv );
    dispatcher.send( forsendelse );
View Full Code Here

    verify( printFacade );
    verify( forsendelsesArkiv );
  }

  private PrintReceipt newPrintReceipt( String printId ) {
    PrintReceipt printReceipt = new PrintReceipt();
    printReceipt.setPrintId( printId );
    return printReceipt;
  }
View Full Code Here

    long now = System.currentTimeMillis();
    long sent = now - (leadTimeBeforePrint + 1);
    Date date = new Date();
    date.setTime( sent );
    forsendelse.setSendt( date );
    PrintReceipt printReceipt = newPrintReceipt( "MY-PRINT-ID" );
    expect( printFacade.print( eq( forsendelse ) ) ).andReturn( printReceipt );
    forsendelsesArkiv.setPrinted( eq( forsendelse.getId() ), eq( printReceipt ) );
    replay( printFacade );
    replay( forsendelsesArkiv );
    dispatcher.handleUnread( forsendelse );
View Full Code Here

    long now = System.currentTimeMillis();
    long sent = now - (leadTimeBeforePrint + 1);
    Date date = new Date();
    date.setTime( sent );
    forsendelse.setSendt( date );
    PrintReceipt printReceipt = newPrintReceipt( "MY-PRINT-ID" );
    expect( printFacade.print( eq( forsendelse ) ) ).andReturn( printReceipt );
    forsendelsesArkiv.setPrinted( eq( forsendelse.getId() ), eq( printReceipt ) );
    replay( printFacade );
    replay( forsendelsesArkiv );
    dispatcher.handleUnread( forsendelse );
View Full Code Here

    }
    return !failed;
  }

  private PrintReceipt newPrintReceipt( String printId ) {
    PrintReceipt printReceipt = new PrintReceipt();
    printReceipt.setPrintId( printId );
    return printReceipt;
  }
View Full Code Here

    Forsendelse forsendelse = ForsendelsesArkivTest.createForsendelse( variant );
    forsendelse.setId( "" + variant );
    forsendelse.setFile( new File( "src/test/resources/test.pdf" ) );
    forsendelse.setFnr( "" );
        forsendelse.setShipmentPolicy(ShipmentPolicy.KUN_APOST.value());
    PrintReceipt printReceipt = newPrintReceipt( printId );
    expect( printFacade.print( eq( forsendelse ) ) ).andReturn( printReceipt );
    forsendelsesArkiv.setPrinted( eq( forsendelse.getId() ), eq( printReceipt ) );
    replay( printFacade );
    replay( forsendelsesArkiv );
    dispatcher.send( forsendelse );
View Full Code Here

    }
    return !failed;
  }

  private PrintReceipt newPrintReceipt( String printId ) {
    PrintReceipt printReceipt = new PrintReceipt();
    printReceipt.setPrintId( printId );
    return printReceipt;
  }
View Full Code Here

  @Test
  public void setPrinted() {
    int variant = 1;
    String id = forsendelsesArkiv.save( createForsendelse( variant ), getTestDocument() );
    assertNotNull( id );
    PrintReceipt printReceipt = newPrintReceipt();
    forsendelsesArkiv.setPrinted( id, printReceipt );
    Forsendelse forsendelse = forsendelsesArkiv.retrieve( id );
    assertEquals( printReceipt.getPrintId(), forsendelse.getPrintId() );
    assertEquals( printReceipt.getPageCount(), forsendelse.getAntallSider() );
  }
View Full Code Here

    for (int i = 0; i < variants.length; i++) {
      ids[i] = forsendelsesArkiv.save( createForsendelse( i ), getTestDocument() );
    }
    List<String> list = forsendelsesArkiv.readUnsent( null );
    assertEquals( variants.length, list.size() );
    PrintReceipt printReceipt = newPrintReceipt();
    forsendelsesArkiv.setPrinted( ids[0], printReceipt );
    list = forsendelsesArkiv.readUnsent( null );
    assertEquals( variants.length - 1, list.size() );
    forsendelsesArkiv.setSentAltinn(ids[1], MOCK_RECEIPT_ID);
    list = forsendelsesArkiv.readUnsent( null );
View Full Code Here

TOP

Related Classes of no.kommune.bergen.soa.svarut.domain.PrintReceipt

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.