Unable to find ToDo s

Earlier I was getting an error in pulling the codes from gitlab and now the code snippet I have got is quite fishy as I don’t find todo’s in it ,as specified in milestone , I am pasting my pulled code from javaApplicationManager.java to verify if my pulled file are original or not, In this code even I am not having main function,

pulled file
package com.crio.warmup.stock;

import com.crio.warmup.stock.dto.PortfolioTrade;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

class PortfolioManagerApplicationTest {

@Test
void mainReadFile() throws Exception {
//given
String filename = “trades.json”;
List expected = Arrays.asList(new String[]{“AAPL”, “MSFT”, “GOOGL”});

//when
List<String> results = PortfolioManagerApplication
    .mainReadFile(new String[]{filename});

//then
Assertions.assertEquals(expected, results);

}

@Test
void mainReadQuotes() throws Exception {
//given
String filename = “trades.json”;
List expected = Arrays.asList(new String[]{“MSFT”, “AAPL”, “GOOGL”});

//when
List<String> actual = PortfolioManagerApplication
    .mainReadQuotes(new String[]{filename, "2019-12-12"});

//then
Assertions.assertEquals(expected, actual);

}

@Test
public void testDebugValues() {
List responses = PortfolioManagerApplication.debugOutputs();
Assertions.assertTrue(responses.get(0).contains(“trades.json”));
}

}

@amanagar

Hey @divs30. You are looking at wrong file . You have to look for PortfolioManagerApplication.java

1 Like

Please close topic if you got the problem

You’re looking test file. You have to work on QMoney->qmoney->src->main. not in test file.

1 Like

Thanks was bit confused I found it from gitlab as well

Thank you, for attention

@visargdesai In this module after accepting incoming changes I got this file code
and my all previous codes are gone after accepting incoming changes. were we expected to accept both changes or need to populate code again on our own as first line of todo says // Copy the relavent code from #mainReadFile to parse the Json into PortfolioTrade list. which was present in my earlier code

// TODO: CRIO_TASK_MODULE_REST_API
// Copy the relavent code from #mainReadFile to parse the Json into PortfolioTrade list.
// Now That you have the list of PortfolioTrade already populated in module#1
// For each stock symbol in the portfolio trades,
// Call Tiingo api (https://api.tiingo.com/tiingo/daily//prices?startDate=&endDate=&token=)
// with
// 1. ticker = symbol in portfolio_trade
// 2. startDate = purchaseDate in portfolio_trade.
// 3. endDate = args[1]
// Use RestTemplate#getForObject in order to call the API,
// and deserialize the results in List
// Note - You may have to register on Tiingo to get the api_token.
// Please refer the the module documentation for the steps.
// Find out the closing price of the stock on the end_date and
// return the list of all symbols in ascending order by its close value on endDate
// Test the function using gradle commands below
// ./gradlew run --args=“trades.json 2020-01-01”
// ./gradlew run --args=“trades.json 2019-07-01”
// ./gradlew run --args=“trades.json 2019-12-03”
// And make sure that its printing correct results.

public static List mainReadQuotes(String[] args) throws IOException, URISyntaxException {
return Collections.emptyList();
}

public static void main(String[] args) throws Exception {
Thread.setDefaultUncaughtExceptionHandler(new UncaughtExceptionHandler());
ThreadContext.put(“runId”, UUID.randomUUID().toString());

printJsonObject(mainReadQuotes(args));

}
}

Yes. You need to accept both the changes and then modify the code manually by deleting useless part and keeping the good stuff

is there any way to backtrack :frowning:

got it ctrl +z thanks

1 Like

One of the options that you can implement is delete the current local repo.
Then go to module and do the setup until the git clone part.
Dont pull the stubs for module 1.
And then pull the stubs for module 2(last 2 commands)

1 Like

if you didnt commit after resolving conflict then you can use git reset command to go back to previous commit. (look online for how to use git reset)
Keep this in mind for future

hey @visargdesai @amanagar @akashchhetri I have accepted the incoming changes in javaApplicationManagerTest.java file as well , and now I feel this file is same as in module 1 here even git reset is not working if possible may you u confirm is this file is good to go else I will have problem in further task, if not than I will find someother ways

package com.crio.warmup.stock;

import com.crio.warmup.stock.dto.PortfolioTrade;
import java.time.LocalDate;
import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;

class PortfolioManagerApplicationTest {

@Test
void mainReadFile() throws Exception {
//given
String filename = “trades.json”;
List expected = Arrays.asList(new String[]{“AAPL”, “MSFT”, “GOOGL”});

//when
List<String> results = PortfolioManagerApplication
    .mainReadFile(new String[]{filename});

//then
Assertions.assertEquals(expected, results);

}

@Test
void mainReadQuotes() throws Exception {
//given
String filename = “trades.json”;
List expected = Arrays.asList(new String[]{“MSFT”, “AAPL”, “GOOGL”});

//when
List<String> actual = PortfolioManagerApplication
    .mainReadQuotes(new String[]{filename, "2019-12-12"});

//then
Assertions.assertEquals(expected, actual);

}

@Test
public void testDebugValues() {
List responses = PortfolioManagerApplication.debugOutputs();
Assertions.assertTrue(responses.get(0).contains(“trades.json”));
}

}

Hey, @divs30 this file is a test file for module 2 yes it is correct. Now check this out QMoney->qmoney->src->main->java then search for file PortfolioApplicatioManager.java
In this file check TODO’s for Mod 2. If they are present there then confirm this by reply

1 Like

Yes todo’s in PortfolioApplicatioManager.java are present, thanks now I can go ahead :slight_smile:

1 Like

Welcome, All the best for the rest of the modules. :+1:

1 Like