Skip to content

Commit

Permalink
#32 : Fixed REST API tests in Gradle
Browse files Browse the repository at this point in the history
... or rather they just started working again after the dependency
updates! ;-o
  • Loading branch information
gazbert committed Mar 23, 2020
1 parent 8af9662 commit e1f7ad2
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
8 changes: 1 addition & 7 deletions bxbot-rest-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ dependencies {
testCompile libraries.awaitility
}

// FIXME: For some reason all the REST tests have started failing with Gradle build!
// All fine with maven and running in IDE... weird.
test {
exclude '**/*Controller*'
}

jacocoTestCoverageVerification {
violationRules {
rule {
Expand All @@ -42,7 +36,7 @@ jacocoTestCoverageVerification {
limit {
counter = 'LINE'
value = 'COVEREDRATIO'
minimum = 0 // TODO: Re-instate once tests fixed!
minimum = 0.8
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ public class TestJwtAuthenticationRequest {
private static final String USERNAME2 = "bxbot-ui-2";
private static final String PASSWORD2 = "InSearchOfLostTime2";

@Test
public void testEmptyConstructorWorksAsExpected() {
final JwtAuthenticationRequest jwtAuthenticationRequest = new JwtAuthenticationRequest();
assertNull(jwtAuthenticationRequest.getUsername());
assertNull(jwtAuthenticationRequest.getPassword());
}

@Test
public void testArgsConstructorWorksAsExpected() {
final JwtAuthenticationRequest jwtAuthenticationRequest =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
package com.gazbert.bxbot.rest.api.security.authentication;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNull;

import org.junit.Test;

Expand All @@ -38,9 +39,9 @@ public class TestJwtAuthenticationResponse {
private static final String ANOTHER_JWT = "another.jwt.string";

@Test
public void testInitialisationWorksAsExpected() {
final JwtAuthenticationResponse jwtAuthenticationResponse = new JwtAuthenticationResponse(JWT);
assertEquals(JWT, jwtAuthenticationResponse.getToken());
public void testEmptyConstructorWorksAsExpected() {
final JwtAuthenticationResponse jwtAuthenticationResponse = new JwtAuthenticationResponse();
assertNull(jwtAuthenticationResponse.getToken());
}

@Test
Expand Down

0 comments on commit e1f7ad2

Please sign in to comment.