forked from thoughtworks/HeartBeat
-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ADM-709:[backend][docs]:Verify buildkite and obtain buildkite data with new API #889
Merged
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
02da8c1
ADM-709:[backend]feat: add verify token and get info for buildKite co…
2cbd26b
ADM-709:[backend]feat: add test for buildKite service
e7efec8
ADM-650:[docs]fix: fix docs
41f013d
ADM-709:[backend]fix: fix verify buildKite method
5cf2d13
ADM-709:[backend]fix: fix test
417165e
ADM-709:[backend]fix: fix error
4b48e0b
ADM-709:[backend]fix: add BuildKiteController Test
3c94296
ADM-709:[docs]fix: fix error message
74b50ff
Merge branch 'main' into ADM-709
Andrea2000728 110cb36
ADM-709:[backend]fix: fix assert
4c18f49
Merge remote-tracking branch 'origin/ADM-709' into ADM-709
f646eea
ADM-709:[backend]feat: add PipelineTypeEnum and rename
4fa9164
ADM-709:[docs]fix: fix docs
637eb8a
Merge branch 'main' into ADM-709
cb96143
ADM-709:[backend]fix: fix tests
cff1849
ADM-709:[backend]fix: format
e4372dc
Merge branch 'main' into ADM-709
Andrea2000728 53e4916
ADM-709:[backend]fix: rename PipelineType and add test
1bca7c1
Merge remote-tracking branch 'origin/ADM-709' into ADM-709
ebc3e81
ADM-709:[backend]fix: fix test
f81b9ea
ADM-709:[backend]fix: fix test
bfdc8fd
Merge branch 'main' into ADM-709
Andrea2000728 3680271
ADM-709:[backend]fix: fix buildKite type
354de53
ADM-709:[backend]fix: fix test
29695c7
ADM-709:[backend]fix: fix buildkite type
c1126fc
ADM-709:[backend]fix: fix buildkite type
7007521
Merge branch 'main' into ADM-709
Andrea2000728 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
backend/src/main/java/heartbeat/controller/pipeline/dto/request/PipelineType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package heartbeat.controller.pipeline.dto.request; | ||
|
||
import lombok.extern.log4j.Log4j2; | ||
|
||
@Log4j2 | ||
public enum PipelineType { | ||
|
||
BUILDKITE("buildkite"); | ||
|
||
public final String pipelineType; | ||
|
||
PipelineType(String pipelineType) { | ||
this.pipelineType = pipelineType; | ||
} | ||
|
||
public static PipelineType fromValue(String type) { | ||
return switch (type) { | ||
case "buildkite" -> BUILDKITE; | ||
default -> { | ||
log.error("Failed to match Pipeline type: {} ", type); | ||
throw new IllegalArgumentException("Pipeline type does not find!"); | ||
} | ||
}; | ||
} | ||
|
||
} |
20 changes: 20 additions & 0 deletions
20
backend/src/main/java/heartbeat/controller/pipeline/dto/request/TokenParam.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package heartbeat.controller.pipeline.dto.request; | ||
|
||
import jakarta.validation.Valid; | ||
import jakarta.validation.constraints.NotBlank; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Data | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class TokenParam { | ||
|
||
@Valid | ||
@NotBlank(message = "Token cannot be empty.") | ||
private String token; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
backend/src/test/java/heartbeat/controller/pipeline/dto/response/PipelineTypeTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package heartbeat.controller.pipeline.dto.response; | ||
|
||
import heartbeat.controller.pipeline.dto.request.PipelineType; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import static org.assertj.core.api.Assertions.assertThatThrownBy; | ||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
|
||
public class PipelineTypeTest { | ||
|
||
@Test | ||
public void shouldConvertValueToType() { | ||
PipelineType buildKiteType = PipelineType.fromValue("buildkite"); | ||
|
||
assertEquals(buildKiteType, PipelineType.BUILDKITE); | ||
} | ||
|
||
@Test | ||
public void shouldThrowExceptionWhenDateTypeNotSupported() { | ||
assertThatThrownBy(() -> PipelineType.fromValue("unknown")).isInstanceOf(IllegalArgumentException.class) | ||
.hasMessageContaining("Pipeline type does not find!"); | ||
} | ||
|
||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
given a
new line
betweengiven when then
refactor other test cases