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

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


    velocityModelFactory = createVelocityModelFactory();
  }

  @Test
  public void createModel() {
    Forsendelse f = createForsendelse();
    Map<String, String> model = velocityModelFactory.createModel( f );
    verifyModel( model, f );
  }
View Full Code Here


    assertTrue( takesTwoArguments );
  }

  private Forsendelse createForsendelse() {
    ForsendelsesArkiv forsendelsesArkiv = ForsendelsesArkivTest.createForsendesesArkiv();
    Forsendelse forsendelse = ForsendelsesArkivTest.createForsendelse( 1 );
    String id = forsendelsesArkiv.save( forsendelse, ForsendelsesArkivTest.getTestDocument() );
    Forsendelse f = forsendelsesArkiv.retrieve( id );
    return f;
  }
View Full Code Here

    altinnFacade = new AltinnFacade( getTemplateEngine(), myCorrespondenceClient, velocityModelFactory );
  }

  @Test
  public void send() {
    Forsendelse forsendelse = newForsendelse();
    altinnFacade.send( forsendelse );
    CorrespondenceMessage message = myCorrespondenceClient.getLatestMessage();
    verifyMessageTitle( forsendelse, message );
    verifyMessageBody( forsendelse, message );
  }
View Full Code Here

    velocityTemplateEngine.setVelocityEngine( velocityEngine );
    return velocityTemplateEngine;
  }

  private Forsendelse newForsendelse() {
    Forsendelse forsendelse = ForsendelsesArkivTest.createForsendelse( 1 );
    satisfyChecksInMockCorrespondenceClient( forsendelse );
    return forsendelse;
  }
View Full Code Here

  private void sendToAltinn() {
    ApplicationContext context = new ClassPathXmlApplicationContext( "applicationContext.xml" );
    ServiceContext serviceContext = (ServiceContext)context.getBean( "serviceContext" );
    AltinnFacade altinnFacade = serviceContext.getAltinnFacade();
    Forsendelse forsendelse = ForsendelsesArkivTest.createForsendelse( 1 );
    forsendelse.setShipmentPolicy(ShipmentPolicy.KUN_ALTINN.value());
        forsendelse.setFile(FilHenter.getFileAsFile(ForsendelsesArkivTest.testPdf));
    forsendelse.setOrgnr( org );
    forsendelse.setTittel( "Fra AlltinFacadeIntTest" );
    forsendelse.setEmail( "einarvalen@gmail.com" );
    forsendelse.setSms( "004795996325" );
    forsendelse.setId( FilHenter.getFileAsFile(ForsendelsesArkivTest.testPdf).getName() );
    altinnFacade.send( forsendelse );
  }
View Full Code Here

  }

  @SuppressWarnings("unchecked")
  @Test
  public void send() throws FileNotFoundException {
    Forsendelse forsendelse = ForsendelsesArkivTest.createForsendelse( 1 );
    File file = FilHenter.getFileAsFile(ForsendelsesArkivTest.testPdf);
    forsendelse.setFile(file);
    forsendelse.setId(file.getName());
    expect( templateEngineMock.merge( isA( Map.class ), same( SubjectTemplate ) ) ).andReturn( SubjectTemplate );
    expect( templateEngineMock.merge(isA(Map.class), same(BodyTemplate)) ).andReturn( BodyTemplate );
    expect( pdfGeneratorMock.createPdf( isA( Map.class ), same( PdfTemplate ) ) ).andReturn(FilHenter.getFileAsInputStream("test.pdf"));
    mailSenderMock.sendEmail(contains(fnr), same(ReplyTo), same(SubjectTemplate), same(BodyTemplate), isA(File[].class));
    expectLastCall();
View Full Code Here

    printFacade = new PrintFacade(pdfGenerator, FRONT_PAGE_TEMPLATE_PROD, mockPrintServiceProvider, VelocityModelFactoryTest.createVelocityModelFactory());
  }

  @Test
  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());
View Full Code Here

    Assert.assertEquals(aPrintId, printReceipt.getPrintId());
    EasyMock.verify(mockPrintServiceProvider);
  }

  private Forsendelse createForsendelse() {
    Forsendelse forsendelse = ForsendelsesArkivTest.createForsendelse(1);
    File file = FilHenter.getFileAsFile(ForsendelsesArkivTest.testPdf);
    forsendelse.setFile(file);
    forsendelse.setId(file.getName());
    return forsendelse;
  }
View Full Code Here

  private void printToFile(final File fileOut) throws IOException {
    SvarUtPdfGenerator pdfGenerator = new SvarUtPdfGenerator("target");
    PrintServiceProvider printServiceProvider = newPrintServiceProvider(fileOut);
    VelocityModelFactory velocityModelFactory = VelocityModelFactoryTest.createVelocityModelFactory();
    PrintFacade printFacade = new PrintFacade(pdfGenerator, FRONT_PAGE_TEMPLATE_PROD, printServiceProvider, velocityModelFactory);
    Forsendelse forsendelse = createForsendelse();
    printFacade.print(forsendelse);
  }
View Full Code Here

  }

  @Test
  @SuppressWarnings("unchecked")
  public void sendIncludeAttachment() {
    Forsendelse forsendelse = ForsendelsesArkivTest.createForsendelse( 1 );
    File file = FilHenter.getFileAsFile(ForsendelsesArkivTest.testPdf);
    forsendelse.setFile( file );
    forsendelse.setId( file.getName() );
    expect( templateEngineMock.merge( isA( Map.class ), same( SubjectTemplate ) ) ).andReturn( SubjectTemplate );
    expect( templateEngineMock.merge( isA( Map.class ), same( BodyTemplate ) ) ).andReturn( BodyTemplate );
    mailSenderMock.sendEmail( contains( Fnr ), same( ReplyTo ), same( SubjectTemplate ), same( BodyTemplate ), isA( File[].class ) );
    expectLastCall();
    replay( templateEngineMock );
View Full Code Here

TOP

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

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.