Package org.growersnation.site.service.mongo

Examples of org.growersnation.site.service.mongo.MongoSoilDataReadService


  public void createSoilData_oneValidSoilData() {

    // Given
    SoilDataRepository soilDataRepository = new MongoSoilDataRepository(db);
    DefaultSoilDataService soilDataService = new DefaultSoilDataService(soilDataRepository);
    SoilDataReadService soilDataReadService = new MongoSoilDataReadService(db);

    SoilData soilData = SoilDataFaker.createValidSoilData();
    String objectId = soilDataService.save(soilData);

    // When
    long count = soilDataReadService.getNewestSoilDataCount();

    // Then
    assertThat(objectId).isNotNull();
    assertThat(count).isEqualTo(1);
  }
View Full Code Here


  public void saveSoilData_oneValidSoilData() {

    // Given
    SoilDataRepository soilDataRepository = new MongoSoilDataRepository(db);
    DefaultSoilDataService soilDataService = new DefaultSoilDataService(soilDataRepository);
    SoilDataReadService soilDataReadService = new MongoSoilDataReadService(db);

    SoilData soilData = SoilDataFaker.createValidSoilData();

    // When
    String createdObjectId = soilDataService.save(soilData);
    String updatedObjectId = soilDataService.save(soilData);
    long count = soilDataReadService.getNewestSoilDataCount();

    // Then
    assertThat(createdObjectId).isNotNull();
    assertThat(updatedObjectId).isNotNull();
    assertThat(updatedObjectId).isEqualTo(createdObjectId);
View Full Code Here

TOP

Related Classes of org.growersnation.site.service.mongo.MongoSoilDataReadService

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.