Skip to content

Commit

Permalink
#169 - Updated misc maven deps - no problems
Browse files Browse the repository at this point in the history
  • Loading branch information
gazbert committed Nov 12, 2024
1 parent 1578a17 commit 68ff671
Show file tree
Hide file tree
Showing 8 changed files with 393 additions and 478 deletions.
Binary file removed .mvn/wrapper/maven-wrapper.jar
Binary file not shown.
5 changes: 3 additions & 2 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,6 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.6/apache-maven-3.9.6-bin.zip
wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.9/apache-maven-3.9.9-bin.zip
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ and evaluate the bot, Docker is the way to go.
1. To re-attach to the Docker container, run `docker container ls` to get the CONTAINER ID.
Then run: `docker container attach <CONTAINER ID>`

You could modify the [Dockerfile](./Dockerfile) to make the bot cloud native, e.g. run in Kubernetes. The config could
You could modify the [Dockerfile](./Dockerfile) to containerise the bot and deploy to Kubernetes. The config can
be externalised using a Docker [volume](https://docs.docker.com/engine/storage/) mount.

## Build Guide
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,11 @@ public abstract class AbstractControllerTest {

protected MockMvc mockMvc;

/**
* Sets the Jackson HTTP converters.
*
* @param converters the HTTP converters.
*/
@Autowired
protected void setConverters(HttpMessageConverter<?>[] converters) {
mappingJackson2HttpMessageConverter =
Expand All @@ -97,6 +102,13 @@ protected void setConverters(HttpMessageConverter<?>[] converters) {
// Shared utils
// --------------------------------------------------------------------------

/**
* Builds the Authorization header value.
*
* @param username the username.
* @param password the password
* @return the Authorization header value.
*/
protected String buildAuthorizationHeaderValue(String username, String password) {
return "Basic "
+ new String(
Expand All @@ -105,10 +117,14 @@ protected String buildAuthorizationHeaderValue(String username, String password)
StandardCharsets.UTF_8);
}

/*
* Builds a JWT response.
* Kudos to @royclarkson for his OAuth2 version:
* https://github.com/royclarkson/spring-rest-service-oauth
/**
* Builds a JWT response. Kudos to @royclarkson for his OAuth2 version: <a
* href="https://github.com/royclarkson/spring-rest-service-oauth">See here.</a>
*
* @param username the username.
* @param password the password.
* @return the JWT.
* @throws Exception if anything breaks.
*/
protected String getJwt(String username, String password) throws Exception {

Expand All @@ -130,6 +146,13 @@ protected String getJwt(String username, String password) throws Exception {
return jwtResponse.getToken();
}

/**
* Converts an Object into a JSON string.
*
* @param objectToJsonify the object to convert.
* @return the JSON string.
* @throws IOException if the conversion fails.
*/
protected String jsonify(Object objectToJsonify) throws IOException {
final MockHttpOutputMessage mockHttpOutputMessage = new MockHttpOutputMessage();
mappingJackson2HttpMessageConverter.write(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,10 @@
import java.util.Set;

/**
* <p>
* Encapsulates any (optional) configuration for a Trading Strategy.
* Basically just a map of key-value pairs.
* </p>
* Encapsulates any (optional) configuration for a Trading Strategy. Basically just a map of
* key-value pairs.
*
* <p>
* Configuration comes from the strategies.yaml file.
* </p>
* <p>Configuration comes from the strategies.yaml file.
*
* @author gazbert
* @since 1.0
Expand Down
Loading

0 comments on commit 68ff671

Please sign in to comment.