Skip to content

Commit

Permalink
task-unit-done
Browse files Browse the repository at this point in the history
  • Loading branch information
yacekmm committed Dec 6, 2024
1 parent 32c9181 commit af2f7e7
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.bottega.promoter.concert.domain;

import java.util.*;
import java.util.Set;

import com.bottega.promoter.agreements.PromoterId;
import com.bottega.sharedlib.ddd.AggregateRoot;
Expand Down Expand Up @@ -54,6 +54,7 @@ public PromoterId promoterId() {


public void initNewConcert(TagService tagService, CategoryService categoryService) {
tags = tagService.tag(title);
category = categoryService.categorize(title);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.bottega.promoter.concert.domain


import com.bottega.promoter.fixtures.SpecificationBase

import static com.bottega.sharedlib.config.TestClockConfig.TEST_TIME_PLUS_30_DAYS
Expand All @@ -22,7 +23,10 @@ class Concert_initConcert_unitSpec extends SpecificationBase {
where:
title | expectedTags
"no tags apply" | []
//TODO more cases
"Rock concert" | ["rock"]
"Scorpions in Warsaw!" | ["rock"]
"Scorpions on Mystic Festival" | ["rock", "festival"]
"Rihanna the best of" | ["pop"]
}

def "initConcert - assigns category"() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
import java.util.stream.Stream;

import com.bottega.promoter.concert.fixtures.ConcertLogicTestBase;
import com.bottega.sharedlib.config.TestClockConfig;
import org.junit.Test;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.*;
import static com.bottega.sharedlib.config.TestClockConfig.TEST_TIME_PLUS_30_DAYS;
Expand All @@ -14,10 +12,14 @@

class Concert_initConcert_unitTest extends ConcertLogicTestBase {


private static Stream<Arguments> provideStringsForTags() {
return Stream.of(
Arguments.of("no tags apply", Set.of())
//TODO more cases
Arguments.of("no tags apply", Set.of()),
Arguments.of("Rock concert", Set.of("rock")),
Arguments.of("Scorpions in Warsaw!", Set.of("rock")),
Arguments.of("Scorpions on Mystic Festival", Set.of("rock", "festival")),
Arguments.of("Rihanna the best of", Set.of("pop"))
);
}

Expand Down

0 comments on commit af2f7e7

Please sign in to comment.