Skip to content

Commit

Permalink
fix test naming conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
krzyzy-hltech committed Jul 21, 2018
1 parent 45179f8 commit 651e20b
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ import static org.springframework.boot.test.context.SpringBootTest.WebEnvironmen

@SpringBootTest(webEnvironment = RANDOM_PORT, properties = ["management.port=0"])
@ActiveProfiles(["test-integration", "kubernetes"])
class AppTest extends Specification {
class AppIT extends Specification {

def test() {
when:
def a = 2
def a = 2
then:
a == 2
a == 2
}

}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package com.hltech.contracts.judged.agent.config

import com.hltech.contracts.judged.agent.JudgeDPublisher
import spock.lang.Specification

class CachingDelegatingDPublisherUT extends Specification {

private CachingDelegatingDPublisher publisher
private JudgeDPublisher targetPublisher

def setup() {
targetPublisher = Mock(JudgeDPublisher)
publisher = new CachingDelegatingDPublisher(targetPublisher)
}

def "should delegate to target publisher when publish for the first time"() {
given:
def forms = [new JudgeDPublisher.ServiceForm("name", "version")] as Set
when:
publisher.publish("SIT", forms)
then:
1 * targetPublisher.publish("SIT", forms)
}

def "should delegate to target publisher once when subsequently publish the same set of service multiple times "() {
given:
def forms = [new JudgeDPublisher.ServiceForm("name", "version")] as Set
when:
publisher.publish("SIT", forms)
publisher.publish("SIT", forms)
publisher.publish("SIT", forms)
then:
1 * targetPublisher.publish("SIT", forms)
}

def 'should delegate to target publisher when subsequently publish different set of services'() {
given:
def forms1 = [new JudgeDPublisher.ServiceForm("name1", "version")] as Set
def forms2 = [new JudgeDPublisher.ServiceForm("name2", "version")] as Set
when:
publisher.publish("SIT", forms1)
publisher.publish("SIT", forms2)
then:
1 * targetPublisher.publish("SIT", forms1)
then:
1 * targetPublisher.publish("SIT", forms2)
}
}

0 comments on commit 651e20b

Please sign in to comment.